Skip to content

Commit

Permalink
Option to disable armor glint
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixces committed Jun 29, 2024
1 parent 46d2a54 commit f31dd92
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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<T extends ModelBase> implements LayerRenderer<EntityLivingBase> {

@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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f31dd92

Please sign in to comment.