3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +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)
Dieser Commit ist enthalten in:
feildmaster 2012-08-12 14:02:57 -05:00
Ursprung bfc5189818
Commit aa92f0e313

Datei anzeigen

@ -33,14 +33,15 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
spawner.mobName = creatureType.getName();
}
public void setSpawnedType(EntityType creatureType) {
if (!creatureType.isAlive() || !creatureType.isSpawnable()) {
throw new IllegalArgumentException("Can't spawn non-living entities from mob spawners!");
public void setSpawnedType(EntityType entityType) {
if (entityType == null || entityType.getName() == null) {
throw new IllegalArgumentException("Can't spawn EntityType " + entityType + " from mobspawners!");
}
spawner.mobName = creatureType.getName();
spawner.mobName = entityType.getName();
}
@Deprecated
public String getCreatureTypeId() {
return spawner.mobName;
}