mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
Update CreatureSpawner.setSpawnedType(EntityType) to 1.3
They can spawn any valid entities now. What is a "valid" entity? A "valid" entity is an EntityType with a non-null getName(). (for example: PRIMED_TNT, FALLING_BLOCK)
This commit is contained in:
parent
bfc5189818
commit
aa92f0e313
@ -33,14 +33,15 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
|
|||||||
spawner.mobName = creatureType.getName();
|
spawner.mobName = creatureType.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpawnedType(EntityType creatureType) {
|
public void setSpawnedType(EntityType entityType) {
|
||||||
if (!creatureType.isAlive() || !creatureType.isSpawnable()) {
|
if (entityType == null || entityType.getName() == null) {
|
||||||
throw new IllegalArgumentException("Can't spawn non-living entities from mob spawners!");
|
throw new IllegalArgumentException("Can't spawn EntityType " + entityType + " from mobspawners!");
|
||||||
}
|
}
|
||||||
|
|
||||||
spawner.mobName = creatureType.getName();
|
spawner.mobName = entityType.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public String getCreatureTypeId() {
|
public String getCreatureTypeId() {
|
||||||
return spawner.mobName;
|
return spawner.mobName;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user