diff --git a/build.gradle.kts b/build.gradle.kts index 099082e..ea462ed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -79,7 +79,10 @@ val shade: Configuration by configurations.creating { // Configures the output directory for when building from the `src/resources` directory. sourceSets { + val dummy by creating main { + dummy.compileClasspath += compileClasspath + compileClasspath += dummy.output output.setResourcesDir(java.classesDirectory) } } diff --git a/src/dummy/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java b/src/dummy/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java new file mode 100644 index 0000000..aa0a9b7 --- /dev/null +++ b/src/dummy/java/cc/polyfrost/oneconfig/internal/config/annotations/Option.java @@ -0,0 +1,4 @@ +package cc.polyfrost.oneconfig.internal.config.annotations; + +public @interface Option { +} \ No newline at end of file diff --git a/src/main/java/org/polyfrost/glintcolorizer/mixin/RenderItemMixin_GlintCustomizer.java b/src/main/java/org/polyfrost/glintcolorizer/mixin/RenderItemMixin_GlintCustomizer.java index 0cf52f4..bea38f4 100644 --- a/src/main/java/org/polyfrost/glintcolorizer/mixin/RenderItemMixin_GlintCustomizer.java +++ b/src/main/java/org/polyfrost/glintcolorizer/mixin/RenderItemMixin_GlintCustomizer.java @@ -2,6 +2,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import org.polyfrost.glintcolorizer.config.ColorSettings; import org.polyfrost.glintcolorizer.config.GlintConfig; import org.polyfrost.glintcolorizer.hook.RenderItemHook; import net.minecraft.client.renderer.GlStateManager; @@ -110,9 +111,7 @@ public class RenderItemMixin_GlintCustomizer { @Unique private int glintColorizer$getModifiedColor(int color, boolean isFirstStroke) { if (RenderItemHook.INSTANCE.isRenderingHeld()) { - return GlintConfig.INSTANCE.getHeldIndividualStrokes() ? - (isFirstStroke ? GlintConfig.INSTANCE.getHeldStrokeOne().getRGB() : GlintConfig.INSTANCE.getHeldStrokeTwo().getRGB()) : - GlintConfig.INSTANCE.getHeldColor().getRGB(); + return glintColorizer$getColor(GlintConfig.INSTANCE.getHeldItem(), isFirstStroke); } if (RenderItemHook.INSTANCE.isRenderingInGUI()) { @@ -120,30 +119,29 @@ public class RenderItemMixin_GlintCustomizer { return glintColorizer$getPotionColor(RenderItemHook.INSTANCE.getItemStack()); } if (GlintConfig.INSTANCE.getPotionGlintBackground() && RenderItemHook.INSTANCE.isPotionItem()) { - return GlintConfig.INSTANCE.getShinyIndividualStrokes() ? - (isFirstStroke ? GlintConfig.INSTANCE.getShinyStrokeOne().getRGB() : GlintConfig.INSTANCE.getShinyStrokeTwo().getRGB()) : - GlintConfig.INSTANCE.getShinyColor().getRGB(); + return glintColorizer$getColor(GlintConfig.INSTANCE.getShinyPots(), isFirstStroke); } - return GlintConfig.INSTANCE.getGuiIndividualStrokes() ? - (isFirstStroke ? GlintConfig.INSTANCE.getGuiStrokeOne().getRGB() : GlintConfig.INSTANCE.getGuiStrokeTwo().getRGB()) : - GlintConfig.INSTANCE.getGuiColor().getRGB(); + return glintColorizer$getColor(GlintConfig.INSTANCE.getGuiItem(), isFirstStroke); } if (RenderItemHook.INSTANCE.isRenderingDropped()) { - return GlintConfig.INSTANCE.getDroppedIndividualStrokes() ? - (isFirstStroke ? GlintConfig.INSTANCE.getDroppedStrokeOne().getRGB() : GlintConfig.INSTANCE.getDroppedStrokeTwo().getRGB()) : - GlintConfig.INSTANCE.getDroppedColor().getRGB(); + return glintColorizer$getColor(GlintConfig.INSTANCE.getDroppedItem(), isFirstStroke); } if (RenderItemHook.INSTANCE.isRenderingFramed()) { - return GlintConfig.INSTANCE.getFramedIndividualStrokes() ? - (isFirstStroke ? GlintConfig.INSTANCE.getFramedStrokeOne().getRGB() : GlintConfig.INSTANCE.getFramedStrokeTwo().getRGB()) : - GlintConfig.INSTANCE.getFramedColor().getRGB(); + return glintColorizer$getColor(GlintConfig.INSTANCE.getFramedItem(), isFirstStroke); } return color; } + @Unique + private int glintColorizer$getColor(ColorSettings settings, boolean isFirstStroke) { + return settings.getIndividualStrokes() ? + (isFirstStroke ? settings.getStrokeOneColor().getRGB() : settings.getStrokeTwoColor().getRGB()) : + settings.getGlintColor().getRGB(); + } + @Unique private float glintColorizer$getModifiedRotation(float color, boolean isFirstStroke) { if (RenderItemHook.INSTANCE.isRenderingHeld()) { diff --git a/src/main/java/org/polyfrost/glintcolorizer/mixin/oneconfig/ConfigMixin.java b/src/main/java/org/polyfrost/glintcolorizer/mixin/oneconfig/ConfigMixin.java new file mode 100644 index 0000000..99bfa71 --- /dev/null +++ b/src/main/java/org/polyfrost/glintcolorizer/mixin/oneconfig/ConfigMixin.java @@ -0,0 +1,65 @@ +package org.polyfrost.glintcolorizer.mixin.oneconfig; + +import cc.polyfrost.oneconfig.config.Config; +import cc.polyfrost.oneconfig.config.core.ConfigUtils; +import cc.polyfrost.oneconfig.config.data.Mod; +import cc.polyfrost.oneconfig.config.elements.BasicOption; +import cc.polyfrost.oneconfig.config.elements.OptionPage; +import cc.polyfrost.oneconfig.internal.config.annotations.Option; +import org.polyfrost.glintcolorizer.config.ColorEntry; +import org.polyfrost.glintcolorizer.config.ColorSettings; +import org.spongepowered.asm.mixin.Mixin; +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.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; + +@Mixin(value = Config.class, remap = false) +public class ConfigMixin { + + @Unique + private transient OptionPage page; + @Unique + private transient Object instance; + + @Inject(method = "generateOptionList(Ljava/lang/Object;Ljava/lang/Class;Lcc/polyfrost/oneconfig/config/elements/OptionPage;Lcc/polyfrost/oneconfig/config/data/Mod;Z)V", at = @At("HEAD")) + private void capture(Object instance, Class targetClass, OptionPage page, Mod mod, boolean migrate, CallbackInfo ci) { + this.instance = instance; + this.page = page; + } + + @ModifyVariable(method = "generateOptionList(Ljava/lang/Object;Ljava/lang/Class;Lcc/polyfrost/oneconfig/config/elements/OptionPage;Lcc/polyfrost/oneconfig/config/data/Mod;Z)V", at = @At(value = "LOAD", ordinal = 0), name = "field") + private Field generate(Field field) { + if (field.isAnnotationPresent(ColorEntry.class)) { + addOptions(page, field, instance); + } + return field; + } + + @Unique + private void addOptions(OptionPage page, Field field, Object instance) { + ColorEntry annotation = field.getAnnotation(ColorEntry.class); + ColorSettings colorSettings = (ColorSettings) ConfigUtils.getField(field, instance); + for (BasicOption option : glintColorizer$getClassOptions(colorSettings)) { + ConfigUtils.getSubCategory(page, annotation.category(), option.subcategory).options.add(option); + } + } + + @Unique + private static ArrayList glintColorizer$getClassOptions(Object object) { + ArrayList options = new ArrayList<>(); + ArrayList fields = ConfigUtils.getClassFields(object.getClass()); + for (Field field : fields) { + Option option = ConfigUtils.findAnnotation(field, Option.class); + if (option == null) continue; + options.add(ConfigUtils.getOption(option, field, object)); + } + return options; + } + +} \ No newline at end of file diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/config/ColorEntry.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/config/ColorEntry.kt new file mode 100644 index 0000000..cf05f41 --- /dev/null +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/config/ColorEntry.kt @@ -0,0 +1,4 @@ +package org.polyfrost.glintcolorizer.config + +@Target(AnnotationTarget.FIELD) +annotation class ColorEntry(val category: String = "General") \ No newline at end of file diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/config/ColorSettings.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/config/ColorSettings.kt new file mode 100644 index 0000000..da60198 --- /dev/null +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/config/ColorSettings.kt @@ -0,0 +1,56 @@ +package org.polyfrost.glintcolorizer.config + +import cc.polyfrost.oneconfig.config.annotations.* +import cc.polyfrost.oneconfig.config.core.ConfigUtils +import cc.polyfrost.oneconfig.config.core.OneColor + +class ColorSettings { + + @Button( + name = "Reset Held Glint Colors", + subcategory = "Configuration", + text = "Reset", + description = "Resets ALL custom glint colors." + ) + var resetColor = Runnable { + reset(false) + } + + @Switch( + name = "Modify Strokes Individually", + subcategory = "Color" + ) + var individualStrokes = false + + @Color( + name = "Glint Color", + subcategory = "Color", + description = "Modifies the color of the enchantment glint." + ) + var glintColor = OneColor(GlintConfig.defaultColor) + + @Color( + name = "Stroke 1 Color", + subcategory = "Color", + description = "Modifies the first stroke of the enchantment glint effect." + ) + var strokeOneColor = OneColor(GlintConfig.defaultColor) + + @Color( + name = "Stroke 2 Color", + subcategory = "Color", + description = "Modifies the second stroke of the enchantment glint effect." + ) + var strokeTwoColor = OneColor(GlintConfig.defaultColor) + + fun reset(resetAll: Boolean) { + val target = ColorSettings() + val newFields = ConfigUtils.getClassFields(target::class.java) + val fields = ConfigUtils.getClassFields(this::class.java) + for (i in 0 until fields.size) { + if (!resetAll && fields[i].type != OneColor::class.java) continue + fields[i].set(this, ConfigUtils.getField(newFields[i], target)) + } + } + +} \ No newline at end of file diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt index 129845d..e18466d 100644 --- a/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/config/GlintConfig.kt @@ -25,31 +25,14 @@ object GlintConfig : Config( text = "Reset", description = "Resets ALL custom glint colors settings and defaults them back to the vanilla color." ) - var resetColors: Runnable = (Runnable { - /* Singular Colors */ - heldColor = OneColor(defaultColor) - guiColor = OneColor(defaultColor) - droppedColor = OneColor(defaultColor) - framedColor = OneColor(defaultColor) - shinyColor = OneColor(defaultColor) + var resetColors = Runnable { + heldItem.reset(true) + guiItem.reset(true) + droppedItem.reset(true) + framedItem.reset(true) + shinyPots.reset(true) armorColor = OneColor(defaultColor) - /* Individual Strokes Colors */ - heldStrokeOne = OneColor(defaultColor) - heldStrokeTwo = OneColor(defaultColor) - guiStrokeOne = OneColor(defaultColor) - guiStrokeTwo = OneColor(defaultColor) - droppedStrokeOne = OneColor(defaultColor) - droppedStrokeTwo = OneColor(defaultColor) - shinyStrokeOne = OneColor(defaultColor) - shinyStrokeTwo = OneColor(defaultColor) - framedStrokeOne = OneColor(defaultColor) - framedStrokeTwo = OneColor(defaultColor) - /* Stroke */ - heldIndividualStrokes = false - guiIndividualStrokes = false - droppedIndividualStrokes = false - framedIndividualStrokes = false - }) + } @Button( name = "Reset ALL Shiny Pots Settings", @@ -57,13 +40,13 @@ object GlintConfig : Config( text = "Reset", description = "Resets ALL custom shiny pots settings." ) - var resetShinyPots: Runnable = (Runnable { + var resetShinyPots = Runnable { potionGlint = false potionGlintSize = false potionGlintBackground = false potionBasedColor = false potionGlintForeground = false - }) + } @Color( name = "Global Glint Color", @@ -71,7 +54,7 @@ object GlintConfig : Config( subcategory = "Configuration", description = "Modifies the color of the enchantment glint." ) - var globalColor: OneColor = OneColor(defaultColor) + var globalColor = OneColor(defaultColor) @Button( name = "Apply Global Glint Color", @@ -80,20 +63,21 @@ object GlintConfig : Config( text = "Apply", description = "Applies your global glint color. Resets ALL custom colors." ) - var applyColors: Runnable = (Runnable { + var applyColors = Runnable { /* Singular Colors */ - heldColor = OneColor(globalColor.rgb) - guiColor = OneColor(globalColor.rgb) - droppedColor = OneColor(globalColor.rgb) - framedColor = OneColor(globalColor.rgb) - shinyColor = OneColor(globalColor.rgb) + heldItem.glintColor = OneColor(globalColor.rgb) + guiItem.glintColor = OneColor(globalColor.rgb) + droppedItem.glintColor = OneColor(globalColor.rgb) + framedItem.glintColor = OneColor(globalColor.rgb) + shinyPots.glintColor = OneColor(globalColor.rgb) armorColor = OneColor(globalColor.rgb) /* Stroke */ - heldIndividualStrokes = false - guiIndividualStrokes = false - droppedIndividualStrokes = false - framedIndividualStrokes = false - }) + heldItem.individualStrokes = false + guiItem.individualStrokes = false + droppedItem.individualStrokes = false + framedItem.individualStrokes = false + shinyPots.individualStrokes = false + } // @Button( // name = "Sync Armor Glint With Item Glint", @@ -120,62 +104,23 @@ object GlintConfig : Config( // }) /* Held Items */ - @Button( - name = "Reset Held Glint Colors", - category = "Held Item", - subcategory = "Configuration", - text = "Reset", - description = "Resets ALL custom glint colors." + @ColorEntry( + category = "Held Item" ) - var resetHeld: Runnable = (Runnable { - heldColor = OneColor(defaultColor) - heldStrokeOne = OneColor(defaultColor) - heldStrokeTwo = OneColor(defaultColor) - }) + var heldItem = ColorSettings() @Button( - name = "Reset Held Glint Transformations", + name = "Reset Transformations", category = "Held Item", subcategory = "Configuration", text = "Reset", description = "Resets ALL custom glint transformations." ) - var resetHeld2: Runnable = (Runnable { + var resetHeld2 = Runnable { heldSpeed = 1.0F heldStrokeRotOne = -50.0F heldStrokeRotTwo = 10.0F - }) - - @Switch( - name = "Modify Strokes Individually", - category = "Held Item", - subcategory = "Color" - ) - var heldIndividualStrokes: Boolean = false - - @Color( - name = "Held Item Glint Color", - category = "Held Item", - subcategory = "Color", - description = "Modifies the color of the enchantment glint." - ) - var heldColor: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 1 Color", - category = "Held Item", - subcategory = "Color", - description = "Modifies the first stroke of the enchantment glint effect." - ) - var heldStrokeOne: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 2 Color", - category = "Held Item", - subcategory = "Color", - description = "Modifies the second stroke of the enchantment glint effect." - ) - var heldStrokeTwo: OneColor = OneColor(defaultColor) + } @Slider( name = "Speed", @@ -208,139 +153,22 @@ object GlintConfig : Config( var heldStrokeRotTwo = 10.0F /* Gui Items */ - @Button( - name = "Reset GUI Item Glint Colors", - category = "GUI Item", - subcategory = "Configuration", - text = "Reset", - description = "Resets ALL custom glint colors." - ) - var resetGui: Runnable = (Runnable { - guiColor = OneColor(defaultColor) - guiStrokeOne = OneColor(defaultColor) - guiStrokeTwo = OneColor(defaultColor) - }) - - @Switch( - name = "Modify Strokes Individually", - category = "GUI Item ", - subcategory = "Color" - ) - var guiIndividualStrokes: Boolean = false - - @Color( - name = "GUI Item Glint Color", - category = "GUI Item", - subcategory = "Color", - description = "Modifies the color of the enchantment glint." - ) - var guiColor: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 1 Color", - category = "GUI Item", - subcategory = "Color", - description = "Modifies the first stroke of the enchantment glint effect." + @ColorEntry( + category = "GUI Item" ) - var guiStrokeOne: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 2 Color", - category = "GUI Item", - subcategory = "Color", - description = "Modifies the second stroke of the enchantment glint effect." - ) - var guiStrokeTwo: OneColor = OneColor(defaultColor) + var guiItem = ColorSettings() /* Dropped Items */ - @Button( - name = "Reset Dropped Item Glint Colors", - category = "Dropped Item", - subcategory = "Configuration", - text = "Reset", - description = "Resets ALL custom glint colors." - ) - var resetDropped: Runnable = (Runnable { - droppedColor = OneColor(defaultColor) - droppedStrokeOne = OneColor(defaultColor) - droppedStrokeTwo = OneColor(defaultColor) - }) - - @Switch( - name = "Modify Strokes Individually", - category = "Dropped Item", - subcategory = "Color" - ) - var droppedIndividualStrokes: Boolean = false - - @Color( - name = "Dropped Item Glint Color", - category = "Dropped Item", - subcategory = "Color", - description = "Modifies the color of the enchantment glint." - ) - var droppedColor: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 1 Color", - category = "Dropped Item", - subcategory = "Color", - description = "Modifies the first stroke of the enchantment glint effect." - ) - var droppedStrokeOne: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 2 Color", - category = "Dropped Item", - subcategory = "Color", - description = "Modifies the second stroke of the enchantment glint effect." + @ColorEntry( + category = "Dropped Item" ) - var droppedStrokeTwo: OneColor = OneColor(defaultColor) + var droppedItem = ColorSettings() /* Framed Items */ - @Button( - name = "Reset Framed Item Glint Colors", - category = "Framed Item", - subcategory = "Configuration", - text = "Reset", - description = "Resets ALL custom glint colors." - ) - var resetFramed: Runnable = (Runnable { - droppedColor = OneColor(defaultColor) - droppedStrokeOne = OneColor(defaultColor) - droppedStrokeTwo = OneColor(defaultColor) - }) - - @Switch( - name = "Modify Strokes Individually", - category = "Framed Item", - subcategory = "Color" + @ColorEntry( + category = "Framed Item" ) - var framedIndividualStrokes: Boolean = false - - @Color( - name = "Framed Item Glint Color", - category = "Framed Item", - subcategory = "Color", - description = "Modifies the color of the enchantment glint." - ) - var framedColor: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 1 Color", - category = "Framed Item", - subcategory = "Color", - description = "Modifies the first stroke of the enchantment glint effect." - ) - var framedStrokeOne: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 2 Color", - category = "Framed Item", - subcategory = "Color", - description = "Modifies the second stroke of the enchantment glint effect." - ) - var framedStrokeTwo: OneColor = OneColor(defaultColor) + var framedItem = ColorSettings() /* Armor */ @Button( @@ -350,9 +178,9 @@ object GlintConfig : Config( text = "Reset", description = "Resets ALL custom glint colors." ) - var resetArmor: Runnable = (Runnable { + var resetArmor = Runnable { armorColor = OneColor(defaultColor) - }) + } @Color( name = "Armor Glint Color", @@ -360,88 +188,46 @@ object GlintConfig : Config( subcategory = "Color", description = "Modifies the color of the enchantment glint." ) - var armorColor: OneColor = OneColor(defaultColor) + var armorColor = OneColor(defaultColor) /* Shiny Pots */ - @Button( - name = "Reset Shiny Pots Glint Colors", - category = "Shiny Pots", - subcategory = "Configuration", - text = "Reset", - description = "Resets ALL custom glint colors." - ) - var resetShiny: Runnable = (Runnable { - shinyColor = OneColor(defaultColor) - shinyStrokeOne = OneColor(defaultColor) - shinyStrokeTwo = OneColor(defaultColor) - potionBasedColor = false - potionGlintBackground = false - potionGlintForeground = false - }) - @Switch( name = "Shiny Potions", category = "Shiny Pots" ) - var potionGlint: Boolean = false + var potionGlint = false @Checkbox( name = "Render Over Full Slot", category = "Shiny Pots" ) - var potionGlintSize: Boolean = false + var potionGlintSize = false @Checkbox( name = "Render Shiny Effect Only", description = "Disables the enchantment glint on the potion and solely renders the shiny effect.", category = "Shiny Pots" ) - var potionGlintForeground: Boolean = false + var potionGlintForeground = false + + @ColorEntry( + category = "Shiny Pots" + ) + var shinyPots = ColorSettings() @Checkbox( name = "Custom Shiny Effect Color", category = "Shiny Pots", subcategory = "Color" ) - var potionGlintBackground: Boolean = false + var potionGlintBackground = false @Switch( name = "Potion Color Based Glint", category = "Shiny Pots", subcategory = "Color" ) - var potionBasedColor: Boolean = false - - @Switch( - name = "Modify the Shiny Effect's Strokes Individually", - category = "Shiny Pots", - subcategory = "Color" - ) - var shinyIndividualStrokes: Boolean = false - - @Color( - name = "Shiny Glint Effect Color", - category = "Shiny Pots", - subcategory = "Color", - description = "Modifies the color of the enchantment glint." - ) - var shinyColor: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 1 Color", - category = "Shiny Pots", - subcategory = "Color", - description = "Modifies the first stroke of the shiny glint effect." - ) - var shinyStrokeOne: OneColor = OneColor(defaultColor) - - @Color( - name = "Stroke 2 Color", - category = "Shiny Pots", - subcategory = "Color", - description = "Modifies the second stroke of the shiny glint effect." - ) - var shinyStrokeTwo: OneColor = OneColor(defaultColor) + var potionBasedColor = false init { initialize() diff --git a/src/main/kotlin/org/polyfrost/glintcolorizer/handler/SecondGlintHandler.kt b/src/main/kotlin/org/polyfrost/glintcolorizer/handler/SecondGlintHandler.kt index aa85611..63cb2a0 100644 --- a/src/main/kotlin/org/polyfrost/glintcolorizer/handler/SecondGlintHandler.kt +++ b/src/main/kotlin/org/polyfrost/glintcolorizer/handler/SecondGlintHandler.kt @@ -9,10 +9,7 @@ import net.minecraft.client.renderer.texture.TextureManager import net.minecraft.client.renderer.texture.TextureMap import net.minecraft.client.resources.model.IBakedModel import net.minecraft.util.ResourceLocation -import org.polyfrost.glintcolorizer.config.GlintConfig.guiStrokeOne -import org.polyfrost.glintcolorizer.config.GlintConfig.guiColor -import org.polyfrost.glintcolorizer.config.GlintConfig.guiIndividualStrokes -import org.polyfrost.glintcolorizer.config.GlintConfig.guiStrokeTwo +import org.polyfrost.glintcolorizer.config.GlintConfig import org.polyfrost.glintcolorizer.mixin.accessor.RenderItemAccessor fun renderEffect(renderItem : RenderItem, model : IBakedModel, textureManager : TextureManager, glintResource : ResourceLocation) { @@ -41,7 +38,7 @@ fun glintStroke1(renderItem : RenderItem, model : IBakedModel) { GlStateManager.translate(f, 0.0f, 0.0f) GlStateManager.rotate(-50.0f, 0.0f, 0.0f, 1.0f) (renderItem as RenderItemAccessor).invokeRenderModel(model, - if (guiIndividualStrokes) guiStrokeOne.rgb else guiColor.rgb + if (GlintConfig.guiItem.individualStrokes) GlintConfig.guiItem.strokeOneColor.rgb else GlintConfig.guiItem.glintColor.rgb ) GlStateManager.popMatrix() } @@ -53,7 +50,7 @@ fun glintStroke2(renderItem : RenderItem, model : IBakedModel) { GlStateManager.translate(-f1, 0.0f, 0.0f) GlStateManager.rotate(10.0f, 0.0f, 0.0f, 1.0f) (renderItem as RenderItemAccessor).invokeRenderModel(model, - if (guiIndividualStrokes) guiStrokeTwo.rgb else guiColor.rgb + if (GlintConfig.guiItem.individualStrokes) GlintConfig.guiItem.strokeTwoColor.rgb else GlintConfig.guiItem.glintColor.rgb ) GlStateManager.popMatrix() } \ No newline at end of file diff --git a/src/main/resources/mixins.glintcolorizer.json b/src/main/resources/mixins.glintcolorizer.json index b185226..a5dbe8d 100644 --- a/src/main/resources/mixins.glintcolorizer.json +++ b/src/main/resources/mixins.glintcolorizer.json @@ -4,12 +4,12 @@ "package": "org.polyfrost.glintcolorizer.mixin", "refmap": "mixins.${id}.refmap.json", "mixins": [ - "accessor.RenderItemAccessor", "ForgeHooksClientMixin", "LayerArmorBaseMixin", - "PotionHelperMixin", "RenderItemMixin_GlintCustomizer", - "RenderItemMixin_ShinyEffect" + "RenderItemMixin_ShinyEffect", + "accessor.RenderItemAccessor", + "oneconfig.ConfigMixin" ], "verbose": true } \ No newline at end of file