Fixed NullPointerException when hopper destination block is missing
This commit is contained in:
parent
e99a4a86d0
commit
5242973fe8
1 changed files with 4 additions and 0 deletions
|
|
@ -20,6 +20,10 @@ public final class HopperPushListener {
|
||||||
|
|
||||||
static void processHopperPush(Location location, InventoryHolder sourceHolder, InventoryHolder destinationHolder, ItemStack item) {
|
static void processHopperPush(Location location, InventoryHolder sourceHolder, InventoryHolder destinationHolder, ItemStack item) {
|
||||||
Location destinationLocation = destinationHolder.getInventory().getLocation();
|
Location destinationLocation = destinationHolder.getInventory().getLocation();
|
||||||
|
if (destinationLocation == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String loggingChestId = "#hopper-push." + destinationLocation.getBlockX() + "." + destinationLocation.getBlockY() + "." + destinationLocation.getBlockZ();
|
String loggingChestId = "#hopper-push." + destinationLocation.getBlockX() + "." + destinationLocation.getBlockY() + "." + destinationLocation.getBlockZ();
|
||||||
Object[] lastAbort = ConfigHandler.hopperAbort.get(loggingChestId);
|
Object[] lastAbort = ConfigHandler.hopperAbort.get(loggingChestId);
|
||||||
if (lastAbort != null) {
|
if (lastAbort != null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue