From 623b0e2b0ba38ee4ab80d5414194471dbb971063 Mon Sep 17 00:00:00 2001 From: Alexander Noyle Date: Mon, 16 Mar 2026 06:29:31 -0400 Subject: [PATCH] Handle BlockState update event payloads on Bukkit --- .../jckf/dhsupport/bukkit/handler/WorldHandler.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/no/jckf/dhsupport/bukkit/handler/WorldHandler.java b/src/main/java/no/jckf/dhsupport/bukkit/handler/WorldHandler.java index c05cc01a..6180a2f1 100644 --- a/src/main/java/no/jckf/dhsupport/bukkit/handler/WorldHandler.java +++ b/src/main/java/no/jckf/dhsupport/bukkit/handler/WorldHandler.java @@ -24,6 +24,7 @@ import no.jckf.dhsupport.core.configuration.DhsConfig; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; +import org.bukkit.block.BlockState; import org.bukkit.event.Event; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -141,9 +142,15 @@ public class WorldHandler implements Listener if (result instanceof Block) { this.touchLod(((Block) result).getLocation(), eventClassName); + } else if (result instanceof BlockState) { + this.touchLod(((BlockState) result).getLocation(), eventClassName); } else if (result instanceof List) { - for (Block block : (List) result) { - this.touchLod(block.getLocation(), eventClassName); + for (Object item : (List) result) { + if (item instanceof Block) { + this.touchLod(((Block) item).getLocation(), eventClassName); + } else if (item instanceof BlockState) { + this.touchLod(((BlockState) item).getLocation(), eventClassName); + } } } else { this.plugin.getDhSupport().warning("Unknown result from event: " + eventClassName); -- 2.47.3