Search in sources :

Example 1 with SPacketChunkData

use of net.minecraft.network.play.server.SPacketChunkData in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class PhysicsObject method preloadNewPlayers.

/**
	 * TODO: Add the methods that send the tileEntities in each given chunk
	 */
public void preloadNewPlayers() {
    Set<EntityPlayerMP> newWatchers = getPlayersThatJustWatched();
    // }
    for (Chunk[] chunkArray : claimedChunks) {
        for (Chunk chunk : chunkArray) {
            SPacketChunkData data = new SPacketChunkData(chunk, 65535);
            for (EntityPlayerMP player : newWatchers) {
                player.connection.sendPacket(data);
                ((WorldServer) worldObj).getEntityTracker().sendLeashedEntitiesInChunk(player, chunk);
            }
        }
    }
}
Also used : SPacketChunkData(net.minecraft.network.play.server.SPacketChunkData) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) SPacketUnloadChunk(net.minecraft.network.play.server.SPacketUnloadChunk) Chunk(net.minecraft.world.chunk.Chunk)

Aggregations

EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 SPacketChunkData (net.minecraft.network.play.server.SPacketChunkData)1 SPacketUnloadChunk (net.minecraft.network.play.server.SPacketUnloadChunk)1 Chunk (net.minecraft.world.chunk.Chunk)1