diff --git a/build.gradle.kts b/build.gradle.kts index 615d3abf53..c433288c28 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,13 +5,13 @@ plugins { } val MINECRAFT_VERSION by extra { "1.21.1" } -val NEOFORGE_VERSION by extra { "21.1.19" } +val NEOFORGE_VERSION by extra { "21.1.62" } val FABRIC_LOADER_VERSION by extra { "0.16.0" } val FABRIC_API_VERSION by extra { "0.102.0+1.21.1" } val SODIUM_FILE by extra { "sodium-LOADER-0.6.0-beta.2+mc1.21.1.jar" } // https://semver.org/ -val MOD_VERSION by extra { "1.8.0-beta.4" } +val MOD_VERSION by extra { "1.8.0-beta.5" } allprojects { apply(plugin = "java") diff --git a/common/src/main/java/net/irisshaders/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java b/common/src/main/java/net/irisshaders/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java index 9e85dc4f6b..68874ad354 100644 --- a/common/src/main/java/net/irisshaders/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java +++ b/common/src/main/java/net/irisshaders/iris/mixin/entity_render_context/MixinHumanoidArmorLayer.java @@ -21,6 +21,7 @@ import net.minecraft.world.item.armortrim.ArmorTrim; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Group; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -32,7 +33,8 @@ public MixinHumanoidArmorLayer(RenderLayerParent pRenderLayer0) { super(pRenderLayer0); } - @Inject(method = "renderArmorPiece", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/HumanoidModel;copyPropertiesTo(Lnet/minecraft/client/model/HumanoidModel;)V")) + @Group(name = "armorPieceForge", min = 1, max = 1) + @Inject(method = "renderArmorPiece(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/entity/EquipmentSlot;ILnet/minecraft/client/model/HumanoidModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/HumanoidModel;copyPropertiesTo(Lnet/minecraft/client/model/HumanoidModel;)V")) private void changeId(PoseStack pHumanoidArmorLayer0, MultiBufferSource pMultiBufferSource1, T pLivingEntity2, EquipmentSlot pEquipmentSlot3, int pInt4, A pHumanoidModel5, CallbackInfo ci, @Local ArmorItem lvArmorItem8) { if (WorldRenderingSettings.INSTANCE.getItemIds() == null) return; @@ -41,6 +43,16 @@ private void changeId(PoseStack pHumanoidArmorLayer0, MultiBufferSource pMultiBu CapturedRenderingState.INSTANCE.setCurrentRenderedItem(WorldRenderingSettings.INSTANCE.getItemIds().applyAsInt(new NamespacedId(location.getNamespace(), location.getPath()))); } + @Group(name = "armorPieceForge", min = 1, max = 1) + @Inject(method = "Lnet/minecraft/client/renderer/entity/layers/HumanoidArmorLayer;renderArmorPiece(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/entity/EquipmentSlot;ILnet/minecraft/client/model/HumanoidModel;FFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/HumanoidModel;copyPropertiesTo(Lnet/minecraft/client/model/HumanoidModel;)V")) + private void changeIdF(PoseStack pHumanoidArmorLayer0, MultiBufferSource pMultiBufferSource1, T pLivingEntity2, EquipmentSlot pEquipmentSlot3, int pInt4, A pHumanoidModel5, float limbSwing, float limbSwingAmount, float partialTick, float ageInTicks, float netHeadYaw, float headPitch, CallbackInfo ci, @Local ArmorItem lvArmorItem8) { + if (WorldRenderingSettings.INSTANCE.getItemIds() == null) return; + + ResourceLocation location = BuiltInRegistries.ITEM.getKey(lvArmorItem8); + + CapturedRenderingState.INSTANCE.setCurrentRenderedItem(WorldRenderingSettings.INSTANCE.getItemIds().applyAsInt(new NamespacedId(location.getNamespace(), location.getPath()))); + } + @Inject(method = "renderTrim(Lnet/minecraft/core/Holder;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/item/armortrim/ArmorTrim;Lnet/minecraft/client/model/HumanoidModel;Z)V", at = @At(value = "HEAD")) private void changeTrimTemp(Holder holder, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, ArmorTrim armorTrim, A humanoidModel, boolean bl, CallbackInfo ci) { if (WorldRenderingSettings.INSTANCE.getItemIds() == null) return;