#1393: Improve field rename handling and centralize conversion between bukkit and string more

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2024-05-04 08:19:07 +10:00
parent f91094ddfd
commit acdb83379e
17 changed files with 313 additions and 90 deletions

View File

@@ -143,13 +143,13 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<TileEntityMobSpa
}
Optional<EntityTypes<?>> type = EntityTypes.by(spawnData.getEntityToSpawn());
return type.map(entityTypes -> EntityTypes.getKey(entityTypes).getPath()).orElse(null);
return type.map(CraftEntityType::minecraftToBukkit).map(CraftEntityType::bukkitToString).orElse(null);
}
@Override
public void setCreatureTypeByName(String creatureType) {
// Verify input
EntityType type = EntityType.fromName(creatureType);
EntityType type = CraftEntityType.stringToBukkit(creatureType);
if (type == null) {
setSpawnedType(null);
return;