mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-10-26 14:24:30 +00:00
Fix crash without speedupAnimations enabled (#1377)
This commit is contained in:
1 parent
417f23f826
commit
7b79b90dd6
1 file changed
+10
-3
+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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user