diff --git a/build.gradle b/build.gradle index b7e4834..3b1fc7e 100644 --- a/build.gradle +++ b/build.gradle @@ -111,7 +111,7 @@ publishing { } // TODO: infer from fabric.mod.json?! -def supportedVersions = ["1.19.3"] +def supportedVersions = ["1.19.4"] def verName = "Indium ${project.mod_version} for Minecraft ${project.minecraft_version}/Sodium ${project.sodium_version}" // Check version is as expected diff --git a/gradle.properties b/gradle.properties index 90293c8..1575ed3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,17 +2,17 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.19.3 -yarn_mappings=1.19.3+build.5 -loader_version=0.14.14 +minecraft_version=1.19.4 +yarn_mappings=1.19.4+build.1 +loader_version=0.14.17 # Mod Properties -mod_version=1.0.14 +mod_version=1.0.15 maven_group=link.infra archives_base_name=indium # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.73.0+1.19.3 -sodium_version=0.4.9 +fabric_version=0.75.3+1.19.4 +sodium_version=0.4.10 # Publishing metadata curseforge_id=459496 source_url=https://github.com/comp500/Indium/ diff --git a/src/main/java/link/infra/indium/mixin/renderer/MixinItemRenderer.java b/src/main/java/link/infra/indium/mixin/renderer/MixinItemRenderer.java index 46bd3a2..fdbc37f 100644 --- a/src/main/java/link/infra/indium/mixin/renderer/MixinItemRenderer.java +++ b/src/main/java/link/infra/indium/mixin/renderer/MixinItemRenderer.java @@ -16,13 +16,6 @@ package link.infra.indium.mixin.renderer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import link.infra.indium.renderer.accessor.AccessItemRenderer; import link.infra.indium.renderer.render.IndiumQuadHandler; import link.infra.indium.renderer.render.ItemRenderContext; @@ -32,9 +25,15 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.BakedModel; -import net.minecraft.client.render.model.json.ModelTransformation; +import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ItemRenderer.class) public abstract class MixinItemRenderer implements AccessItemRenderer { @@ -50,8 +49,8 @@ public abstract class MixinItemRenderer implements AccessItemRenderer { @Shadow protected abstract void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrixStack, VertexConsumer buffer); - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/BakedModel;isBuiltin()Z"), method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformation$Mode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/client/render/model/BakedModel;)V", cancellable = true) - public void hook_renderItem(ItemStack stack, ModelTransformation.Mode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, BakedModel model, CallbackInfo ci) { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/BakedModel;isBuiltin()Z"), method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformationMode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/client/render/model/BakedModel;)V", cancellable = true) + public void hook_renderItem(ItemStack stack, ModelTransformationMode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, BakedModel model, CallbackInfo ci) { if (!((FabricBakedModel) model).isVanillaAdapter()) { indium_contexts.get().renderModel(stack, transformMode, invert, matrixStack, vertexConsumerProvider, light, overlay, model, indium_vanillaHandler); matrixStack.pop(); diff --git a/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java b/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java index 7efc2af..d7c8665 100644 --- a/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java +++ b/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java @@ -16,15 +16,6 @@ package link.infra.indium.renderer.render; -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import net.minecraft.util.math.random.LocalRandom; -import net.minecraft.util.math.random.RandomSeed; -import org.jetbrains.annotations.Nullable; -import org.joml.Vector3f; - import link.infra.indium.renderer.IndiumRenderer; import link.infra.indium.renderer.RenderMaterialImpl; import link.infra.indium.renderer.helper.ColorHelper; @@ -39,22 +30,25 @@ import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; import net.minecraft.client.color.item.ItemColors; -import net.minecraft.client.render.LightmapTextureManager; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.RenderLayers; -import net.minecraft.client.render.TexturedRenderLayers; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.*; import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.BakedQuad; -import net.minecraft.client.render.model.json.ModelTransformation.Mode; +import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.LocalRandom; import net.minecraft.util.math.random.Random; +import net.minecraft.util.math.random.RandomSeed; +import org.jetbrains.annotations.Nullable; +import org.joml.Vector3f; + +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Supplier; /** * The render context used for item rendering. @@ -83,7 +77,7 @@ public interface VanillaQuadHandler { private final FallbackConsumer fallbackConsumer = new FallbackConsumer(); private ItemStack itemStack; - private Mode transformMode; + private ModelTransformationMode transformMode; private MatrixStack matrixStack; private VertexConsumerProvider vertexConsumerProvider; private int lightmap; @@ -99,7 +93,7 @@ public ItemRenderContext(ItemColors colorMap) { this.colorMap = colorMap; } - public void renderModel(ItemStack itemStack, Mode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int lightmap, int overlay, BakedModel model, VanillaQuadHandler vanillaHandler) { + public void renderModel(ItemStack itemStack, ModelTransformationMode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int lightmap, int overlay, BakedModel model, VanillaQuadHandler vanillaHandler) { this.itemStack = itemStack; this.transformMode = transformMode; this.matrixStack = matrixStack; @@ -136,7 +130,7 @@ private void computeOutputInfo() { isDefaultTranslucent = false; } - if (transformMode != Mode.GUI && !transformMode.isFirstPerson()) { + if (transformMode != ModelTransformationMode.GUI && !transformMode.isFirstPerson()) { isTranslucentDirect = false; } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1cff13a..bbae7a3 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,8 +28,8 @@ ], "depends": { "fabricloader": ">=0.8.0", - "minecraft": "~1.19.3", - "sodium": "0.4.9", + "minecraft": "~1.19.4", + "sodium": "0.4.10", "fabric-renderer-api-v1": ">=2.1.1", "fabric-resource-loader-v0": ">=0.4.0" }