SPIGOT-7446: BlockState#update not updating a spawner's type to null

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2023-08-05 10:12:20 +10:00
parent 136f843d31
commit 5fa009e777

View File

@ -32,7 +32,7 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<TileEntityMobSpa
public void setSpawnedType(EntityType entityType) {
if (entityType == null) {
this.getSnapshot().getSpawner().spawnPotentials = SimpleWeightedRandomList.empty(); // need clear the spawnPotentials to avoid nextSpawnData being replaced later
this.getSnapshot().getSpawner().nextSpawnData = null;
this.getSnapshot().getSpawner().nextSpawnData = new MobSpawnerData();
return;
}
Preconditions.checkArgument(entityType != EntityType.UNKNOWN, "Can't spawn EntityType %s from mob spawners!", entityType);