From 26a75b52f3e54d3c7282ae452b85c51c8823b1e9 Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Thu, 10 Jan 2019 16:06:05 -0500 Subject: [PATCH] hologram fix. --- .../com/songoda/ultimatestacker/events/BlockListeners.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/ultimatestacker/events/BlockListeners.java b/src/main/java/com/songoda/ultimatestacker/events/BlockListeners.java index 7632472..4d785e9 100644 --- a/src/main/java/com/songoda/ultimatestacker/events/BlockListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/events/BlockListeners.java @@ -71,7 +71,8 @@ public class BlockListeners implements Listener { } stack.setAmount(stack.getAmount() + itemAmount); - instance.getHologramHandler().updateHologram(stack); + if (instance.getHologramHandler() != null) + instance.getHologramHandler().updateHologram(stack); Methods.takeItem(player, itemAmount); } } @@ -125,11 +126,13 @@ public class BlockListeners implements Listener { } else { if (stack.getAmount() <= 1) { event.setCancelled(false); + if (instance.getHologramHandler() != null) instance.getHologramHandler().despawn(block); instance.getSpawnerStackManager().removeSpawner(block.getLocation()); } else { stack.setAmount(stack.getAmount() - 1); - instance.getHologramHandler().updateHologram(stack); + if (instance.getHologramHandler() != null) + instance.getHologramHandler().updateHologram(stack); } } if (player.hasPermission("ultimatestacker.spawner.nosilkdrop") || item != null && item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && player.hasPermission("ultimatestacker.spawner.silktouch"))