use of thpmc.engine.util.SectionTypeArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method setBlockData.
@Override
public void setBlockData(int blockX, int blockY, int blockZ, BlockData blockData) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionTypeArray sectionTypeArray = sectionTypeArrays[sectionIndex];
if (sectionTypeArray == null) {
sectionTypeArray = new SectionTypeArray();
sectionTypeArrays[sectionIndex] = sectionTypeArray;
}
Object iBlockData = NMSManager.getNMSHandler().getIBlockData(blockData);
sectionTypeArray.setType(blockX & 0xF, blockY & 0xF, blockZ & 0xF, iBlockData);
mapChunkPacketCache = null;
}
use of thpmc.engine.util.SectionTypeArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method getNMSBlockData.
@Override
@Nullable
public Object getNMSBlockData(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionTypeArray sectionTypeArray = sectionTypeArrays[sectionIndex];
if (sectionTypeArray == null)
return null;
return sectionTypeArray.getType(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
}
use of thpmc.engine.util.SectionTypeArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method setNMSBlockData.
@Override
public void setNMSBlockData(int blockX, int blockY, int blockZ, Object blockData) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionTypeArray sectionTypeArray = sectionTypeArrays[sectionIndex];
if (sectionTypeArray == null) {
sectionTypeArray = new SectionTypeArray();
sectionTypeArrays[sectionIndex] = sectionTypeArray;
}
sectionTypeArray.setType(blockX & 0xF, blockY & 0xF, blockZ & 0xF, blockData);
mapChunkPacketCache = null;
}
use of thpmc.engine.util.SectionTypeArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method hasBlockData.
@Override
public boolean hasBlockData(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionTypeArray sectionTypeArray = sectionTypeArrays[sectionIndex];
if (sectionTypeArray == null)
return false;
return sectionTypeArray.contains(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
}
use of thpmc.engine.util.SectionTypeArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method getBlockData.
@Override
@Nullable
public BlockData getBlockData(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionTypeArray sectionTypeArray = sectionTypeArrays[sectionIndex];
if (sectionTypeArray == null)
return null;
Object iBlockData = sectionTypeArray.getType(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
if (iBlockData == null)
return null;
return NMSManager.getNMSHandler().getBukkitBlockData(iBlockData);
}
Aggregations