Skip to content

Commit

Permalink
W.I.P Cape setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lowercasebtw committed Dec 13, 2024
1 parent fd6af57 commit cfa88b6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/me/mixces/animatium/config/AnimatiumConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public class AnimatiumConfig extends MidnightConfig {
@Entry
public static boolean fixBowArmMovement = true; // Fixes arm movement in third-person when using the bow

@Entry
// TODO/NOTE: Currently not accurate/broken
public static boolean oldCapeMovement = false; // Changes the cape model movement to be how it used to be

@Entry
public static CameraVersion cameraVersion = CameraVersion.v1_8; // Change the camera position to be as it was in said version range

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.mixces.animatium.config.AnimatiumConfig;
import net.minecraft.client.render.entity.PlayerEntityRenderer;
import net.minecraft.client.render.entity.state.PlayerEntityRenderState;
import net.minecraft.util.math.MathHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

Expand All @@ -18,4 +19,32 @@ public abstract class MixinPlayerEntityRenderer {
return original.call(instance);
}
}

// TODO/NOTE: Fix inaccuracies/brokenness
@WrapOperation(method = "updateCape", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerpAngleDegrees(FFF)F"))
private static float undoLerpAngles(float delta, float start, float end, Operation<Float> original) {
if (AnimatiumConfig.oldCapeMovement) {
return MathHelper.lerp(delta, start, end);
} else {
return original.call(delta, start, end);
}
}

@WrapOperation(method = "updateCape", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", ordinal = 1))
private static float undoClampOne(float value, float min, float max, Operation<Float> original) {
if (AnimatiumConfig.oldCapeMovement) {
return value;
} else {
return original.call(value, min, max);
}
}

@WrapOperation(method = "updateCape", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", ordinal = 2))
private static float undoClampTwo(float value, float min, float max, Operation<Float> original) {
if (AnimatiumConfig.oldCapeMovement) {
return value;
} else {
return original.call(value, min, max);
}
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/animatium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"animatium.midnightconfig.centerScrollableListWidgets.tooltip": "TODO",
"animatium.midnightconfig.fixBowArmMovement": "Fix third-person bow arm movement",
"animatium.midnightconfig.fixBowArmMovement.tooltip": "TODO",
"animatium.midnightconfig.oldCapeMovement": "Old cape model movement",
"animatium.midnightconfig.oldCapeMovement.tooltip": "TODO",
"animatium.midnightconfig.cameraVersion": "Change camera position to be as it was in",
"animatium.midnightconfig.cameraVersion.tooltip": "TODO",

Expand Down

0 comments on commit cfa88b6

Please sign in to comment.