Skip to content

Commit 142cf11

Browse files
committed
Additional changes
1 parent 3b45891 commit 142cf11

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

src/main/java/btw/mixces/animatium/mixins/accessor/RenderTypeAccessor.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/**
2+
* Animatium
3+
* The all-you-could-want legacy animations mod for modern minecraft versions.
4+
* Brings back animations from the 1.7/1.8 era and more.
5+
* <p>
6+
* Copyright (C) 2024-2025 lowercasebtw
7+
* Copyright (C) 2024-2025 mixces
8+
* Copyright (C) 2024-2025 Contributors to the project retain their copyright
9+
* <p>
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU General Public License as published by
12+
* the Free Software Foundation, either version 3 of the License, or
13+
* (at your option) any later version.
14+
* <p>
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Public License for more details.
19+
* <p>
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
*/
23+
124
package btw.mixces.animatium.mixins.accessor;
225

326
import com.mojang.blaze3d.pipeline.RenderPipeline;

src/main/java/btw/mixces/animatium/mixins/renderer/MixinGlProgram.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
import btw.mixces.animatium.util.RenderUtils;
2929
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
3030
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
31+
import com.mojang.blaze3d.opengl.GlProgram;
3132
import com.mojang.blaze3d.opengl.Uniform;
3233
import com.mojang.blaze3d.vertex.VertexFormat;
33-
import com.mojang.blaze3d.opengl.GlProgram;
3434
import org.jetbrains.annotations.Nullable;
3535
import org.joml.Matrix4f;
3636
import org.spongepowered.asm.mixin.Mixin;

src/main/java/btw/mixces/animatium/mixins/renderer/MixinLevelRenderer.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,18 @@ private void init(Minecraft minecraft, EntityRenderDispatcher entityRenderDispat
169169
}
170170
}
171171

172-
// @WrapOperation(method = "method_62214", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;endBatch(Lnet/minecraft/client/renderer/RenderType;)V", ordinal = 16))
173-
// private void animatium$legacyGlintRendering$endBatch(MultiBufferSource.BufferSource instance, RenderType renderType, Operation<Void> original) {
174-
// original.call(instance, renderType);
175-
// if (AnimatiumClient.isEnabled() && AnimatiumConfig.instance().oldGlintRendering) {
176-
// instance.endBatch(LegacyGlintType.ITEM_GLINT_LAYER);
177-
// instance.endBatch(LegacyGlintType.ITEM_GLINT_2ND_LAYER);
178-
// instance.endBatch(LegacyGlintType.ITEM_GLINT_TRANSLUCENT_LAYER);
179-
// instance.endBatch(LegacyGlintType.ITEM_GLINT_TRANSLUCENT_2ND_LAYER);
180-
// instance.endBatch(LegacyGlintType.ENTITY_GLINT_LAYER);
181-
// instance.endBatch(LegacyGlintType.ENTITY_ARMOR_GLINT_LAYER);
182-
// }
183-
// }
172+
@WrapOperation(method = "method_62214", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/MultiBufferSource$BufferSource;endBatch(Lnet/minecraft/client/renderer/RenderType;)V", ordinal = 16))
173+
private void animatium$legacyGlintRendering$endBatch(MultiBufferSource.BufferSource instance, RenderType renderType, Operation<Void> original) {
174+
original.call(instance, renderType);
175+
if (AnimatiumClient.isEnabled() && AnimatiumConfig.instance().oldGlintRendering) {
176+
instance.endBatch(LegacyGlintType.ITEM_GLINT_LAYER);
177+
instance.endBatch(LegacyGlintType.ITEM_GLINT_2ND_LAYER);
178+
instance.endBatch(LegacyGlintType.ITEM_GLINT_TRANSLUCENT_LAYER);
179+
instance.endBatch(LegacyGlintType.ITEM_GLINT_TRANSLUCENT_2ND_LAYER);
180+
instance.endBatch(LegacyGlintType.ENTITY_GLINT_LAYER);
181+
instance.endBatch(LegacyGlintType.ENTITY_ARMOR_GLINT_LAYER);
182+
}
183+
}
184184

185185
// TODO/NOTE: The reason we redirect width/height instead of changing the outcome of shouldShowEntityOutlines
186186
// TODO/NOTE: is that it caused issues with Iris/shaders. As simple as that. Until that is fixed/we find another way

src/main/java/btw/mixces/animatium/mixins/renderer/entity/layer/MixinEquipmentLayerRenderer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
import btw.mixces.animatium.AnimatiumClient;
2727
import btw.mixces.animatium.config.AnimatiumConfig;
2828
import btw.mixces.animatium.util.EntityUtils;
29-
import btw.mixces.animatium.util.RenderUtils;
3029
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
3130
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
3231
import com.llamalad7.mixinextras.sugar.Local;
3332
import com.mojang.blaze3d.opengl.GlConst;
3433
import com.mojang.blaze3d.opengl.GlStateManager;
34+
import com.mojang.blaze3d.platform.DepthTestFunction;
3535
import com.mojang.blaze3d.platform.DestFactor;
3636
import com.mojang.blaze3d.platform.SourceFactor;
3737
import com.mojang.blaze3d.vertex.PoseStack;
@@ -100,9 +100,9 @@ public abstract class MixinEquipmentLayerRenderer {
100100
Minecraft.getInstance().gameRenderer.lightTexture().turnOffLightLayer();
101101
GlStateManager._enableBlend();
102102
GlStateManager._blendFuncSeparate(GlConst.toGl(SourceFactor.SRC_ALPHA), GlConst.toGl(DestFactor.ONE_MINUS_SRC_ALPHA), GlConst.toGl(SourceFactor.SRC_ALPHA), GlConst.toGl(DestFactor.ONE_MINUS_SRC_ALPHA));
103-
GlStateManager._depthFunc(GlConst.GL_EQUAL); // DepthTestFunction.EQUAL_DEPTH_TEST
103+
GlStateManager._depthFunc(GlConst.toGl(DepthTestFunction.EQUAL_DEPTH_TEST));
104104
original.call(instance, poseStack, vertexConsumer, light, overlay, color);
105-
GlStateManager._depthFunc(GlConst.GL_LEQUAL); // DepthTestFunction.LEQUAL_DEPTH_TEST
105+
GlStateManager._depthFunc(GlConst.toGl(DepthTestFunction.LEQUAL_DEPTH_TEST));
106106
GlStateManager._disableBlend();
107107
Minecraft.getInstance().gameRenderer.lightTexture().turnOnLightLayer();
108108
}

0 commit comments

Comments
 (0)