|
3 | 3 | import net.minecraft.client.renderer.GlStateManager; |
4 | 4 | import net.minecraft.client.renderer.entity.RenderItem; |
5 | 5 | import net.minecraft.client.resources.model.IBakedModel; |
6 | | -import net.minecraft.potion.PotionHelper; |
7 | | -import org.polyfrost.glintcolorizer.config.GlintConfig; |
8 | | -import org.polyfrost.glintcolorizer.config.GlintOptions; |
9 | 6 | import org.polyfrost.glintcolorizer.GlintMetadata; |
| 7 | +import org.polyfrost.glintcolorizer.config.GlintConfig; |
10 | 8 | import org.spongepowered.asm.mixin.Mixin; |
11 | | -import org.spongepowered.asm.mixin.Unique; |
12 | 9 | import org.spongepowered.asm.mixin.injection.At; |
13 | 10 | import org.spongepowered.asm.mixin.injection.Inject; |
14 | 11 | import org.spongepowered.asm.mixin.injection.ModifyArg; |
@@ -64,30 +61,12 @@ private float modifySecondStrokeRotation(float angle) { |
64 | 61 |
|
65 | 62 | @ModifyArg(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderModel(Lnet/minecraft/client/resources/model/IBakedModel;I)V", ordinal = 0), index = 1) |
66 | 63 | private int modifyFirstStrokeColor(int color) { |
67 | | - return glc$getColor(color, true); |
| 64 | + return GlintMetadata.getColor(color, true); |
68 | 65 | } |
69 | 66 |
|
70 | 67 | @ModifyArg(method = "renderEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderModel(Lnet/minecraft/client/resources/model/IBakedModel;I)V", ordinal = 1), index = 1) |
71 | 68 | private int modifySecondStrokeColor(int color) { |
72 | | - return glc$getColor(color, false); |
73 | | - } |
74 | | - |
75 | | - @Unique |
76 | | - private int glc$getColor(int color, boolean firstStroke) { |
77 | | - if (!GlintConfig.INSTANCE.enabled) { |
78 | | - return color; |
79 | | - } |
80 | | - GlintOptions options = GlintMetadata.getRenderingOptions(); |
81 | | - if (options instanceof GlintOptions.ShinyPots) { |
82 | | - GlintOptions.ShinyPots potsOptions = (GlintOptions.ShinyPots) options; |
83 | | - if (potsOptions.usePotionBasedColor()) { |
84 | | - int potionId = GlintMetadata.getRenderingItemMetadata(); |
85 | | - return PotionHelper.getLiquidColor(potionId, false) | 0xFF000000; |
86 | | - } |
87 | | - } |
88 | | - if (options.useIndividualStrokes()) { |
89 | | - return firstStroke ? options.getStrokeOneColor().getRgba() : options.getStrokeTwoColor().getRgba(); |
90 | | - } else return options.getGlintColor().getRgba(); |
| 69 | + return GlintMetadata.getColor(color, false); |
91 | 70 | } |
92 | 71 |
|
93 | 72 | } |
0 commit comments