From f0982377c19afd9f917f1971031c1e73dfccd5a3 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 11 Nov 2022 11:16:00 +0000 Subject: [PATCH] fix: item thrower/owner can be nuill - Fixes #3862 --- .../plotsquared/bukkit/listener/BlockEventListener117.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java index 2d23515ad..040bdc0d2 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/BlockEventListener117.java @@ -104,6 +104,12 @@ public class BlockEventListener117 implements Listener { if (entity instanceof Item item) { UUID itemThrower = item.getThrower(); if (plot != null) { + if (itemThrower == null && (itemThrower = item.getOwner()) == null) { + plot.debug( + "A thrown item couldn't trigger sculk sensors because misc-interact = false and the item's owner could not be resolved."); + event.setCancelled(true); + return; + } if (!plot.isAdded(itemThrower)) { if (!plot.isAdded(itemThrower)) { plot.debug("A thrown item couldn't trigger sculk sensors because misc-interact = false");