public virtual net.minecraft.src.EntityPlayerMP RecreatePlayerEntity(net.minecraft.src.EntityPlayerMP entityplayermp, int i) { mcServer.GetEntityTracker(entityplayermp.dimension).RemoveTrackedPlayerSymmetric( entityplayermp); mcServer.GetEntityTracker(entityplayermp.dimension).UntrackEntity(entityplayermp); GetPlayerManager(entityplayermp.dimension).RemovePlayer(entityplayermp); playerEntities.Remove(entityplayermp); mcServer.GetWorldServer(entityplayermp.dimension).RemovePlayer(entityplayermp); net.minecraft.src.ChunkCoordinates chunkcoordinates = entityplayermp.GetSpawnChunk (); entityplayermp.dimension = i; net.minecraft.src.EntityPlayerMP entityplayermp1 = new net.minecraft.src.EntityPlayerMP (mcServer, mcServer.GetWorldServer(entityplayermp.dimension), entityplayermp.username , new net.minecraft.src.ItemInWorldManager(mcServer.GetWorldServer(entityplayermp .dimension))); entityplayermp1.entityId = entityplayermp.entityId; entityplayermp1.netServerHandler = entityplayermp.netServerHandler; net.minecraft.src.WorldServer worldserver = mcServer.GetWorldServer(entityplayermp .dimension); if (chunkcoordinates != null) { net.minecraft.src.ChunkCoordinates chunkcoordinates1 = net.minecraft.src.EntityPlayer .Func_25051_a(mcServer.GetWorldServer(entityplayermp.dimension), chunkcoordinates ); if (chunkcoordinates1 != null) { entityplayermp1.SetLocationAndAngles((float)chunkcoordinates1.posX + 0.5F, (float )chunkcoordinates1.posY + 0.1F, (float)chunkcoordinates1.posZ + 0.5F, 0.0F, 0.0F ); entityplayermp1.SetSpawnChunk(chunkcoordinates); } else { entityplayermp1.netServerHandler.SendPacket(new net.minecraft.src.Packet70Bed (0)); } } worldserver.chunkProviderServer.LoadChunk((int)entityplayermp1.posX >> 4, (int)entityplayermp1 .posZ >> 4); for (; worldserver.GetCollidingBoundingBoxes(entityplayermp1, entityplayermp1.boundingBox ).Count != 0; entityplayermp1.SetPosition(entityplayermp1.posX, entityplayermp1. posY + 1.0D, entityplayermp1.posZ)) { } entityplayermp1.netServerHandler.SendPacket(new net.minecraft.src.Packet9Respawn (unchecked ((byte)entityplayermp1.dimension))); entityplayermp1.netServerHandler.TeleportTo(entityplayermp1.posX, entityplayermp1 .posY, entityplayermp1.posZ, entityplayermp1.rotationYaw, entityplayermp1.rotationPitch ); Func_28170_a(entityplayermp1, worldserver); GetPlayerManager(entityplayermp1.dimension).AddPlayer(entityplayermp1); worldserver.AddEntity(entityplayermp1); playerEntities.Add(entityplayermp1); entityplayermp1.Func_20057_k(); entityplayermp1.Func_22068_s(); return(entityplayermp1); }
public virtual void PlayerLoggedIn(net.minecraft.src.EntityPlayerMP entityplayermp) { playerEntities.Add(entityplayermp); SharpBukkitPlayers[entityplayermp.username.ToLower()] = new SharpBukkitPlayer(entityplayermp); //SHARP net.minecraft.src.WorldServer worldserver = mcServer.GetWorldServer(entityplayermp .dimension); worldserver.chunkProviderServer.LoadChunk((int)entityplayermp.posX >> 4, (int)entityplayermp .posZ >> 4); for (; worldserver.GetCollidingBoundingBoxes(entityplayermp, entityplayermp.boundingBox ).Count != 0; entityplayermp.SetPosition(entityplayermp.posX, entityplayermp.posY + 1.0D, entityplayermp.posZ)) { } worldserver.AddEntity(entityplayermp); GetPlayerManager(entityplayermp.dimension).AddPlayer(entityplayermp); }