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.getNbt(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 CompoundTag 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;
}
}
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;
}
}
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;
}
}
use of net.minecraft.server.world.ThreadedAnvilChunkStorage in project ImmersivePortalsMod by qouteall.
the class ChunkDataSyncManager method sendPacketMultiThreaded.
private void sendPacketMultiThreaded(ServerPlayerEntity player, DimensionalChunkPos chunkPos, IEThreadedAnvilChunkStorage ieStorage) {
ModMain.serverTaskList.addTask(() -> {
ChunkHolder chunkHolder = ieStorage.getChunkHolder_(chunkPos.getChunkPos().toLong());
if (chunkHolder == null) {
// TODO cleanup it
SGlobal.chunkTrackingGraph.setIsLoadedByPortal(chunkPos.dimension, chunkPos.getChunkPos(), true);
return false;
}
CompletableFuture<Either<Chunk, ChunkHolder.Unloaded>> future = chunkHolder.createFuture(ChunkStatus.FULL, ((ThreadedAnvilChunkStorage) ieStorage));
future.thenAcceptAsync(either -> {
ModMain.serverTaskList.addTask(() -> {
sendWatchPackets(player, chunkPos, ieStorage);
return true;
});
});
return true;
});
}
Aggregations