Skip to content

Commit 51b32f7

Browse files
committed
Some formatting
1 parent 5b431ea commit 51b32f7

File tree

6 files changed

+60
-14
lines changed

6 files changed

+60
-14
lines changed

src/main/java/org/visuals/legacy/animatium/mixins/v1/entity/flame/MixinFlameFeatureRenderer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
@Mixin(FlameFeatureRenderer.class)
4545
public abstract class MixinFlameFeatureRenderer {
46-
@ModifyExpressionValue(method = "renderFlame", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/renderer/entity/state/EntityRenderState;boundingBoxWidth:F"))
46+
@ModifyExpressionValue(method = "renderFlame", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/entity/state/EntityRenderState;boundingBoxWidth:F", opcode = Opcodes.GETFIELD))
4747
private float animatium$flameWidth(float original, @Local(argsOnly = true) EntityRenderState entityRenderState) {
4848
if (Animatium.isEnabled() && AnimatiumConfig.instance().other.flameDimensions && entityRenderState instanceof AvatarRenderState) {
4949
return 0.6F;
@@ -52,7 +52,7 @@ public abstract class MixinFlameFeatureRenderer {
5252
}
5353
}
5454

55-
@ModifyExpressionValue(method = "renderFlame", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/renderer/entity/state/EntityRenderState;boundingBoxHeight:F"))
55+
@ModifyExpressionValue(method = "renderFlame", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/entity/state/EntityRenderState;boundingBoxHeight:F", opcode = Opcodes.GETFIELD))
5656
private float animatium$flameHeight(float original, @Local(argsOnly = true) EntityRenderState entityRenderState) {
5757
if (Animatium.isEnabled() && AnimatiumConfig.instance().other.flameDimensions && entityRenderState instanceof AvatarRenderState) {
5858
return 1.8F;

src/main/java/org/visuals/legacy/animatium/mixins/v1/entity/projectiles/age/MixinEyeOfEnder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
@Mixin(EyeOfEnder.class)
3838
public abstract class MixinEyeOfEnder {
39-
@WrapOperation(method = "shouldRenderAtSqrDistance", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/world/entity/projectile/EyeOfEnder;tickCount:I"))
39+
@WrapOperation(method = "shouldRenderAtSqrDistance", at = @At(value = "FIELD", target = "Lnet/minecraft/world/entity/projectile/EyeOfEnder;tickCount:I", opcode = Opcodes.GETFIELD))
4040
private int animatium$projectileAgeCheck(EyeOfEnder instance, Operation<Integer> original) {
4141
final int originalTick = original.call(instance);
4242
if (Animatium.isEnabled() && !AnimatiumConfig.instance().other.projectileAgeCheck) {

src/main/java/org/visuals/legacy/animatium/mixins/v1/rendering/lighting/MixinGeometryHelper_FastSmoothLighting.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
package org.visuals.legacy.animatium.mixins.v1.rendering.lighting;
2727

28+
import com.moulberry.mixinconstraints.annotations.IfModLoaded;
2829
import net.fabricmc.fabric.api.renderer.v1.mesh.QuadView;
2930
import net.fabricmc.fabric.impl.client.indigo.renderer.helper.GeometryHelper;
3031
import net.minecraft.core.Direction;
@@ -36,14 +37,13 @@
3637
import org.visuals.legacy.animatium.config.AnimatiumConfig;
3738

3839
// Indigo Renderer Support
40+
@IfModLoaded("fabric")
3941
@Mixin(value = GeometryHelper.class, remap = false)
4042
public abstract class MixinGeometryHelper_FastSmoothLighting {
41-
4243
@Inject(method = "isQuadCubic", at = @At("HEAD"), cancellable = true)
4344
private static void animatium$oldFastSmoothLighting(Direction lightFace, QuadView quad, CallbackInfoReturnable<Boolean> cir) {
4445
if (Animatium.isEnabled() && AnimatiumConfig.instance().other.oldMinimumSmoothLighting) {
4546
cir.setReturnValue(true);
4647
}
4748
}
48-
4949
}

src/main/java/org/visuals/legacy/animatium/mixins/v1/rendering/lighting/MixinModelBlockRenderer_FastSmoothLighting.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@
3636

3737
@Mixin(ModelBlockRenderer.AmbientOcclusionRenderStorage.class)
3838
public abstract class MixinModelBlockRenderer_FastSmoothLighting {
39-
// TODO: Figure out why expressions doesn't work for this
40-
@WrapOperation(method = "calculate", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/block/ModelBlockRenderer$AmbientOcclusionRenderStorage;facePartial:Z", opcode = Opcodes.GETFIELD))
41-
private boolean animatium$oldFastSmoothLighting(ModelBlockRenderer.AmbientOcclusionRenderStorage instance, Operation<Boolean> original) {
42-
if (Animatium.isEnabled() && AnimatiumConfig.instance().other.oldMinimumSmoothLighting) {
43-
return false;
44-
} else {
45-
return original.call(instance);
46-
}
47-
}
39+
@WrapOperation(method = "calculate", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/block/ModelBlockRenderer$AmbientOcclusionRenderStorage;facePartial:Z", opcode = Opcodes.GETFIELD))
40+
private boolean animatium$oldFastSmoothLighting(ModelBlockRenderer.AmbientOcclusionRenderStorage instance, Operation<Boolean> original) {
41+
if (Animatium.isEnabled() && AnimatiumConfig.instance().other.oldMinimumSmoothLighting) {
42+
return false;
43+
} else {
44+
return original.call(instance);
45+
}
46+
}
4847
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
* <p>
23+
* "MINECRAFT" LINKING EXCEPTION TO THE GPL
24+
*/
25+
26+
package org.visuals.legacy.animatium.mixins.v1.rendering.lighting;
27+
28+
import com.moulberry.mixinconstraints.annotations.IfModLoaded;
29+
import org.spongepowered.asm.mixin.Mixin;
30+
31+
// TODO/FIX
32+
// Sodium Support
33+
@IfModLoaded("sodium")
34+
@Mixin(targets = "net.caffeinemc.mods.sodium.client.model.light.smooth.SmoothLightPipeline", remap = false)
35+
public abstract class MixinSmoothLightPipeline {
36+
/*@Definition(id = "flags", local = @Local(type = int.class, name = "flags"))
37+
@Expression("(flags & 1) == 0")
38+
@ModifyExpressionValue(method = "calculate", at = @At("MIXINEXTRAS:EXPRESSION"), remap = false)
39+
private boolean animatium$oldFastSmoothLighting(final boolean original) {
40+
if (Animatium.isEnabled() && AnimatiumConfig.instance().other.oldMinimumSmoothLighting) {
41+
return true;
42+
} else {
43+
return original;
44+
}
45+
}*/
46+
}

src/main/resources/animatium.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"v1.rendering.items.usage.MixinMinecraft",
116116
"v1.rendering.lighting.MixinGeometryHelper_FastSmoothLighting",
117117
"v1.rendering.lighting.MixinModelBlockRenderer_FastSmoothLighting",
118+
"v1.rendering.lighting.MixinSmoothLightPipeline",
118119
"v1.rendering.min_transparency.MixinSpriteContents_FixTransparencyLimit",
119120
"v1.rendering.outlines.MixinCompositeRenderType_BlockOutlineLineWidth",
120121
"v1.rendering.outlines.MixinGameRenderer_PersistentBlockOutline",

0 commit comments

Comments
 (0)