Check to see if a spawner has been illegally removed.

This commit is contained in:
Brianna 2019-12-27 08:01:50 -05:00
parent b9e9885fe1
commit 48d329b2fe
1 changed files with 3 additions and 1 deletions

View File

@ -342,8 +342,10 @@ public class UltimateStacker extends SongodaPlugin {
public void updateHologram(SpawnerStack stack) {
// are holograms enabled?
if(!Settings.SPAWNER_HOLOGRAMS.getBoolean() || !HologramManager.getManager().isEnabled()) return;
Block block = stack.getLocation().getBlock();
if (block.getType() != CompatibleMaterial.SPAWNER.getBlockMaterial()) return;
// grab the spawner block
CreatureSpawner creatureSpawner = (CreatureSpawner) stack.getLocation().getBlock().getState();
CreatureSpawner creatureSpawner = (CreatureSpawner) block.getState();
String name = Methods.compileSpawnerName(creatureSpawner.getSpawnedType(), stack.getAmount());
// create the hologram
HologramManager.updateHologram(stack.getLocation(), name);