use of net.minecraft.server.world.ThreadedAnvilChunkStorage in project ImmersivePortalsMod by qouteall.
the class ChunkDataSyncManager method sendWatchPackets.
private void sendWatchPackets(ServerPlayerEntity player, DimensionalChunkPos chunkPos, IEThreadedAnvilChunkStorage ieStorage) {
McHelper.getServer().getProfiler().push("send_chunk_data");
Chunk chunk = McHelper.getServer().getWorld(chunkPos.dimension).getChunk(chunkPos.x, chunkPos.z);
assert chunk != null;
assert !(chunk instanceof EmptyChunk);
player.networkHandler.sendPacket(MyNetwork.createRedirectedMessage(chunkPos.dimension, new ChunkDataS2CPacket(((WorldChunk) chunk), 65535)));
player.networkHandler.sendPacket(MyNetwork.createRedirectedMessage(chunkPos.dimension, new LightUpdateS2CPacket(chunkPos.getChunkPos(), ieStorage.getLightingProvider())));
// update the entity trackers
((ThreadedAnvilChunkStorage) ieStorage).updateCameraPosition(player);
McHelper.getServer().getProfiler().pop();
}
use of net.minecraft.server.world.ThreadedAnvilChunkStorage in project dynmap by webbukkit.
the class FabricMapChunkCache method readChunk.
private CompoundTag readChunk(int x, int z) {
try {
ThreadedAnvilChunkStorage acl = cps.threadedAnvilChunkStorage;
ChunkPos coord = new ChunkPos(x, z);
return acl.getTagAt(coord);
} catch (Exception exc) {
Log.severe(String.format("Error reading chunk: %s,%d,%d", dw.getName(), x, z), exc);
return null;
}
}
use of net.minecraft.server.world.ThreadedAnvilChunkStorage in project dynmap by webbukkit.
the class FabricMapChunkCache method readChunk.
private NbtCompound readChunk(int x, int z) {
try {
ThreadedAnvilChunkStorage acl = cps.threadedAnvilChunkStorage;
ChunkPos coord = new ChunkPos(x, z);
return acl.getNbt(coord);
} catch (Exception exc) {
Log.severe(String.format("Error reading chunk: %s,%d,%d", dw.getName(), x, z), exc);
return null;
}
}
Aggregations