use of net.minecraft.server.management.PlayerChunkMapEntry in project Railcraft by Railcraft.
the class PacketDispatcher method sendToWatchers.
public static void sendToWatchers(Packet packet, WorldServer world, int worldX, int worldZ) {
int chunkX = worldX >> 4;
int chunkZ = worldZ >> 4;
PlayerChunkMapEntry chunkManager = world.getPlayerChunkMap().getEntry(chunkX, chunkZ);
if (chunkManager != null)
chunkManager.sendPacket(packet);
}
use of net.minecraft.server.management.PlayerChunkMapEntry in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class PhysicsObject method injectChunkIntoWorld.
public void injectChunkIntoWorld(Chunk chunk, int x, int z, boolean putInId2ChunkMap) {
ChunkProviderServer provider = (ChunkProviderServer) worldObj.getChunkProvider();
//TileEntities will break if you don't do this
chunk.isChunkLoaded = true;
chunk.isModified = true;
claimedChunks[x - ownedChunks.minX][z - ownedChunks.minZ] = chunk;
if (putInId2ChunkMap) {
provider.id2ChunkMap.put(ChunkPos.chunkXZ2Int(x, z), chunk);
}
PlayerChunkMap map = ((WorldServer) worldObj).getPlayerChunkMap();
PlayerChunkMapEntry entry = new PlayerChunkMapEntry(map, x, z) {
@Override
public boolean hasPlayerMatchingInRange(double range, Predicate<EntityPlayerMP> predicate) {
return true;
}
};
long i = map.getIndex(x, z);
map.playerInstances.put(i, entry);
map.playerInstanceList.add(entry);
entry.sentToPlayers = true;
entry.players = watchingPlayers;
claimedChunksEntries[x - ownedChunks.minX][z - ownedChunks.minZ] = entry;
// MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(chunk));
}
Aggregations