/**
* moves provided player from overworld to nether or vice versa
*/
public void transferPlayerToDimension(EntityPlayerMP playerIn, int dimension)
{
int i = playerIn.dimension;
WorldServer worldserver = this.mcServer.worldServerForDimension(playerIn.dimension);
playerIn.dimension = dimension;
WorldServer worldserver1 = this.mcServer.worldServerForDimension(playerIn.dimension);
playerIn.playerNetServerHandler.sendPacket(new S07PacketRespawn(playerIn.dimension, playerIn.worldObj.getDifficulty(), playerIn.worldObj.getWorldInfo().getTerrainType(), playerIn.theItemInWorldManager.getGameType()));
worldserver.removePlayerEntityDangerously(playerIn);
playerIn.isDead = false;
this.transferEntityToWorld(playerIn, i, worldserver, worldserver1);
this.preparePlayer(playerIn, worldserver);
playerIn.playerNetServerHandler.setPlayerLocation(playerIn.posX, playerIn.posY, playerIn.posZ, playerIn.rotationYaw, playerIn.rotationPitch);
playerIn.theItemInWorldManager.setWorld(worldserver1);
this.updateTimeAndWeatherForPlayer(playerIn, worldserver1);
this.syncPlayerInventory(playerIn);
for (PotionEffect potioneffect : playerIn.getActivePotionEffects())
{
playerIn.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(playerIn.getEntityId(), potioneffect));
}
}
ServerConfigurationManager.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:DecompiledMinecraft
作者:
评论列表
文章目录