Package net.minecraft.world.chunk.light
Class LightStorage<M extends ChunkToNibbleArrayMap<M>>
java.lang.Object
net.minecraft.world.chunk.light.LightStorage<M>
- Direct Known Subclasses:
BlockLightStorage
,SkyLightStorage
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 dwk
intermediary net/minecraft/class_3560
named net/minecraft/world/chunk/light/LightStorage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChunkProvider
private final LongSet
protected final LongSet
protected final Long2ByteMap
protected boolean
private final LongSet
private final LightType
protected final LongSet
protected final Long2ObjectMap<ChunkNibbleArray>
private final LongSet
protected final M
protected M
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
LightStorage
(LightType lightType, ChunkProvider chunkProvider, M lightData) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addNotifySections
(long id) protected ChunkNibbleArray
createSection
(long sectionPos) protected void
enqueueSectionData
(long sectionPos, @Nullable ChunkNibbleArray array) protected int
get
(long blockPos) 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
method_51546
(long long2, byte byte2) protected @Nullable ChunkNibbleArray
method_51547
(long long2) protected boolean
method_51548
(long long2) method_51549
(long long2) private void
method_51550
(long long2) private void
method_51551
(long long2) protected void
protected void
onLoadSection
(long sectionPos) protected void
onUnloadSection
(long sectionPos) protected void
set
(long blockPos, int value) protected void
setColumnEnabled
(long columnPos, boolean enabled) void
setRetainColumn
(long sectionPos, boolean retain) protected void
setSectionStatus
(long sectionPos, boolean notReady) protected void
updateLight
(ChunkLightProvider<M, ?> lightProvider)
-
Field Details
-
lightType
- Mappings:
Namespace Name Mixin selector official i
Ldwk;i:Lcmo;
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 a
Ldwk;a:Lded;
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;
-
field_44716
- Mappings:
Namespace Name Mixin selector official b
Ldwk;b:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;
intermediary field_44716
Lnet/minecraft/class_3560;field_44716:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;
named field_44716
Lnet/minecraft/world/chunk/light/LightStorage;field_44716:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;
-
field_44718
- Mappings:
Namespace Name Mixin selector official j
Ldwk;j:Lit/unimi/dsi/fastutil/longs/LongSet;
intermediary field_44718
Lnet/minecraft/class_3560;field_44718:Lit/unimi/dsi/fastutil/longs/LongSet;
named field_44718
Lnet/minecraft/world/chunk/light/LightStorage;field_44718:Lit/unimi/dsi/fastutil/longs/LongSet;
-
uncachedStorage
- Mappings:
Namespace Name Mixin selector official c
Ldwk;c:Ldwh;
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 d
Ldwk;d:Ldwh;
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 e
Ldwk;e: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 f
Ldwk;f: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 g
Ldwk;g: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;
-
columnsToRetain
- Mappings:
Namespace Name Mixin selector official k
Ldwk;k: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 l
Ldwk;l: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;
-
field_44717
protected volatile boolean field_44717- Mappings:
Namespace Name Mixin selector official h
Ldwk;h:Z
intermediary field_44717
Lnet/minecraft/class_3560;field_44717:Z
named field_44717
Lnet/minecraft/world/chunk/light/LightStorage;field_44717:Z
-
-
Constructor Details
-
LightStorage
- Mappings:
Namespace Name Mixin selector official <init>
Ldwk;<init>(Lcmo;Lded;Ldwh;)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 b
Ldwk;b(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
Ldwk;a(JZ)Lddv;
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
Ldwk;a(Ldwh;J)Lddv;
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;
-
method_51547
- Mappings:
Namespace Name Mixin selector official c
Ldwk;c(J)Lddv;
intermediary method_51547
Lnet/minecraft/class_3560;method_51547(J)Lnet/minecraft/class_2804;
named method_51547
Lnet/minecraft/world/chunk/light/LightStorage;method_51547(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
getLightSection
- Mappings:
Namespace Name Mixin selector official d
Ldwk;d(J)Lddv;
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 a
Ldwk;a(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 e
Ldwk;e(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 a
Ldwk;a(JI)V
intermediary method_15525
Lnet/minecraft/class_3560;method_15525(JI)V
named set
Lnet/minecraft/world/chunk/light/LightStorage;set(JI)V
-
addNotifySections
protected void addNotifySections(long id) - Mappings:
Namespace Name Mixin selector official f
Ldwk;f(J)V
intermediary method_51415
Lnet/minecraft/class_3560;method_51415(J)V
named addNotifySections
Lnet/minecraft/world/chunk/light/LightStorage;addNotifySections(J)V
-
createSection
- Mappings:
Namespace Name Mixin selector official g
Ldwk;g(J)Lddv;
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;
-
hasLightUpdates
protected boolean hasLightUpdates()- Mappings:
Namespace Name Mixin selector official a
Ldwk;a()Z
intermediary method_15528
Lnet/minecraft/class_3560;method_15528()Z
named hasLightUpdates
Lnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates()Z
-
updateLight
- Mappings:
Namespace Name Mixin selector official a
Ldwk;a(Ldwn;)V
intermediary method_15527
Lnet/minecraft/class_3560;method_15527(Lnet/minecraft/class_3558;)V
named updateLight
Lnet/minecraft/world/chunk/light/LightStorage;updateLight(Lnet/minecraft/world/chunk/light/ChunkLightProvider;)V
-
onLoadSection
protected void onLoadSection(long sectionPos) - Mappings:
Namespace Name Mixin selector official h
Ldwk;h(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 i
Ldwk;i(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
Ldwk;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
-
method_51548
protected boolean method_51548(long long2) - Mappings:
Namespace Name Mixin selector official j
Ldwk;j(J)Z
intermediary method_51548
Lnet/minecraft/class_3560;method_51548(J)Z
named method_51548
Lnet/minecraft/world/chunk/light/LightStorage;method_51548(J)Z
-
setRetainColumn
public void setRetainColumn(long sectionPos, boolean retain) - Mappings:
Namespace Name Mixin selector official c
Ldwk;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
- Mappings:
Namespace Name Mixin selector official a
Ldwk;a(JLddv;)V
intermediary method_15532
Lnet/minecraft/class_3560;method_15532(JLnet/minecraft/class_2804;)V
named enqueueSectionData
Lnet/minecraft/world/chunk/light/LightStorage;enqueueSectionData(JLnet/minecraft/world/chunk/ChunkNibbleArray;)V
-
setSectionStatus
protected void setSectionStatus(long sectionPos, boolean notReady) - Mappings:
Namespace Name Mixin selector official d
Ldwk;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
-
method_51546
protected void method_51546(long long2, byte byte2) - Mappings:
Namespace Name Mixin selector official a
Ldwk;a(JB)V
intermediary method_51546
Lnet/minecraft/class_3560;method_51546(JB)V
named method_51546
Lnet/minecraft/world/chunk/light/LightStorage;method_51546(JB)V
-
method_51550
private void method_51550(long long2) - Mappings:
Namespace Name Mixin selector official l
Ldwk;l(J)V
intermediary method_51550
Lnet/minecraft/class_3560;method_51550(J)V
named method_51550
Lnet/minecraft/world/chunk/light/LightStorage;method_51550(J)V
-
method_51551
private void method_51551(long long2) - Mappings:
Namespace Name Mixin selector official m
Ldwk;m(J)V
intermediary method_51551
Lnet/minecraft/class_3560;method_51551(J)V
named method_51551
Lnet/minecraft/world/chunk/light/LightStorage;method_51551(J)V
-
notifyChanges
protected void notifyChanges()- Mappings:
Namespace Name Mixin selector official b
Ldwk;b()V
intermediary method_15530
Lnet/minecraft/class_3560;method_15530()V
named notifyChanges
Lnet/minecraft/world/chunk/light/LightStorage;notifyChanges()V
-
method_51549
- Mappings:
Namespace Name Mixin selector official k
Ldwk;k(J)Ldwk$b;
intermediary method_51549
Lnet/minecraft/class_3560;method_51549(J)Lnet/minecraft/class_3560$class_8530;
named method_51549
Lnet/minecraft/world/chunk/light/LightStorage;method_51549(J)Lnet/minecraft/world/chunk/light/LightStorage$class_8530;
-