diff --git a/src/main/java/org/polyfrost/glintcolorizer/mixin/LayerArmorBaseMixin.java b/src/main/java/org/polyfrost/glintcolorizer/mixin/LayerArmorBaseMixin.java index a6ed7b9..4fcfbc6 100644 --- a/src/main/java/org/polyfrost/glintcolorizer/mixin/LayerArmorBaseMixin.java +++ b/src/main/java/org/polyfrost/glintcolorizer/mixin/LayerArmorBaseMixin.java @@ -1,18 +1,36 @@ package org.polyfrost.glintcolorizer.mixin; import cc.polyfrost.oneconfig.utils.color.ColorUtils; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; +import net.minecraft.entity.EntityLivingBase; import org.polyfrost.glintcolorizer.config.GlintConfig; import net.minecraft.client.renderer.entity.layers.LayerArmorBase; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyArgs; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.invoke.arg.Args; @Mixin( value = LayerArmorBase.class, priority = Integer.MIN_VALUE ) -public class LayerArmorBaseMixin { +public abstract class LayerArmorBaseMixin implements LayerRenderer { + + @Inject( + method = "renderGlint", + at = @At( + value = "HEAD" + ), + cancellable = true + ) + private void glintColorizer$disableGlint(EntityLivingBase entitylivingbaseIn, T modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale, CallbackInfo ci) { + if (GlintConfig.INSTANCE.getArmorGlintToggle() && GlintConfig.INSTANCE.enabled) { + ci.cancel(); + } + } @ModifyArgs( method = "renderGlint", diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt index a57772b..6feead1 100644 --- a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt @@ -161,6 +161,14 @@ object GlintConfig : Config( openGui() } + @Switch( + name = "Disable Armor Glint", + category = "Armor", + subcategory = "Color", + description = "Disables the enchantment glint on armor." + ) + var armorGlintToggle = false + @Color( name = "Armor Glint Color", category = "Armor",