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 named net/minecraft/world/chunk/light/LightStorageintermediary net/minecraft/class_3560official eos
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ChunkProviderprivate final LongSetprotected final LongSetprivate final LongSetprotected booleanprivate final LightTypeprotected final LongSetprotected final Long2ObjectMap<ChunkNibbleArray> protected final Long2ByteMapprivate final LongSetprotected final Mprotected M -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLightStorage(LightType lightType, ChunkProvider chunkProvider, M lightData) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddNotifySections(long id) protected ChunkNibbleArraycreateSection(long sectionPos) protected voidenqueueSectionData(long sectionPos, @Nullable ChunkNibbleArray array) protected intget(long blockPos) protected abstract intgetLight(long blockPos) getLightSection(long sectionPos) protected @Nullable ChunkNibbleArraygetLightSection(long sectionPos, boolean cached) protected @Nullable ChunkNibbleArraygetLightSection(M storage, long sectionPos) getStatus(long sectionPos) protected booleanprotected booleanhasSection(long sectionPos) protected booleanisSectionInEnabledColumn(long sectionPos) protected @Nullable ChunkNibbleArraymethod_51547(long sectionPos) protected voidprotected voidonLoadSection(long sectionPos) protected voidonUnloadSection(long sectionPos) private voidqueueForRemoval(long sectionPos) private voidqueueForUpdate(long sectionPos) protected voidset(long blockPos, int value) protected voidsetColumnEnabled(long columnPos, boolean enabled) voidsetRetainColumn(long sectionPos, boolean retain) protected voidsetSectionPropagation(long sectionPos, byte flags) protected voidsetSectionStatus(long sectionPos, boolean notReady) protected voidupdateLight(ChunkLightProvider<M, ?> lightProvider)
-
Field Details
-
lightType
- Mappings:
Namespace Name Mixin selector named lightTypeLnet/minecraft/world/chunk/light/LightStorage;lightType:Lnet/minecraft/world/LightType;intermediary field_15805Lnet/minecraft/class_3560;field_15805:Lnet/minecraft/class_1944;official iLeos;i:Lddf;
-
chunkProvider
- Mappings:
Namespace Name Mixin selector named chunkProviderLnet/minecraft/world/chunk/light/LightStorage;chunkProvider:Lnet/minecraft/world/chunk/ChunkProvider;intermediary field_15803Lnet/minecraft/class_3560;field_15803:Lnet/minecraft/class_2823;official aLeos;a:Ldvl;
-
sectionPropagations
- Mappings:
Namespace Name Mixin selector named sectionPropagationsLnet/minecraft/world/chunk/light/LightStorage;sectionPropagations:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;intermediary field_44716Lnet/minecraft/class_3560;field_44716:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;official bLeos;b:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;
-
enabledColumns
- Mappings:
Namespace Name Mixin selector named enabledColumnsLnet/minecraft/world/chunk/light/LightStorage;enabledColumns:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_44718Lnet/minecraft/class_3560;field_44718:Lit/unimi/dsi/fastutil/longs/LongSet;official jLeos;j:Lit/unimi/dsi/fastutil/longs/LongSet;
-
uncachedStorage
- Mappings:
Namespace Name Mixin selector named uncachedStorageLnet/minecraft/world/chunk/light/LightStorage;uncachedStorage:Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;intermediary field_15806Lnet/minecraft/class_3560;field_15806:Lnet/minecraft/class_3556;official cLeos;c:Leop;
-
storage
- Mappings:
Namespace Name Mixin selector named storageLnet/minecraft/world/chunk/light/LightStorage;storage:Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;intermediary field_15796Lnet/minecraft/class_3560;field_15796:Lnet/minecraft/class_3556;official dLeos;d:Leop;
-
dirtySections
- Mappings:
Namespace Name Mixin selector named dirtySectionsLnet/minecraft/world/chunk/light/LightStorage;dirtySections:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_15802Lnet/minecraft/class_3560;field_15802:Lit/unimi/dsi/fastutil/longs/LongSet;official eLeos;e:Lit/unimi/dsi/fastutil/longs/LongSet;
-
notifySections
- Mappings:
Namespace Name Mixin selector named notifySectionsLnet/minecraft/world/chunk/light/LightStorage;notifySections:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_16448Lnet/minecraft/class_3560;field_16448:Lit/unimi/dsi/fastutil/longs/LongSet;official fLeos;f:Lit/unimi/dsi/fastutil/longs/LongSet;
-
queuedSections
- Mappings:
Namespace Name Mixin selector named queuedSectionsLnet/minecraft/world/chunk/light/LightStorage;queuedSections:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;intermediary field_15807Lnet/minecraft/class_3560;field_15807:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;official gLeos;g:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
-
columnsToRetain
- Mappings:
Namespace Name Mixin selector named columnsToRetainLnet/minecraft/world/chunk/light/LightStorage;columnsToRetain:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_19342Lnet/minecraft/class_3560;field_19342:Lit/unimi/dsi/fastutil/longs/LongSet;official kLeos;k:Lit/unimi/dsi/fastutil/longs/LongSet;
-
sectionsToRemove
- Mappings:
Namespace Name Mixin selector named sectionsToRemoveLnet/minecraft/world/chunk/light/LightStorage;sectionsToRemove:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_15798Lnet/minecraft/class_3560;field_15798:Lit/unimi/dsi/fastutil/longs/LongSet;official lLeos;l:Lit/unimi/dsi/fastutil/longs/LongSet;
-
hasLightUpdates
protected volatile boolean hasLightUpdates- Mappings:
Namespace Name Mixin selector named hasLightUpdatesLnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates:Zintermediary field_44717Lnet/minecraft/class_3560;field_44717:Zofficial hLeos;h:Z
-
-
Constructor Details
-
LightStorage
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/light/LightStorage;<init>(Lnet/minecraft/world/LightType;Lnet/minecraft/world/chunk/ChunkProvider;Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;)Vintermediary <init>Lnet/minecraft/class_3560;<init>(Lnet/minecraft/class_1944;Lnet/minecraft/class_2823;Lnet/minecraft/class_3556;)Vofficial <init>Leos;<init>(Lddf;Ldvl;Leop;)V
-
-
Method Details
-
hasSection
protected boolean hasSection(long sectionPos) - Mappings:
Namespace Name Mixin selector named hasSectionLnet/minecraft/world/chunk/light/LightStorage;hasSection(J)Zintermediary method_15524Lnet/minecraft/class_3560;method_15524(J)Zofficial bLeos;b(J)Z
-
getLightSection
- Mappings:
Namespace Name Mixin selector named getLightSectionLnet/minecraft/world/chunk/light/LightStorage;getLightSection(JZ)Lnet/minecraft/world/chunk/ChunkNibbleArray;intermediary method_15522Lnet/minecraft/class_3560;method_15522(JZ)Lnet/minecraft/class_2804;official aLeos;a(JZ)Ldvd;
-
getLightSection
- Mappings:
Namespace Name Mixin selector named getLightSectionLnet/minecraft/world/chunk/light/LightStorage;getLightSection(Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;J)Lnet/minecraft/world/chunk/ChunkNibbleArray;intermediary method_15533Lnet/minecraft/class_3560;method_15533(Lnet/minecraft/class_3556;J)Lnet/minecraft/class_2804;official aLeos;a(Leop;J)Ldvd;
-
method_51547
- Mappings:
Namespace Name Mixin selector named method_51547Lnet/minecraft/world/chunk/light/LightStorage;method_51547(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;intermediary method_51547Lnet/minecraft/class_3560;method_51547(J)Lnet/minecraft/class_2804;official cLeos;c(J)Ldvd;
-
getLightSection
- Mappings:
Namespace Name Mixin selector named getLightSectionLnet/minecraft/world/chunk/light/LightStorage;getLightSection(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;intermediary method_20533Lnet/minecraft/class_3560;method_20533(J)Lnet/minecraft/class_2804;official dLeos;d(J)Ldvd;
-
getLight
protected abstract int getLight(long blockPos) - Mappings:
Namespace Name Mixin selector named getLightLnet/minecraft/world/chunk/light/LightStorage;getLight(J)Iintermediary method_15538Lnet/minecraft/class_3560;method_15538(J)Iofficial aLeos;a(J)I
-
get
protected int get(long blockPos) - Mappings:
Namespace Name Mixin selector named getLnet/minecraft/world/chunk/light/LightStorage;get(J)Iintermediary method_15537Lnet/minecraft/class_3560;method_15537(J)Iofficial eLeos;e(J)I
-
set
protected void set(long blockPos, int value) - Mappings:
Namespace Name Mixin selector named setLnet/minecraft/world/chunk/light/LightStorage;set(JI)Vintermediary method_15525Lnet/minecraft/class_3560;method_15525(JI)Vofficial aLeos;a(JI)V
-
addNotifySections
protected void addNotifySections(long id) - Mappings:
Namespace Name Mixin selector named addNotifySectionsLnet/minecraft/world/chunk/light/LightStorage;addNotifySections(J)Vintermediary method_51415Lnet/minecraft/class_3560;method_51415(J)Vofficial fLeos;f(J)V
-
createSection
- Mappings:
Namespace Name Mixin selector named createSectionLnet/minecraft/world/chunk/light/LightStorage;createSection(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;intermediary method_15529Lnet/minecraft/class_3560;method_15529(J)Lnet/minecraft/class_2804;official gLeos;g(J)Ldvd;
-
hasLightUpdates
protected boolean hasLightUpdates()- Mappings:
Namespace Name Mixin selector named hasLightUpdatesLnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates()Zintermediary method_15528Lnet/minecraft/class_3560;method_15528()Zofficial aLeos;a()Z
-
updateLight
- Mappings:
Namespace Name Mixin selector named updateLightLnet/minecraft/world/chunk/light/LightStorage;updateLight(Lnet/minecraft/world/chunk/light/ChunkLightProvider;)Vintermediary method_15527Lnet/minecraft/class_3560;method_15527(Lnet/minecraft/class_3558;)Vofficial aLeos;a(Leov;)V
-
onLoadSection
protected void onLoadSection(long sectionPos) - Mappings:
Namespace Name Mixin selector named onLoadSectionLnet/minecraft/world/chunk/light/LightStorage;onLoadSection(J)Vintermediary method_15523Lnet/minecraft/class_3560;method_15523(J)Vofficial hLeos;h(J)V
-
onUnloadSection
protected void onUnloadSection(long sectionPos) - Mappings:
Namespace Name Mixin selector named onUnloadSectionLnet/minecraft/world/chunk/light/LightStorage;onUnloadSection(J)Vintermediary method_15534Lnet/minecraft/class_3560;method_15534(J)Vofficial iLeos;i(J)V
-
setColumnEnabled
protected void setColumnEnabled(long columnPos, boolean enabled) - Mappings:
Namespace Name Mixin selector named setColumnEnabledLnet/minecraft/world/chunk/light/LightStorage;setColumnEnabled(JZ)Vintermediary method_15535Lnet/minecraft/class_3560;method_15535(JZ)Vofficial bLeos;b(JZ)V
-
isSectionInEnabledColumn
protected boolean isSectionInEnabledColumn(long sectionPos) - Mappings:
Namespace Name Mixin selector named isSectionInEnabledColumnLnet/minecraft/world/chunk/light/LightStorage;isSectionInEnabledColumn(J)Zintermediary method_51548Lnet/minecraft/class_3560;method_51548(J)Zofficial jLeos;j(J)Z
-
setRetainColumn
public void setRetainColumn(long sectionPos, boolean retain) - Mappings:
Namespace Name Mixin selector named setRetainColumnLnet/minecraft/world/chunk/light/LightStorage;setRetainColumn(JZ)Vintermediary method_20600Lnet/minecraft/class_3560;method_20600(JZ)Vofficial cLeos;c(JZ)V
-
enqueueSectionData
- Mappings:
Namespace Name Mixin selector named enqueueSectionDataLnet/minecraft/world/chunk/light/LightStorage;enqueueSectionData(JLnet/minecraft/world/chunk/ChunkNibbleArray;)Vintermediary method_15532Lnet/minecraft/class_3560;method_15532(JLnet/minecraft/class_2804;)Vofficial aLeos;a(JLdvd;)V
-
setSectionStatus
protected void setSectionStatus(long sectionPos, boolean notReady) - Mappings:
Namespace Name Mixin selector named setSectionStatusLnet/minecraft/world/chunk/light/LightStorage;setSectionStatus(JZ)Vintermediary method_15526Lnet/minecraft/class_3560;method_15526(JZ)Vofficial dLeos;d(JZ)V
-
setSectionPropagation
protected void setSectionPropagation(long sectionPos, byte flags) - Mappings:
Namespace Name Mixin selector named setSectionPropagationLnet/minecraft/world/chunk/light/LightStorage;setSectionPropagation(JB)Vintermediary method_51546Lnet/minecraft/class_3560;method_51546(JB)Vofficial aLeos;a(JB)V
-
queueForUpdate
private void queueForUpdate(long sectionPos) - Mappings:
Namespace Name Mixin selector named queueForUpdateLnet/minecraft/world/chunk/light/LightStorage;queueForUpdate(J)Vintermediary method_51550Lnet/minecraft/class_3560;method_51550(J)Vofficial lLeos;l(J)V
-
queueForRemoval
private void queueForRemoval(long sectionPos) - Mappings:
Namespace Name Mixin selector named queueForRemovalLnet/minecraft/world/chunk/light/LightStorage;queueForRemoval(J)Vintermediary method_51551Lnet/minecraft/class_3560;method_51551(J)Vofficial mLeos;m(J)V
-
notifyChanges
protected void notifyChanges()- Mappings:
Namespace Name Mixin selector named notifyChangesLnet/minecraft/world/chunk/light/LightStorage;notifyChanges()Vintermediary method_15530Lnet/minecraft/class_3560;method_15530()Vofficial bLeos;b()V
-
getStatus
- Mappings:
Namespace Name Mixin selector named getStatusLnet/minecraft/world/chunk/light/LightStorage;getStatus(J)Lnet/minecraft/world/chunk/light/LightStorage$Status;intermediary method_51549Lnet/minecraft/class_3560;method_51549(J)Lnet/minecraft/class_3560$class_8530;official kLeos;k(J)Leos$b;
-