-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
550 additions
and
638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/mixces/legacyanimations/mixin/CapeFeatureRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.mixces.legacyanimations.mixin; | ||
|
||
import com.mixces.legacyanimations.config.LegacyAnimationsSettings; | ||
import net.minecraft.client.render.entity.feature.CapeFeatureRenderer; | ||
import net.minecraft.util.math.MathHelper; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(value = CapeFeatureRenderer.class) | ||
public class CapeFeatureRendererMixin { | ||
|
||
@Redirect( | ||
method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/network/AbstractClientPlayerEntity;FFFFFF)V", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/util/math/MathHelper;lerpAngleDegrees(FFF)F" | ||
) | ||
) | ||
private float legacyAnimations$useLerp(float delta, float start, float end) { | ||
return LegacyAnimationsSettings.getInstance().oldCape ? MathHelper.lerp(delta, start, end) : MathHelper.lerpAngleDegrees(delta, start, end); | ||
} | ||
|
||
@Redirect( | ||
method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/network/AbstractClientPlayerEntity;FFFFFF)V", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", | ||
ordinal = 2 | ||
) | ||
) | ||
private float legacyAnimations$removeClamp(float value, float min, float max) { | ||
return LegacyAnimationsSettings.getInstance().oldCape ? value : MathHelper.clamp(value, min, max); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.