mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-29 18:51:21 +01:00
Auto remove failed spawners.
This commit is contained in:
parent
88252bf445
commit
a200c824f6
@ -5,9 +5,9 @@ import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.ultimatestacker.UltimateStacker;
|
||||
import com.songoda.ultimatestacker.settings.Settings;
|
||||
import com.songoda.ultimatestacker.stackable.Hologramable;
|
||||
import com.songoda.ultimatestacker.utils.Stackable;
|
||||
import com.songoda.ultimatestacker.utils.Methods;
|
||||
import com.songoda.ultimatestacker.utils.Reflection;
|
||||
import com.songoda.ultimatestacker.utils.Stackable;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
@ -85,6 +85,10 @@ public class SpawnerStack implements Stackable, Hologramable {
|
||||
|
||||
@Override
|
||||
public String getHologramName() {
|
||||
if (!(location.getBlock().getState() instanceof CreatureSpawner)) {
|
||||
plugin.getSpawnerStackManager().removeSpawner(location);
|
||||
return null;
|
||||
}
|
||||
CreatureSpawner creatureSpawner = (CreatureSpawner) location.getBlock().getState();
|
||||
return Methods.compileSpawnerName(creatureSpawner.getSpawnedType(), amount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user