mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-12-27 02:47:50 +01:00
Fixed spawner type on place for non ops.
This commit is contained in:
parent
8b27dc8a80
commit
33b8c3a5c9
@ -87,11 +87,18 @@ public class BlockListeners implements Listener {
|
|||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
if (block == null || block.getType() != Material.MOB_SPAWNER) return;
|
if (block == null
|
||||||
|
|| block.getType() != Material.MOB_SPAWNER
|
||||||
if (!instance.spawnersEnabled()) return;
|
|| !instance.spawnersEnabled())
|
||||||
|
return;
|
||||||
|
|
||||||
SpawnerStack stack = instance.getSpawnerStackManager().addSpawner(new SpawnerStack(block.getLocation(), getSpawnerAmount(event.getItemInHand())));
|
SpawnerStack stack = instance.getSpawnerStackManager().addSpawner(new SpawnerStack(block.getLocation(), getSpawnerAmount(event.getItemInHand())));
|
||||||
|
|
||||||
|
CreatureSpawner cs = (CreatureSpawner) block.getState();
|
||||||
|
CreatureSpawner cs2 = (CreatureSpawner) ((BlockStateMeta) event.getItemInHand().getItemMeta()).getBlockState();
|
||||||
|
cs.setSpawnedType(cs2.getSpawnedType());
|
||||||
|
cs.update();
|
||||||
|
|
||||||
instance.getHologramHandler().updateHologram(stack);
|
instance.getHologramHandler().updateHologram(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user