public void removePlayer(EntityPlayerMP player) { if (this.players.contains(player)) { if (this.sentToPlayers) { player.connection.sendPacket(new SPacketUnloadChunk(this.pos.chunkXPos, this.pos.chunkZPos)); } this.players.remove(player); if (this.players.isEmpty()) { this.playerChunkMap.removeEntry(this); } } }
public void removePlayer(EntityPlayerMP player) { if (this.players.contains(player)) { // If we haven't loaded yet don't load the chunk just so we can clean it up if (this.chunk == null) { this.players.remove(player); if (this.players.isEmpty()) { if (this.loading) net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(this.playerChunkMap.getWorldServer(), this.pos.chunkXPos, this.pos.chunkZPos, this.loadedRunnable); this.playerChunkMap.removeEntry(this); } return; } if (this.sentToPlayers) { player.connection.sendPacket(new SPacketUnloadChunk(this.pos.chunkXPos, this.pos.chunkZPos)); } this.players.remove(player); net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(this.pos, player)); if (this.players.isEmpty()) { this.playerChunkMap.removeEntry(this); } } }
public void processChunkUnload(SPacketUnloadChunk packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); this.clientWorldController.doPreChunk(packetIn.getX(), packetIn.getZ(), false); }
void processChunkUnload(SPacketUnloadChunk packetIn);