if (entity.worldObj.provider.isSurfaceWorld()) {
if (entity instanceof EntityPlayer && !par1World.isRemote) {
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) entity, ConfigHandler.bedrockDimensionID, new TeleporterBedrock((WorldServer) par1World));
if (entity.worldObj.getBlock(par2, 251, par4) == Blocks.bedrock) {
entity.worldObj.setBlock(par2, 251, par4, Blocks.air);
}
if (entity.worldObj.getBlock(par2, 252, par4) == Blocks.bedrock) {
entity.worldObj.setBlock(par2, 252, par4, Blocks.air);
}
if (entity.worldObj.getBlock(par2, 253, par4) == Blocks.bedrock) {
entity.worldObj.setBlock(par2, 253, par4, Blocks.air);
}
if (entity.worldObj.getBlock(par2, 254, par4) == Blocks.bedrock) {
entity.worldObj.setBlock(par2, 254, par4, this);
}
((EntityPlayerMP) entity).playerNetServerHandler.setPlayerLocation(par2 + 0.5, 252, par4 + 0.5, 0, 0);
}
} else if (entity.worldObj.provider instanceof WorldProviderBedrock) {
if (entity instanceof EntityPlayer && !par1World.isRemote) {
FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) entity, 0, new TeleporterBedrock((WorldServer) par1World));
Random rand = new Random();
int x = (int) entity.posX + rand.nextInt(100);
int z = (int) entity.posZ + rand.nextInt(100);