use of thpmc.engine.api.world.parallel.ParallelChunk in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelWorld method getNMSBlockData.
@Override
@Nullable
public Object getNMSBlockData(int blockX, int blockY, int blockZ) {
int chunkX = blockX >> 4;
int chunkZ = blockZ >> 4;
long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
ParallelChunk parallelChunk = chunkMap.get(coord);
if (parallelChunk == null)
return null;
return parallelChunk.getNMSBlockData(blockX, blockY, blockZ);
}
use of thpmc.engine.api.world.parallel.ParallelChunk in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelWorld method removeBlockData.
@Override
public void removeBlockData(int blockX, int blockY, int blockZ) {
int chunkX = blockX >> 4;
int chunkZ = blockZ >> 4;
long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
ParallelChunk parallelChunk = chunkMap.get(coord);
if (parallelChunk == null)
return;
parallelChunk.removeBlockData(blockX, blockY, blockZ);
}
use of thpmc.engine.api.world.parallel.ParallelChunk in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelWorld method hasBlockData.
@Override
public boolean hasBlockData(int blockX, int blockY, int blockZ) {
int chunkX = blockX >> 4;
int chunkZ = blockZ >> 4;
long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
ParallelChunk parallelChunk = chunkMap.get(coord);
if (parallelChunk == null)
return false;
return parallelChunk.hasBlockData(blockX, blockY, blockZ);
}
use of thpmc.engine.api.world.parallel.ParallelChunk in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelWorld method setBlockData.
@Override
public void setBlockData(int blockX, int blockY, int blockZ, BlockData blockData) {
int chunkX = blockX >> 4;
int chunkZ = blockZ >> 4;
long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
ParallelChunk parallelChunk = chunkMap.computeIfAbsent(coord, c -> new ImplParallelChunk(this, chunkX, chunkZ));
parallelChunk.setBlockData(blockX, blockY, blockZ, blockData);
}
use of thpmc.engine.api.world.parallel.ParallelChunk in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelWorld method setSkyLightLevel.
@Override
public void setSkyLightLevel(int blockX, int blockY, int blockZ, int level) {
int chunkX = blockX >> 4;
int chunkZ = blockZ >> 4;
long coord = ChunkUtil.getCoordinateKey(chunkX, chunkZ);
ParallelChunk parallelChunk = chunkMap.computeIfAbsent(coord, c -> new ImplParallelChunk(this, chunkX, chunkZ));
parallelChunk.setSkyLightLevel(blockX, blockY, blockZ, level);
}
Aggregations