From 1f955205b62ea8314255a15bf839a5639b9de203 Mon Sep 17 00:00:00 2001 From: ev chang Date: Mon, 24 Jun 2024 20:49:02 +0700 Subject: [PATCH] stop overflowanimations config from corrupting --- .../overflowanimations/config/OldAnimationsSettings.java | 2 +- .../overflowanimations/mixin/LayerArmorBaseMixin.java | 4 ++-- .../mixin/layers/LayerArmorBaseMixin.java | 2 +- .../mixin/layers/LayerEnderDragonEyesMixin.java | 2 +- .../mixin/layers/LayerEndermanEyesMixin.java | 2 +- .../overflowanimations/mixin/layers/LayerSaddleMixin.java | 2 +- .../mixin/layers/LayerSheepWoolMixin.java | 2 +- .../overflowanimations/mixin/layers/LayerSlimeGelMixin.java | 2 +- .../mixin/layers/LayerSpiderEyesMixin.java | 2 +- .../mixin/layers/LayerWolfCollarMixin.java | 2 +- .../mixin/layers/RendererLivingEntityMixin.java | 6 +++--- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java b/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java index 6f99fc4..1669c32 100644 --- a/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java +++ b/src/main/java/org/polyfrost/overflowanimations/config/OldAnimationsSettings.java @@ -103,7 +103,7 @@ public class OldAnimationsSettings extends Config { category = "Animations", subcategory = "Interaction" ) - public int redArmor = 3; + public int armorDamageTintStyle = 3; @Switch( name = "1.7 Item Switching Animation", diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/LayerArmorBaseMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/LayerArmorBaseMixin.java index 7f256c7..d074951 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/LayerArmorBaseMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/LayerArmorBaseMixin.java @@ -36,7 +36,7 @@ public abstract class LayerArmorBaseMixin implements LayerR @Inject(method = "renderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$addRender(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 3 && OldAnimationsSettings.INSTANCE.enabled && ((RendererLivingEntityInvoker) renderer).invokeSetDoRenderBrightness(entitylivingbaseIn, partialTicks)) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 3 && OldAnimationsSettings.INSTANCE.enabled && ((RendererLivingEntityInvoker) renderer).invokeSetDoRenderBrightness(entitylivingbaseIn, partialTicks)) { overflowAnimations$t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale); ((RendererLivingEntityInvoker) renderer).invokeUnsetBrightness(); } @@ -44,7 +44,7 @@ public abstract class LayerArmorBaseMixin implements LayerR @Inject(method = "shouldCombineTextures", at = @At(value = "HEAD"), cancellable = true) public void overflowAnimations$allowCombine(CallbackInfoReturnable cir) { - cir.setReturnValue(OldAnimationsSettings.INSTANCE.redArmor == 2 && OldAnimationsSettings.INSTANCE.enabled); + cir.setReturnValue(OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 2 && OldAnimationsSettings.INSTANCE.enabled); } } diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerArmorBaseMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerArmorBaseMixin.java index 56e568a..74fd3a8 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerArmorBaseMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerArmorBaseMixin.java @@ -19,7 +19,7 @@ public abstract class LayerArmorBaseMixin implements LayerR @Inject(method = "renderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", ordinal = 1, shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntityLivingBase entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { T t = this.getArmorModel(armorSlot); boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks); diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEnderDragonEyesMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEnderDragonEyesMixin.java index 47ca9ca..8ea723a 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEnderDragonEyesMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEnderDragonEyesMixin.java @@ -19,7 +19,7 @@ public abstract class LayerEnderDragonEyesMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/boss/EntityDragon;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntityDragon entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEndermanEyesMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEndermanEyesMixin.java index 5197197..575323b 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEndermanEyesMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerEndermanEyesMixin.java @@ -19,7 +19,7 @@ public abstract class LayerEndermanEyesMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntityEnderman;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntityEnderman entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSaddleMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSaddleMixin.java index d978e87..260caec 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSaddleMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSaddleMixin.java @@ -19,7 +19,7 @@ public abstract class LayerSaddleMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/passive/EntityPig;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPig;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntityPig var1, float var2, float var3, float var4, float var5, float var6, float var7, float var8, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = var1.hurtTime > 0 || var1.deathTime > 0; HitColorHook.renderHitColorPre(var1, bl, var4); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSheepWoolMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSheepWoolMixin.java index c2752fa..ac810d7 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSheepWoolMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSheepWoolMixin.java @@ -19,7 +19,7 @@ public abstract class LayerSheepWoolMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/passive/EntitySheep;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelSheep1;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntitySheep entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSlimeGelMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSlimeGelMixin.java index c14fdf8..4e6761e 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSlimeGelMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSlimeGelMixin.java @@ -19,7 +19,7 @@ public abstract class LayerSlimeGelMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySlime;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER), cancellable = true) public void overflowAnimations$renderHitColor(EntitySlime var1, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = var1.hurtTime > 0 || var1.deathTime > 0; HitColorHook.renderHitColorPre(var1, bl, partialTicks); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSpiderEyesMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSpiderEyesMixin.java index 09e8c91..e4b8fec 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSpiderEyesMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerSpiderEyesMixin.java @@ -19,7 +19,7 @@ public abstract class LayerSpiderEyesMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/monster/EntitySpider;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntitySpider entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerWolfCollarMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerWolfCollarMixin.java index 78266b4..b800d0a 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerWolfCollarMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/LayerWolfCollarMixin.java @@ -19,7 +19,7 @@ public abstract class LayerWolfCollarMixin { @Inject(method = "doRenderLayer(Lnet/minecraft/entity/passive/EntityWolf;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelBase;render(Lnet/minecraft/entity/Entity;FFFFFF)V", shift = At.Shift.AFTER)) public void overflowAnimations$renderHitColor(EntityWolf entitylivingbaseIn, float f, float g, float partialTicks, float h, float i, float j, float scale, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { boolean bl = entitylivingbaseIn.hurtTime > 0 || entitylivingbaseIn.deathTime > 0; HitColorHook.renderHitColorPre(entitylivingbaseIn, bl, partialTicks); if (bl) { diff --git a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/RendererLivingEntityMixin.java b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/RendererLivingEntityMixin.java index 21c13f9..3e2b2d8 100644 --- a/src/main/java/org/polyfrost/overflowanimations/mixin/layers/RendererLivingEntityMixin.java +++ b/src/main/java/org/polyfrost/overflowanimations/mixin/layers/RendererLivingEntityMixin.java @@ -29,17 +29,17 @@ protected RendererLivingEntityMixin(RenderManager renderManager) { @Redirect(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RendererLivingEntity;setDoRenderBrightness(Lnet/minecraft/entity/EntityLivingBase;F)Z")) public boolean overflowAnimations$disableBrightness(RendererLivingEntity instance, T entityLivingBaseIn, float partialTicks) { - return (OldAnimationsSettings.INSTANCE.redArmor != 1 || !OldAnimationsSettings.INSTANCE.enabled) && setDoRenderBrightness(entityLivingBaseIn, partialTicks); + return (OldAnimationsSettings.INSTANCE.armorDamageTintStyle != 1 || !OldAnimationsSettings.INSTANCE.enabled) && setDoRenderBrightness(entityLivingBaseIn, partialTicks); } @Redirect(method = "renderLayers", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RendererLivingEntity;setBrightness(Lnet/minecraft/entity/EntityLivingBase;FZ)Z")) public boolean overflowAnimations$disableLayerBrightness(RendererLivingEntity instance, T f2, float f3, boolean f4) { - return (OldAnimationsSettings.INSTANCE.redArmor != 1 || !OldAnimationsSettings.INSTANCE.enabled) && setBrightness(f2, f3, f4); + return (OldAnimationsSettings.INSTANCE.armorDamageTintStyle != 1 || !OldAnimationsSettings.INSTANCE.enabled) && setBrightness(f2, f3, f4); } @Inject(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;depthMask(Z)V")) public void overflowAnimations$renderHitColor(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { - if (OldAnimationsSettings.INSTANCE.redArmor == 1 && OldAnimationsSettings.INSTANCE.enabled) { + if (OldAnimationsSettings.INSTANCE.armorDamageTintStyle == 1 && OldAnimationsSettings.INSTANCE.enabled) { float f = interpolateRotation(entity.prevRenderYawOffset, entity.renderYawOffset, partialTicks); float f1 = interpolateRotation(entity.prevRotationYawHead, entity.rotationYawHead, partialTicks); float f2 = f1 - f;