if (entity.getClass().equals(EntityEnderman.class)) {
if ((BetterStorageTiles.enderBackpack != null) &&
// Don't spawn friendly endermen in the end or end biome, would make them too easy to get.
(world.provider.dimensionId != 1) &&
(world.getBiomeGenForCoords((int)entity.posX, (int)entity.posZ) != BiomeGenBase.sky)) {
EntityFrienderman frienderman = new EntityFrienderman(world);
frienderman.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, 0);
world.spawnEntityInWorld(frienderman);
ItemBackpack.getBackpackData(frienderman).spawnsWithBackpack = true;
entity.setDead();
}
// Otherwise, just mark it to spawn with a backpack.