From f85fce3603c574141b6fb5daa10d9b50def5e3a9 Mon Sep 17 00:00:00 2001 From: JozsefA Date: Sat, 26 Jun 2021 16:05:15 -0700 Subject: [PATCH] Reset StitchedSprites when the atlas is stitched - Might fix simi's slime issue --- src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java | 1 + .../java/com/jozufozu/flywheel/core/StitchedSprite.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java b/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java index ef71f9366..2fbb4bc81 100644 --- a/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java +++ b/src/main/java/com/jozufozu/flywheel/core/AtlasStitcher.java @@ -33,6 +33,7 @@ public class AtlasStitcher { .equals(PlayerContainer.BLOCK_ATLAS_TEXTURE)) return; + sprites.forEach(StitchedSprite::reset); sprites.stream() .map(StitchedSprite::getLoc) .forEach(event::addSprite); diff --git a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java index b9536b7ec..7f1d0b0e6 100644 --- a/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java +++ b/src/main/java/com/jozufozu/flywheel/core/StitchedSprite.java @@ -11,7 +11,7 @@ public class StitchedSprite { TextureAtlasSprite sprite; - public StitchedSprite(ResourceLocation loc) { + StitchedSprite(ResourceLocation loc) { this.loc = loc; } @@ -28,4 +28,8 @@ public class StitchedSprite { return sprite; } + + void reset() { + sprite = null; + } }