diff --git a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java index 386a09c..b483a3f 100644 --- a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java +++ b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -742,6 +742,11 @@ float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F; float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F; EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(p_147281_1_.func_149025_e(), this.gameController.theWorld); + if (entitylivingbase == null) + { + cpw.mods.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", p_147281_1_.func_149025_e(), d0, d1, d2); + return; + } entitylivingbase.serverPosX = p_147281_1_.func_149023_f(); entitylivingbase.serverPosY = p_147281_1_.func_149034_g(); entitylivingbase.serverPosZ = p_147281_1_.func_149029_h(); diff --git a/src/main/java/net/minecraft/entity/EntityList.java b/src/main/java/net/minecraft/entity/EntityList.java index 4a9bb3a..aa5180e 100644 --- a/src/main/java/net/minecraft/entity/EntityList.java +++ b/src/main/java/net/minecraft/entity/EntityList.java @@ -84,6 +84,7 @@ public static void addMapping(Class p_75618_0_, String p_75618_1_, int p_75618_2_) { + if (p_75618_2_ < 0 || p_75618_2_ > 255) throw new IllegalArgumentException("Attempted to register a entity with invalid ID: " + p_75618_2_ + " Name: " + p_75618_1_ + " Class: " + p_75618_0_); if (stringToClassMapping.containsKey(p_75618_1_)) { throw new IllegalArgumentException("ID is already registered: " + p_75618_1_);