From ea10ac8a26ca473ba341926f7a2c806c5887ab36 Mon Sep 17 00:00:00 2001 From: Vixid <52578495+VixidDev@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:48:12 +0000 Subject: Fix crash when quitting with ch chest highlighted (#932) Clear highlightedBlocks on world unload instead --- .../miscfeatures/world/CrystalHollowChestHighlighter.java | 1 + .../notenoughupdates/miscfeatures/world/GenericBlockHighlighter.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/CrystalHollowChestHighlighter.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/CrystalHollowChestHighlighter.java index 61c96aad..7351509b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/CrystalHollowChestHighlighter.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/CrystalHollowChestHighlighter.java @@ -90,6 +90,7 @@ public class CrystalHollowChestHighlighter extends GenericBlockHighlighter { }); blockToRemove.forEach(highlightedBlocks::remove); + blockToRemove.forEach(markedBlocks::remove); } @SubscribeEvent diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GenericBlockHighlighter.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GenericBlockHighlighter.java index 5cacff2b..85230d7b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GenericBlockHighlighter.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/world/GenericBlockHighlighter.java @@ -106,7 +106,7 @@ public abstract class GenericBlockHighlighter { } @SubscribeEvent - public void onWorldChange(WorldEvent.Load event) { + public void onWorldChange(WorldEvent.Unload event) { highlightedBlocks.clear(); } -- cgit