fix: don't try changing the blockstate of spawner minecarts

This commit is contained in:
amyavi 2025-07-06 01:27:56 -03:00 committed by Mat
parent 742674cddd
commit 0eb0fe2c6e

View file

@ -231,8 +231,10 @@ public final class EntitySpawn implements Listener {
if (EntityType.FALLING_BLOCK.equals(event.getEntityType())) { if (EntityType.FALLING_BLOCK.equals(event.getEntityType())) {
final FallingBlock block = (FallingBlock) event.getEntity(); final FallingBlock block = (FallingBlock) event.getEntity();
if (block.getBlockData().getMaterial().equals(Material.SPAWNER)) { if (!block.getBlockData().getMaterial().equals(Material.SPAWNER)) return;
event.setCancelled(true); event.setCancelled(true);
if (event.getSpawner() != null) {
event.getSpawner().setSpawnedType(EntityType.FALLING_BLOCK); event.getSpawner().setSpawnedType(EntityType.FALLING_BLOCK);
} }
} }