mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
added fallback code for invalid entities from mobspawners
This commit is contained in:
parent
40c8cc0421
commit
95666779f8
1 changed files with 7 additions and 1 deletions
|
@ -28,7 +28,13 @@ public class TileEntityMobSpawner extends TileEntity {
|
|||
|
||||
public void setId(int id) {
|
||||
mobName = EntityTypes.getNameFromClass(EntityTypes.getClassFromId(id));
|
||||
System.out.println("Setting mob type to: " + mobName);
|
||||
if(mobName == null || mobName.isEmpty()) mobName = "Pig";
|
||||
try {
|
||||
EntityTypes.a(mobName, world);
|
||||
}
|
||||
catch (Throwable t) { // If we get any error at all, fallback to a Pig
|
||||
mobName = "Pig";
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue