Class LightVolume
java.lang.Object
com.simibubi.create.foundation.utility.flywheel.light.LightVolume
- All Implemented Interfaces:
Box
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.simibubi.create.foundation.utility.flywheel.box.Box
Box.CoordinateConsumer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MutableBoxprotected final net.minecraft.world.level.BlockAndTintGetterprotected dev.engine_room.flywheel.lib.memory.MemoryBlock -
Constructor Summary
ConstructorsConstructorDescriptionLightVolume(net.minecraft.world.level.BlockAndTintGetter level, Box sampleVolume) -
Method Summary
Modifier and TypeMethodDescriptionprotected longboxPosToPtr(int x, int y, int z) protected intboxPosToPtrOffset(int x, int y, int z) voidCopy block light from the level into this volume.voidCopy all light from the level into this volume.voidCopy sky light from the level into this volume.voiddelete()intgetMaxX()intgetMaxY()intgetMaxZ()intgetMinX()intgetMinY()intgetMinZ()shortgetPackedLight(int x, int y, int z) voidCompletely (re)populate this volume with block and sky lighting data.booleanprotected longlevelPosToPtr(int x, int y, int z) protected intlevelPosToPtrOffset(int x, int y, int z) protected voidvoidvoidonLightUpdate(net.minecraft.world.level.LightLayer type, net.minecraft.core.SectionPos pos) protected voidprotected voidwriteBlock(int x, int y, int z, int block) protected voidwriteLight(int x, int y, int z, int block, int sky) protected voidwriteSky(int x, int y, int z, int sky) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.simibubi.create.foundation.utility.flywheel.box.Box
contains, contains, copy, forEachContained, hasPowerOf2Sides, intersect, intersects, intersects, isEmpty, sameAs, sameAs, sameAs, sizeX, sizeY, sizeZ, toAABB, union, volume
-
Field Details
-
level
protected final net.minecraft.world.level.BlockAndTintGetter level -
box
-
lightData
protected dev.engine_room.flywheel.lib.memory.MemoryBlock lightData
-
-
Constructor Details
-
LightVolume
-
-
Method Details
-
getVolume
-
getMinX
public int getMinX() -
getMinY
public int getMinY() -
getMinZ
public int getMinZ() -
getMaxX
public int getMaxX() -
getMaxY
public int getMaxY() -
getMaxZ
public int getMaxZ() -
isInvalid
public boolean isInvalid() -
setBox
-
getPackedLight
public short getPackedLight(int x, int y, int z) -
move
-
initialize
public void initialize()Completely (re)populate this volume with block and sky lighting data. This is expensive and should be avoided. -
markDirty
protected void markDirty() -
delete
public void delete() -
copyLight
Copy all light from the level into this volume.- Parameters:
levelVolume- the region in the level to copy data from.
-
writeLight
protected void writeLight(int x, int y, int z, int block, int sky) -
copyBlock
Copy block light from the level into this volume.- Parameters:
levelVolume- the region in the level to copy data from.
-
writeBlock
protected void writeBlock(int x, int y, int z, int block) -
copySky
Copy sky light from the level into this volume.- Parameters:
levelVolume- the region in the level to copy data from.
-
writeSky
protected void writeSky(int x, int y, int z, int sky) -
levelPosToPtr
protected long levelPosToPtr(int x, int y, int z) -
boxPosToPtr
protected long boxPosToPtr(int x, int y, int z) -
levelPosToPtrOffset
protected int levelPosToPtrOffset(int x, int y, int z) -
boxPosToPtrOffset
protected int boxPosToPtrOffset(int x, int y, int z) -
onLightUpdate
public void onLightUpdate(net.minecraft.world.level.LightLayer type, net.minecraft.core.SectionPos pos)
-