mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 13:37:58 +01:00
Removed canvas interop. Not worth it.
This commit is contained in:
parent
441b01f8d3
commit
64c5f2f3f1
8 changed files with 51 additions and 175 deletions
43
build.gradle
43
build.gradle
|
@ -1,9 +1,8 @@
|
|||
plugins {
|
||||
id 'java-library'
|
||||
id 'fabric-loom' version '0.8-SNAPSHOT' apply false
|
||||
id 'fabric-loom' version '0.8-SNAPSHOT'
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'fabric-loom'
|
||||
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
@ -26,12 +25,25 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
refmapName = 'unicopia.mixin.refmap.json'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||
modApi "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
|
||||
|
||||
modApi "com.minelittlepony:MineLittlePony:${project.minelp_version}"
|
||||
|
||||
modApi "com.minelittlepony:Kirin:${project.kirin_version}"
|
||||
include "com.minelittlepony:Kirin:${project.kirin_version}"
|
||||
|
||||
modCompileOnly("io.github.prospector:modmenu:${project.modmenu_version}") {
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@ -50,11 +62,6 @@ allprojects {
|
|||
classifier = "sources"
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
refmapName = 'unicopia.mixin.refmap.json'
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
|
@ -67,26 +74,4 @@ repositories {
|
|||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modApi "com.minelittlepony:MineLittlePony:${project.minelp_version}"
|
||||
|
||||
modApi "com.minelittlepony:Kirin:${project.kirin_version}"
|
||||
include "com.minelittlepony:Kirin:${project.kirin_version}"
|
||||
|
||||
modCompileOnly("io.github.prospector:modmenu:${project.modmenu_version}") {
|
||||
transitive = false
|
||||
}
|
||||
|
||||
// Fix circular error when gradle tries to build this project as a pre-requisite to :canvas-compat
|
||||
// Build will fail if the sub-project isn't built first though,
|
||||
// so make sure to run gradlew :canvas-compat:build before doing gradlew build
|
||||
if (file("./canvas-compat/build/libs/${project(':canvas-compat').jar.archiveName}").exists()) {
|
||||
modCompileOnly(project(":canvas-compat")) {
|
||||
transitive = false
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
include project(":canvas-compat")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
plugins {
|
||||
id 'java-library'
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "dblsaiko"
|
||||
url = "https://maven.dblsaiko.net/"
|
||||
}
|
||||
maven {
|
||||
name = "Cotton"
|
||||
allowInsecureProtocol = true
|
||||
url = "http://server.bbkr.space:8081/artifactory/libs-release/"
|
||||
}
|
||||
maven {
|
||||
name = "Shedanial"
|
||||
url = "https://maven.shedaniel.me/"
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modCompileOnly("grondag:canvas-mc116:${project.canvas_version}") {
|
||||
exclude(module: "fabric-api")
|
||||
exclude(module: "fabric-loader")
|
||||
transitive = false
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.16.4
|
||||
yarn_mappings=1.16.4+build.6
|
||||
loader_version=0.10.6+build.214
|
||||
fabric_version=0.30.0+1.16
|
||||
|
||||
# Mod Properties
|
||||
group=com.minelittlepony
|
||||
displayname=Unicopia-CanvasCompat
|
||||
authors=Sollace
|
||||
description=Magical Abilities for Mine Little Pony!
|
||||
version=1
|
||||
release=RELEASE
|
||||
|
||||
# Dependencies
|
||||
canvas_version=1.0.+
|
|
@ -1,19 +0,0 @@
|
|||
package com.minelittlepony.unicopia.client.render;
|
||||
|
||||
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.item.ItemRenderer;
|
||||
|
||||
public final class CanvasCompat {
|
||||
private CanvasCompat() {}
|
||||
public static VertexConsumer getGlowingConsumer(boolean glowing, VertexConsumerProvider renderContext, RenderLayer layer) {
|
||||
if (!glowing || !RendererAccess.INSTANCE.hasRenderer() || !FabricLoader.getInstance().isModLoaded("canvas")) {
|
||||
return ItemRenderer.getArmorGlintConsumer(renderContext, layer, false, false);
|
||||
}
|
||||
|
||||
return CanvasCompatImpl.getGlowingConsumer(glowing, renderContext, layer);
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.minelittlepony.unicopia.client.render;
|
||||
|
||||
import grondag.canvas.material.state.MaterialFinderImpl;
|
||||
import grondag.canvas.material.state.RenderLayerHelper;
|
||||
import grondag.frex.api.material.FrexVertexConsumerProvider;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.item.ItemRenderer;
|
||||
|
||||
final class CanvasCompatImpl {
|
||||
private CanvasCompatImpl() {}
|
||||
public static VertexConsumer getGlowingConsumer(boolean glowing, VertexConsumerProvider renderContext, RenderLayer layer) {
|
||||
if (!(renderContext instanceof FrexVertexConsumerProvider)) {
|
||||
return ItemRenderer.getArmorGlintConsumer(renderContext, layer, false, false);
|
||||
}
|
||||
|
||||
return ((FrexVertexConsumerProvider)renderContext).getConsumer(MaterialFinderImpl.threadLocal()
|
||||
.copyFrom(RenderLayerHelper.copyFromLayer(layer))
|
||||
.emissive(true)
|
||||
.find());
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "unicopia_canvas_compat",
|
||||
"version": "${version}",
|
||||
"name": "Unicopia-Canvas_compat",
|
||||
"description": "Magical Abilities for Mine Little Pony!",
|
||||
"authors": [ "Sollace" ],
|
||||
"contact": {
|
||||
"sources": "https://github.com/Sollace/Unicopia",
|
||||
"issues": "https://github.com/Sollace/Unicopia/issues"
|
||||
},
|
||||
"mixins": [ ],
|
||||
"license": "MIT",
|
||||
"environment": "*",
|
||||
"custom": {
|
||||
"modmenu:clientsideOnly": true,
|
||||
"modmenu:api": true
|
||||
}
|
||||
}
|
|
@ -9,5 +9,3 @@ pluginManagement {
|
|||
}
|
||||
}
|
||||
rootProject.name = 'Unicopia'
|
||||
|
||||
include 'canvas-compat'
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.client.render.VertexConsumer;
|
|||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.entity.feature.FeatureRendererContext;
|
||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.client.render.item.ItemRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
|
@ -58,7 +59,7 @@ public class BraceletFeatureRenderer<E extends LivingEntity> implements Accessor
|
|||
|
||||
boolean glowing = ((GlowableItem)item.getItem()).isGlowing(item);
|
||||
|
||||
VertexConsumer consumer = CanvasCompat.getGlowingConsumer(glowing, renderContext, RenderLayer.getArmorCutoutNoCull(TEXTURE));
|
||||
VertexConsumer consumer = ItemRenderer.getArmorGlintConsumer(renderContext, RenderLayer.getArmorCutoutNoCull(TEXTURE), false, false);
|
||||
|
||||
model.setAngles(context.getModel());
|
||||
model.setVisible(entity.getMainArm());
|
||||
|
|
Loading…
Reference in a new issue