Fix crash without speedupAnimations enabled (#1377)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2026-02-09 12:00:36 -08:00
1 parent 417f23f826
commit 7b79b90dd6
1 file changed
+10 -3
@@ -13,17 +13,24 @@ public abstract class MixinTextureAtlasSprite implements SpriteExtension {
@Override
public void celeritas$markActive() {
((IPatchedTextureAtlasSprite) this).markNeedsAnimationUpdate();
if (this instanceof IPatchedTextureAtlasSprite patched) {
patched.markNeedsAnimationUpdate();
}
}
@Override
public boolean celeritas$shouldUpdate() {
return ((IPatchedTextureAtlasSprite) this).needsAnimationUpdate();
if (this instanceof IPatchedTextureAtlasSprite patched) {
return patched.needsAnimationUpdate();
}
return false;
}
@ModifyReturnValue(method = {"getMinU", "getInterpolatedU"}, at = @At("RETURN"))
private float celeritas$markActiveOnUVAccess(float original) {
((IPatchedTextureAtlasSprite) this).markNeedsAnimationUpdate();
if (this instanceof IPatchedTextureAtlasSprite patched) {
patched.markNeedsAnimationUpdate();
}
return original;
}
}