if (worldObj instanceof WorldServer) {
Chunk correctChunk = ((WorldServer) worldObj).theChunkProviderServer.getChunkIfExists(entityChunkX, entityChunkZ);
if (correctChunk == this) {
Log.severe("What?! This chunk isn't at the position it says it's at...: " + this + " was added at " + entityChunkX + ", " + entityChunkZ);
} else if (correctChunk != null) {
correctChunk.addEntity(par1Entity);
return;
}
}
}