Package net.minecraft.world.chunk.light
Class LightStorage<M extends ChunkToNibbleArrayMap<M>>
java.lang.Object
net.minecraft.world.chunk.light.LevelPropagator
net.minecraft.world.SectionDistanceLevelPropagator
net.minecraft.world.chunk.light.LightStorage<M>
- Direct Known Subclasses:
BlockLightStorage
,SkyLightStorage
public abstract class LightStorage<M extends ChunkToNibbleArrayMap<M>>
extends SectionDistanceLevelPropagator
LightStorage handles the access, storage and propagation of a specific kind of light within the world.
For example, separate instances will be used to store block light as opposed to sky light.
The smallest unit within LightStorage is the section. Sections represent a cube of 16x16x16 blocks and their lighting data. In turn, 16 sections stacked on top of each other form a column, which are analogous to the standard 16x256x16 world chunks.
To avoid allocations, LightStorage packs all the coordinate arguments into single long values. Extra care should be taken to ensure that the relevant types are being used where appropriate.
- See Also:
- Mappings:
Namespace Name official don
intermediary net/minecraft/class_3560
named net/minecraft/world/chunk/light/LightStorage
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ChunkProvider
private final LongSet
private static final Direction[]
protected final LongSet
protected static final ChunkNibbleArray
protected static final int
protected static final int
protected static final int
protected boolean
private final LightType
protected final LongSet
protected final LongSet
protected final LongSet
private final LongSet
protected final Long2ObjectMap<ChunkNibbleArray>
protected final LongSet
private final LongSet
protected final M
protected M
-
Constructor Summary
ModifierConstructorDescriptionprotected
LightStorage
(LightType lightType, ChunkProvider chunkProvider, M lightData) -
Method Summary
Modifier and TypeMethodDescriptionprotected ChunkNibbleArray
createSection
(long sectionPos) protected void
enqueueSectionData
(long sectionPos, @Nullable ChunkNibbleArray array, boolean nonEdge) protected int
get
(long blockPos) protected int
getInitialLevel
(long id) protected int
getLevel
(long id) protected abstract int
getLight
(long blockPos) getLightSection
(long sectionPos) protected @Nullable ChunkNibbleArray
getLightSection
(long sectionPos, boolean cached) protected @Nullable ChunkNibbleArray
getLightSection
(M storage, long sectionPos) protected boolean
protected boolean
hasSection
(long sectionPos) protected void
protected void
onLoadSection
(long sectionPos) protected void
onUnloadSection
(long sectionPos) protected void
removeSection
(ChunkLightProvider<?, ?> storage, long sectionPos) protected void
set
(long blockPos, int value) protected void
setColumnEnabled
(long columnPos, boolean enabled) protected void
setLevel
(long id, int level) void
setRetainColumn
(long sectionPos, boolean retain) protected void
setSectionStatus
(long sectionPos, boolean notReady) protected void
protected void
updateLight
(ChunkLightProvider<M, ?> lightProvider, boolean doSkylight, boolean skipEdgeLightPropagation) private void
updateSection
(ChunkLightProvider<M, ?> lightProvider, long sectionPos) Methods inherited from class net.minecraft.world.SectionDistanceLevelPropagator
getPropagatedLevel, isMarker, propagateLevel, recalculateLevel, update
Methods inherited from class net.minecraft.world.chunk.light.LevelPropagator
applyPendingUpdates, getPendingUpdateCount, hasPendingUpdates, propagateLevel, removePendingUpdate, removePendingUpdateIf, resetLevel, updateLevel
-
Field Details
-
field_31710
protected static final int field_31710- See Also:
- Mappings:
Namespace Name Mixin selector official a
Ldon;a:I
intermediary field_31710
Lnet/minecraft/class_3560;field_31710:I
named field_31710
Lnet/minecraft/world/chunk/light/LightStorage;field_31710:I
-
field_31711
protected static final int field_31711- See Also:
- Mappings:
Namespace Name Mixin selector official b
Ldon;b:I
intermediary field_31711
Lnet/minecraft/class_3560;field_31711:I
named field_31711
Lnet/minecraft/world/chunk/light/LightStorage;field_31711:I
-
field_31712
protected static final int field_31712- See Also:
- Mappings:
Namespace Name Mixin selector official c
Ldon;c:I
intermediary field_31712
Lnet/minecraft/class_3560;field_31712:I
named field_31712
Lnet/minecraft/world/chunk/light/LightStorage;field_31712:I
-
EMPTY
- Mappings:
Namespace Name Mixin selector official d
Ldon;d:Lcwr;
intermediary field_15801
Lnet/minecraft/class_3560;field_15801:Lnet/minecraft/class_2804;
named EMPTY
Lnet/minecraft/world/chunk/light/LightStorage;EMPTY:Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
DIRECTIONS
- Mappings:
Namespace Name Mixin selector official n
Ldon;n:[Lgy;
intermediary field_15799
Lnet/minecraft/class_3560;field_15799:[Lnet/minecraft/class_2350;
named DIRECTIONS
Lnet/minecraft/world/chunk/light/LightStorage;DIRECTIONS:[Lnet/minecraft/util/math/Direction;
-
lightType
- Mappings:
Namespace Name Mixin selector official o
Ldon;o:Lcgj;
intermediary field_15805
Lnet/minecraft/class_3560;field_15805:Lnet/minecraft/class_1944;
named lightType
Lnet/minecraft/world/chunk/light/LightStorage;lightType:Lnet/minecraft/world/LightType;
-
chunkProvider
- Mappings:
Namespace Name Mixin selector official p
Ldon;p:Lcwy;
intermediary field_15803
Lnet/minecraft/class_3560;field_15803:Lnet/minecraft/class_2823;
named chunkProvider
Lnet/minecraft/world/chunk/light/LightStorage;chunkProvider:Lnet/minecraft/world/chunk/ChunkProvider;
-
readySections
- Mappings:
Namespace Name Mixin selector official e
Ldon;e:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_15808
Lnet/minecraft/class_3560;field_15808:Lit/unimi/dsi/fastutil/longs/LongSet;
named readySections
Lnet/minecraft/world/chunk/light/LightStorage;readySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
markedNotReadySections
- Mappings:
Namespace Name Mixin selector official f
Ldon;f:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_15797
Lnet/minecraft/class_3560;field_15797:Lit/unimi/dsi/fastutil/longs/LongSet;
named markedNotReadySections
Lnet/minecraft/world/chunk/light/LightStorage;markedNotReadySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
markedReadySections
- Mappings:
Namespace Name Mixin selector official g
Ldon;g:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_15804
Lnet/minecraft/class_3560;field_15804:Lit/unimi/dsi/fastutil/longs/LongSet;
named markedReadySections
Lnet/minecraft/world/chunk/light/LightStorage;markedReadySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
uncachedStorage
- Mappings:
Namespace Name Mixin selector official h
Ldon;h:Ldoj;
intermediary field_15806
Lnet/minecraft/class_3560;field_15806:Lnet/minecraft/class_3556;
named uncachedStorage
Lnet/minecraft/world/chunk/light/LightStorage;uncachedStorage:Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;
-
storage
- Mappings:
Namespace Name Mixin selector official i
Ldon;i:Ldoj;
intermediary field_15796
Lnet/minecraft/class_3560;field_15796:Lnet/minecraft/class_3556;
named storage
Lnet/minecraft/world/chunk/light/LightStorage;storage:Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;
-
dirtySections
- Mappings:
Namespace Name Mixin selector official j
Ldon;j:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_15802
Lnet/minecraft/class_3560;field_15802:Lit/unimi/dsi/fastutil/longs/LongSet;
named dirtySections
Lnet/minecraft/world/chunk/light/LightStorage;dirtySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
notifySections
- Mappings:
Namespace Name Mixin selector official k
Ldon;k:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_16448
Lnet/minecraft/class_3560;field_16448:Lit/unimi/dsi/fastutil/longs/LongSet;
named notifySections
Lnet/minecraft/world/chunk/light/LightStorage;notifySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
queuedSections
- Mappings:
Namespace Name Mixin selector official l
Ldon;l:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
intermediary field_15807
Lnet/minecraft/class_3560;field_15807:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
named queuedSections
Lnet/minecraft/world/chunk/light/LightStorage;queuedSections:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
-
queuedEdgeSections
- Mappings:
Namespace Name Mixin selector official q
Ldon;q:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_25621
Lnet/minecraft/class_3560;field_25621:Lit/unimi/dsi/fastutil/longs/LongSet;
named queuedEdgeSections
Lnet/minecraft/world/chunk/light/LightStorage;queuedEdgeSections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
columnsToRetain
- Mappings:
Namespace Name Mixin selector official r
Ldon;r:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_19342
Lnet/minecraft/class_3560;field_19342:Lit/unimi/dsi/fastutil/longs/LongSet;
named columnsToRetain
Lnet/minecraft/world/chunk/light/LightStorage;columnsToRetain:Lit/unimi/dsi/fastutil/longs/LongSet;
-
sectionsToRemove
- Mappings:
Namespace Name Mixin selector official s
Ldon;s:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_15798
Lnet/minecraft/class_3560;field_15798:Lit/unimi/dsi/fastutil/longs/LongSet;
named sectionsToRemove
Lnet/minecraft/world/chunk/light/LightStorage;sectionsToRemove:Lit/unimi/dsi/fastutil/longs/LongSet;
-
hasLightUpdates
protected volatile boolean hasLightUpdates- Mappings:
Namespace Name Mixin selector official m
Ldon;m:Z
intermediary field_15800
Lnet/minecraft/class_3560;field_15800:Z
named hasLightUpdates
Lnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates:Z
-
-
Constructor Details
-
LightStorage
- Mappings:
Namespace Name Mixin selector official <init>
Ldon;<init>(Lcgj;Lcwy;Ldoj;)V
intermediary <init>
Lnet/minecraft/class_3560;<init>(Lnet/minecraft/class_1944;Lnet/minecraft/class_2823;Lnet/minecraft/class_3556;)V
named <init>
Lnet/minecraft/world/chunk/light/LightStorage;<init>(Lnet/minecraft/world/LightType;Lnet/minecraft/world/chunk/ChunkProvider;Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;)V
-
-
Method Details
-
hasSection
protected boolean hasSection(long sectionPos) - Mappings:
Namespace Name Mixin selector official g
Ldon;g(J)Z
intermediary method_15524
Lnet/minecraft/class_3560;method_15524(J)Z
named hasSection
Lnet/minecraft/world/chunk/light/LightStorage;hasSection(J)Z
-
getLightSection
- Mappings:
Namespace Name Mixin selector official a
Ldon;a(JZ)Lcwr;
intermediary method_15522
Lnet/minecraft/class_3560;method_15522(JZ)Lnet/minecraft/class_2804;
named getLightSection
Lnet/minecraft/world/chunk/light/LightStorage;getLightSection(JZ)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
getLightSection
- Mappings:
Namespace Name Mixin selector official a
Ldon;a(Ldoj;J)Lcwr;
intermediary method_15533
Lnet/minecraft/class_3560;method_15533(Lnet/minecraft/class_3556;J)Lnet/minecraft/class_2804;
named getLightSection
Lnet/minecraft/world/chunk/light/LightStorage;getLightSection(Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;J)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
getLightSection
- Mappings:
Namespace Name Mixin selector official h
Ldon;h(J)Lcwr;
intermediary method_20533
Lnet/minecraft/class_3560;method_20533(J)Lnet/minecraft/class_2804;
named getLightSection
Lnet/minecraft/world/chunk/light/LightStorage;getLightSection(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
getLight
protected abstract int getLight(long blockPos) - Mappings:
Namespace Name Mixin selector official d
Ldon;d(J)I
intermediary method_15538
Lnet/minecraft/class_3560;method_15538(J)I
named getLight
Lnet/minecraft/world/chunk/light/LightStorage;getLight(J)I
-
get
protected int get(long blockPos) - Mappings:
Namespace Name Mixin selector official i
Ldon;i(J)I
intermediary method_15537
Lnet/minecraft/class_3560;method_15537(J)I
named get
Lnet/minecraft/world/chunk/light/LightStorage;get(J)I
-
set
protected void set(long blockPos, int value) - Mappings:
Namespace Name Mixin selector official b
Ldon;b(JI)V
intermediary method_15525
Lnet/minecraft/class_3560;method_15525(JI)V
named set
Lnet/minecraft/world/chunk/light/LightStorage;set(JI)V
-
getLevel
protected int getLevel(long id) - Specified by:
getLevel
in classLevelPropagator
- Mappings:
Namespace Name Mixin selector official c
Ldok;c(J)I
intermediary method_15480
Lnet/minecraft/class_3554;method_15480(J)I
named getLevel
Lnet/minecraft/world/chunk/light/LevelPropagator;getLevel(J)I
-
getInitialLevel
protected int getInitialLevel(long id) - Specified by:
getInitialLevel
in classSectionDistanceLevelPropagator
- Mappings:
Namespace Name Mixin selector official b
Lafk;b(J)I
intermediary method_18749
Lnet/minecraft/class_4079;method_18749(J)I
named getInitialLevel
Lnet/minecraft/world/SectionDistanceLevelPropagator;getInitialLevel(J)I
-
setLevel
protected void setLevel(long id, int level) - Specified by:
setLevel
in classLevelPropagator
- Mappings:
Namespace Name Mixin selector official a
Ldok;a(JI)V
intermediary method_15485
Lnet/minecraft/class_3554;method_15485(JI)V
named setLevel
Lnet/minecraft/world/chunk/light/LevelPropagator;setLevel(JI)V
-
createSection
- Mappings:
Namespace Name Mixin selector official j
Ldon;j(J)Lcwr;
intermediary method_15529
Lnet/minecraft/class_3560;method_15529(J)Lnet/minecraft/class_2804;
named createSection
Lnet/minecraft/world/chunk/light/LightStorage;createSection(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
removeSection
- Mappings:
Namespace Name Mixin selector official a
Ldon;a(Ldol;J)V
intermediary method_15536
Lnet/minecraft/class_3560;method_15536(Lnet/minecraft/class_3558;J)V
named removeSection
Lnet/minecraft/world/chunk/light/LightStorage;removeSection(Lnet/minecraft/world/chunk/light/ChunkLightProvider;J)V
-
hasLightUpdates
protected boolean hasLightUpdates()- Mappings:
Namespace Name Mixin selector official a
Ldon;a()Z
intermediary method_15528
Lnet/minecraft/class_3560;method_15528()Z
named hasLightUpdates
Lnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates()Z
-
updateLight
protected void updateLight(ChunkLightProvider<M, ?> lightProvider, boolean doSkylight, boolean skipEdgeLightPropagation) - Mappings:
Namespace Name Mixin selector official a
Ldon;a(Ldol;ZZ)V
intermediary method_15527
Lnet/minecraft/class_3560;method_15527(Lnet/minecraft/class_3558;ZZ)V
named updateLight
Lnet/minecraft/world/chunk/light/LightStorage;updateLight(Lnet/minecraft/world/chunk/light/ChunkLightProvider;ZZ)V
-
updateSection
- Mappings:
Namespace Name Mixin selector official b
Ldon;b(Ldol;J)V
intermediary method_29967
Lnet/minecraft/class_3560;method_29967(Lnet/minecraft/class_3558;J)V
named updateSection
Lnet/minecraft/world/chunk/light/LightStorage;updateSection(Lnet/minecraft/world/chunk/light/ChunkLightProvider;J)V
-
onLoadSection
protected void onLoadSection(long sectionPos) - Mappings:
Namespace Name Mixin selector official k
Ldon;k(J)V
intermediary method_15523
Lnet/minecraft/class_3560;method_15523(J)V
named onLoadSection
Lnet/minecraft/world/chunk/light/LightStorage;onLoadSection(J)V
-
onUnloadSection
protected void onUnloadSection(long sectionPos) - Mappings:
Namespace Name Mixin selector official l
Ldon;l(J)V
intermediary method_15534
Lnet/minecraft/class_3560;method_15534(J)V
named onUnloadSection
Lnet/minecraft/world/chunk/light/LightStorage;onUnloadSection(J)V
-
setColumnEnabled
protected void setColumnEnabled(long columnPos, boolean enabled) - Mappings:
Namespace Name Mixin selector official b
Ldon;b(JZ)V
intermediary method_15535
Lnet/minecraft/class_3560;method_15535(JZ)V
named setColumnEnabled
Lnet/minecraft/world/chunk/light/LightStorage;setColumnEnabled(JZ)V
-
setRetainColumn
public void setRetainColumn(long sectionPos, boolean retain) - Mappings:
Namespace Name Mixin selector official c
Ldon;c(JZ)V
intermediary method_20600
Lnet/minecraft/class_3560;method_20600(JZ)V
named setRetainColumn
Lnet/minecraft/world/chunk/light/LightStorage;setRetainColumn(JZ)V
-
enqueueSectionData
protected void enqueueSectionData(long sectionPos, @Nullable @Nullable ChunkNibbleArray array, boolean nonEdge) - Mappings:
Namespace Name Mixin selector official a
Ldon;a(JLcwr;Z)V
intermediary method_15532
Lnet/minecraft/class_3560;method_15532(JLnet/minecraft/class_2804;Z)V
named enqueueSectionData
Lnet/minecraft/world/chunk/light/LightStorage;enqueueSectionData(JLnet/minecraft/world/chunk/ChunkNibbleArray;Z)V
-
setSectionStatus
protected void setSectionStatus(long sectionPos, boolean notReady) - Mappings:
Namespace Name Mixin selector official d
Ldon;d(JZ)V
intermediary method_15526
Lnet/minecraft/class_3560;method_15526(JZ)V
named setSectionStatus
Lnet/minecraft/world/chunk/light/LightStorage;setSectionStatus(JZ)V
-
updateAll
protected void updateAll()- Mappings:
Namespace Name Mixin selector official d
Ldon;d()V
intermediary method_15539
Lnet/minecraft/class_3560;method_15539()V
named updateAll
Lnet/minecraft/world/chunk/light/LightStorage;updateAll()V
-
notifyChanges
protected void notifyChanges()- Mappings:
Namespace Name Mixin selector official e
Ldon;e()V
intermediary method_15530
Lnet/minecraft/class_3560;method_15530()V
named notifyChanges
Lnet/minecraft/world/chunk/light/LightStorage;notifyChanges()V
-