use of thpmc.engine.util.SectionLevelArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method getSkyLightLevel.
@Override
public int getSkyLightLevel(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionLevelArray sectionLevelArray = skyLightArrays[sectionIndex];
if (sectionLevelArray == null)
return 0;
return sectionLevelArray.getLevel(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
}
use of thpmc.engine.util.SectionLevelArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method hasBlockLight.
@Override
public boolean hasBlockLight(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionLevelArray sectionLevelArray = blockLightArrays[sectionIndex];
if (sectionLevelArray == null)
return false;
return sectionLevelArray.contains(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
}
use of thpmc.engine.util.SectionLevelArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method removeSkyLight.
@Override
public void removeSkyLight(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionLevelArray sectionLevelArray = skyLightArrays[sectionIndex];
if (sectionLevelArray == null)
return;
sectionLevelArray.remove(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
lightUpdatePacketCache = null;
}
use of thpmc.engine.util.SectionLevelArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method setSkyLightLevel.
@Override
public void setSkyLightLevel(int blockX, int blockY, int blockZ, int level) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionLevelArray sectionLevelArray = skyLightArrays[sectionIndex];
if (sectionLevelArray == null) {
sectionLevelArray = new SectionLevelArray();
skyLightArrays[sectionIndex] = sectionLevelArray;
}
sectionLevelArray.setLevel(blockX & 0xF, blockY & 0xF, blockZ & 0xF, (byte) level);
lightUpdatePacketCache = null;
}
use of thpmc.engine.util.SectionLevelArray in project THP-Engine by TheHollowPlanetMC.
the class ImplParallelChunk method hasSkyLight.
@Override
public boolean hasSkyLight(int blockX, int blockY, int blockZ) {
int sectionIndex = ChunkUtil.getSectionIndex(blockY);
SectionLevelArray sectionLevelArray = skyLightArrays[sectionIndex];
if (sectionLevelArray == null)
return false;
return sectionLevelArray.contains(blockX & 0xF, blockY & 0xF, blockZ & 0xF);
}
Aggregations