Fixed NullPointerException when hopper destination block is missing

This commit is contained in:
Intelli 2024-05-14 16:26:34 -06:00
parent e99a4a86d0
commit 5242973fe8

View File

@ -20,6 +20,10 @@ public final class HopperPushListener {
static void processHopperPush(Location location, InventoryHolder sourceHolder, InventoryHolder destinationHolder, ItemStack item) {
Location destinationLocation = destinationHolder.getInventory().getLocation();
if (destinationLocation == null) {
return;
}
String loggingChestId = "#hopper-push." + destinationLocation.getBlockX() + "." + destinationLocation.getBlockY() + "." + destinationLocation.getBlockZ();
Object[] lastAbort = ConfigHandler.hopperAbort.get(loggingChestId);
if (lastAbort != null) {