java.lang.Object
com.simibubi.create.foundation.utility.flywheel.light.LightVolume
All Implemented Interfaces:
Box

public class LightVolume extends Object implements Box
  • Field Details

    • level

      protected final net.minecraft.world.level.BlockAndTintGetter level
    • box

      protected final MutableBox box
    • lightData

      protected dev.engine_room.flywheel.lib.memory.MemoryBlock lightData
  • Constructor Details

    • LightVolume

      public LightVolume(net.minecraft.world.level.BlockAndTintGetter level, Box sampleVolume)
  • Method Details

    • getVolume

      public Box getVolume()
    • getMinX

      public int getMinX()
      Specified by:
      getMinX in interface Box
    • getMinY

      public int getMinY()
      Specified by:
      getMinY in interface Box
    • getMinZ

      public int getMinZ()
      Specified by:
      getMinZ in interface Box
    • getMaxX

      public int getMaxX()
      Specified by:
      getMaxX in interface Box
    • getMaxY

      public int getMaxY()
      Specified by:
      getMaxY in interface Box
    • getMaxZ

      public int getMaxZ()
      Specified by:
      getMaxZ in interface Box
    • isInvalid

      public boolean isInvalid()
    • setBox

      protected void setBox(Box box)
    • getPackedLight

      public short getPackedLight(int x, int y, int z)
    • move

      public void move(Box newSampleVolume)
    • 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

      public void copyLight(Box levelVolume)
      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

      public void copyBlock(Box levelVolume)
      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

      public void copySky(Box levelVolume)
      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)