diff --git a/build.gradle b/build.gradle index 1a771e42..ace30d5e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,54 +1,27 @@ 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' +apply plugin: 'fabric-loom' - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_1_8 - version = "${project.minecraft_version}-${project.version}" +version = "${project.minecraft_version}-${project.version}" - if (project.release != 'RELEASE') { - version += "-${project.release}" - } +if (project.release != 'RELEASE') { + version += "-${project.release}" +} - group = project.group - description = project.displayname - archivesBaseName = project.name +group = project.group +description = project.displayname +archivesBaseName = project.name - // check for updates every build when on CI - if (System.env.CI) { - configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' - } - } - - 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" - } - - processResources { - inputs.property "version", project.version - - filesMatching("fabric.mod.json") { - expand "version": project.version - } - } - - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - } - - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +// check for updates every build when on CI +if (System.env.CI) { + configurations.all { + resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } } @@ -56,6 +29,40 @@ 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 { + inputs.property "version", project.version + + filesMatching("fabric.mod.json") { + expand "version": project.version + } +} + +tasks.withType(JavaCompile) { + options.encoding = "UTF-8" +} + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = "sources" + from sourceSets.main.allSource +} + repositories { maven { name = 'minelp' @@ -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") - } -} diff --git a/canvas-compat/build.gradle b/canvas-compat/build.gradle deleted file mode 100644 index 8f123ace..00000000 --- a/canvas-compat/build.gradle +++ /dev/null @@ -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 - } -} diff --git a/canvas-compat/gradle.properties b/canvas-compat/gradle.properties deleted file mode 100644 index ebf68754..00000000 --- a/canvas-compat/gradle.properties +++ /dev/null @@ -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.+ diff --git a/canvas-compat/src/main/java/com/minelittlepony/unicopia/client/render/CanvasCompat.java b/canvas-compat/src/main/java/com/minelittlepony/unicopia/client/render/CanvasCompat.java deleted file mode 100644 index 8340f639..00000000 --- a/canvas-compat/src/main/java/com/minelittlepony/unicopia/client/render/CanvasCompat.java +++ /dev/null @@ -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); - } -} diff --git a/canvas-compat/src/main/java/com/minelittlepony/unicopia/client/render/CanvasCompatImpl.java b/canvas-compat/src/main/java/com/minelittlepony/unicopia/client/render/CanvasCompatImpl.java deleted file mode 100644 index 5e2d2451..00000000 --- a/canvas-compat/src/main/java/com/minelittlepony/unicopia/client/render/CanvasCompatImpl.java +++ /dev/null @@ -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()); - } -} diff --git a/canvas-compat/src/main/resources/fabric.mod.json b/canvas-compat/src/main/resources/fabric.mod.json deleted file mode 100644 index b7d2215c..00000000 --- a/canvas-compat/src/main/resources/fabric.mod.json +++ /dev/null @@ -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 - } -} diff --git a/settings.gradle b/settings.gradle index 8acce826..a5a8746d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,5 +9,3 @@ pluginManagement { } } rootProject.name = 'Unicopia' - -include 'canvas-compat' diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java index e32ae037..da7e6f42 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/BraceletFeatureRenderer.java @@ -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 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());