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 dwpintermediary net/minecraft/class_3560named net/minecraft/world/chunk/light/LightStorage
-
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 official iLdwp;i:Lcmt;intermediary field_15805Lnet/minecraft/class_3560;field_15805:Lnet/minecraft/class_1944;named lightTypeLnet/minecraft/world/chunk/light/LightStorage;lightType:Lnet/minecraft/world/LightType;
-
chunkProvider
- Mappings:
Namespace Name Mixin selector official aLdwp;a:Ldei;intermediary field_15803Lnet/minecraft/class_3560;field_15803:Lnet/minecraft/class_2823;named chunkProviderLnet/minecraft/world/chunk/light/LightStorage;chunkProvider:Lnet/minecraft/world/chunk/ChunkProvider;
-
sectionPropagations
- Mappings:
Namespace Name Mixin selector official bLdwp;b:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;intermediary field_44716Lnet/minecraft/class_3560;field_44716:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;named sectionPropagationsLnet/minecraft/world/chunk/light/LightStorage;sectionPropagations:Lit/unimi/dsi/fastutil/longs/Long2ByteMap;
-
enabledColumns
- Mappings:
Namespace Name Mixin selector official jLdwp;j:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_44718Lnet/minecraft/class_3560;field_44718:Lit/unimi/dsi/fastutil/longs/LongSet;named enabledColumnsLnet/minecraft/world/chunk/light/LightStorage;enabledColumns:Lit/unimi/dsi/fastutil/longs/LongSet;
-
uncachedStorage
- Mappings:
Namespace Name Mixin selector official cLdwp;c:Ldwm;intermediary field_15806Lnet/minecraft/class_3560;field_15806:Lnet/minecraft/class_3556;named uncachedStorageLnet/minecraft/world/chunk/light/LightStorage;uncachedStorage:Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;
-
storage
- Mappings:
Namespace Name Mixin selector official dLdwp;d:Ldwm;intermediary field_15796Lnet/minecraft/class_3560;field_15796:Lnet/minecraft/class_3556;named storageLnet/minecraft/world/chunk/light/LightStorage;storage:Lnet/minecraft/world/chunk/ChunkToNibbleArrayMap;
-
dirtySections
- Mappings:
Namespace Name Mixin selector official eLdwp;e:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_15802Lnet/minecraft/class_3560;field_15802:Lit/unimi/dsi/fastutil/longs/LongSet;named dirtySectionsLnet/minecraft/world/chunk/light/LightStorage;dirtySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
notifySections
- Mappings:
Namespace Name Mixin selector official fLdwp;f:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_16448Lnet/minecraft/class_3560;field_16448:Lit/unimi/dsi/fastutil/longs/LongSet;named notifySectionsLnet/minecraft/world/chunk/light/LightStorage;notifySections:Lit/unimi/dsi/fastutil/longs/LongSet;
-
queuedSections
- Mappings:
Namespace Name Mixin selector official gLdwp;g:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;intermediary field_15807Lnet/minecraft/class_3560;field_15807:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;named queuedSectionsLnet/minecraft/world/chunk/light/LightStorage;queuedSections:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
-
columnsToRetain
- Mappings:
Namespace Name Mixin selector official kLdwp;k:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_19342Lnet/minecraft/class_3560;field_19342:Lit/unimi/dsi/fastutil/longs/LongSet;named columnsToRetainLnet/minecraft/world/chunk/light/LightStorage;columnsToRetain:Lit/unimi/dsi/fastutil/longs/LongSet;
-
sectionsToRemove
- Mappings:
Namespace Name Mixin selector official lLdwp;l:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_15798Lnet/minecraft/class_3560;field_15798:Lit/unimi/dsi/fastutil/longs/LongSet;named sectionsToRemoveLnet/minecraft/world/chunk/light/LightStorage;sectionsToRemove:Lit/unimi/dsi/fastutil/longs/LongSet;
-
hasLightUpdates
protected volatile boolean hasLightUpdates- Mappings:
Namespace Name Mixin selector official hLdwp;h:Zintermediary field_44717Lnet/minecraft/class_3560;field_44717:Znamed hasLightUpdatesLnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates:Z
-
-
Constructor Details
-
LightStorage
- Mappings:
Namespace Name Mixin selector official <init>Ldwp;<init>(Lcmt;Ldei;Ldwm;)Vintermediary <init>Lnet/minecraft/class_3560;<init>(Lnet/minecraft/class_1944;Lnet/minecraft/class_2823;Lnet/minecraft/class_3556;)Vnamed <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 bLdwp;b(J)Zintermediary method_15524Lnet/minecraft/class_3560;method_15524(J)Znamed hasSectionLnet/minecraft/world/chunk/light/LightStorage;hasSection(J)Z
-
getLightSection
- Mappings:
Namespace Name Mixin selector official aLdwp;a(JZ)Ldea;intermediary method_15522Lnet/minecraft/class_3560;method_15522(JZ)Lnet/minecraft/class_2804;named getLightSectionLnet/minecraft/world/chunk/light/LightStorage;getLightSection(JZ)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
getLightSection
- Mappings:
Namespace Name Mixin selector official aLdwp;a(Ldwm;J)Ldea;intermediary method_15533Lnet/minecraft/class_3560;method_15533(Lnet/minecraft/class_3556;J)Lnet/minecraft/class_2804;named getLightSectionLnet/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 cLdwp;c(J)Ldea;intermediary method_51547Lnet/minecraft/class_3560;method_51547(J)Lnet/minecraft/class_2804;named method_51547Lnet/minecraft/world/chunk/light/LightStorage;method_51547(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
getLightSection
- Mappings:
Namespace Name Mixin selector official dLdwp;d(J)Ldea;intermediary method_20533Lnet/minecraft/class_3560;method_20533(J)Lnet/minecraft/class_2804;named getLightSectionLnet/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 aLdwp;a(J)Iintermediary method_15538Lnet/minecraft/class_3560;method_15538(J)Inamed getLightLnet/minecraft/world/chunk/light/LightStorage;getLight(J)I
-
get
protected int get(long blockPos) - Mappings:
Namespace Name Mixin selector official eLdwp;e(J)Iintermediary method_15537Lnet/minecraft/class_3560;method_15537(J)Inamed getLnet/minecraft/world/chunk/light/LightStorage;get(J)I
-
set
protected void set(long blockPos, int value) - Mappings:
Namespace Name Mixin selector official aLdwp;a(JI)Vintermediary method_15525Lnet/minecraft/class_3560;method_15525(JI)Vnamed setLnet/minecraft/world/chunk/light/LightStorage;set(JI)V
-
addNotifySections
protected void addNotifySections(long id) - Mappings:
Namespace Name Mixin selector official fLdwp;f(J)Vintermediary method_51415Lnet/minecraft/class_3560;method_51415(J)Vnamed addNotifySectionsLnet/minecraft/world/chunk/light/LightStorage;addNotifySections(J)V
-
createSection
- Mappings:
Namespace Name Mixin selector official gLdwp;g(J)Ldea;intermediary method_15529Lnet/minecraft/class_3560;method_15529(J)Lnet/minecraft/class_2804;named createSectionLnet/minecraft/world/chunk/light/LightStorage;createSection(J)Lnet/minecraft/world/chunk/ChunkNibbleArray;
-
hasLightUpdates
protected boolean hasLightUpdates()- Mappings:
Namespace Name Mixin selector official aLdwp;a()Zintermediary method_15528Lnet/minecraft/class_3560;method_15528()Znamed hasLightUpdatesLnet/minecraft/world/chunk/light/LightStorage;hasLightUpdates()Z
-
updateLight
- Mappings:
Namespace Name Mixin selector official aLdwp;a(Ldws;)Vintermediary method_15527Lnet/minecraft/class_3560;method_15527(Lnet/minecraft/class_3558;)Vnamed updateLightLnet/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 hLdwp;h(J)Vintermediary method_15523Lnet/minecraft/class_3560;method_15523(J)Vnamed onLoadSectionLnet/minecraft/world/chunk/light/LightStorage;onLoadSection(J)V
-
onUnloadSection
protected void onUnloadSection(long sectionPos) - Mappings:
Namespace Name Mixin selector official iLdwp;i(J)Vintermediary method_15534Lnet/minecraft/class_3560;method_15534(J)Vnamed onUnloadSectionLnet/minecraft/world/chunk/light/LightStorage;onUnloadSection(J)V
-
setColumnEnabled
protected void setColumnEnabled(long columnPos, boolean enabled) - Mappings:
Namespace Name Mixin selector official bLdwp;b(JZ)Vintermediary method_15535Lnet/minecraft/class_3560;method_15535(JZ)Vnamed setColumnEnabledLnet/minecraft/world/chunk/light/LightStorage;setColumnEnabled(JZ)V
-
isSectionInEnabledColumn
protected boolean isSectionInEnabledColumn(long sectionPos) - Mappings:
Namespace Name Mixin selector official jLdwp;j(J)Zintermediary method_51548Lnet/minecraft/class_3560;method_51548(J)Znamed isSectionInEnabledColumnLnet/minecraft/world/chunk/light/LightStorage;isSectionInEnabledColumn(J)Z
-
setRetainColumn
public void setRetainColumn(long sectionPos, boolean retain) - Mappings:
Namespace Name Mixin selector official cLdwp;c(JZ)Vintermediary method_20600Lnet/minecraft/class_3560;method_20600(JZ)Vnamed setRetainColumnLnet/minecraft/world/chunk/light/LightStorage;setRetainColumn(JZ)V
-
enqueueSectionData
- Mappings:
Namespace Name Mixin selector official aLdwp;a(JLdea;)Vintermediary method_15532Lnet/minecraft/class_3560;method_15532(JLnet/minecraft/class_2804;)Vnamed enqueueSectionDataLnet/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 dLdwp;d(JZ)Vintermediary method_15526Lnet/minecraft/class_3560;method_15526(JZ)Vnamed setSectionStatusLnet/minecraft/world/chunk/light/LightStorage;setSectionStatus(JZ)V
-
setSectionPropagation
protected void setSectionPropagation(long sectionPos, byte flags) - Mappings:
Namespace Name Mixin selector official aLdwp;a(JB)Vintermediary method_51546Lnet/minecraft/class_3560;method_51546(JB)Vnamed setSectionPropagationLnet/minecraft/world/chunk/light/LightStorage;setSectionPropagation(JB)V
-
queueForUpdate
private void queueForUpdate(long sectionPos) - Mappings:
Namespace Name Mixin selector official lLdwp;l(J)Vintermediary method_51550Lnet/minecraft/class_3560;method_51550(J)Vnamed queueForUpdateLnet/minecraft/world/chunk/light/LightStorage;queueForUpdate(J)V
-
queueForRemoval
private void queueForRemoval(long sectionPos) - Mappings:
Namespace Name Mixin selector official mLdwp;m(J)Vintermediary method_51551Lnet/minecraft/class_3560;method_51551(J)Vnamed queueForRemovalLnet/minecraft/world/chunk/light/LightStorage;queueForRemoval(J)V
-
notifyChanges
protected void notifyChanges()- Mappings:
Namespace Name Mixin selector official bLdwp;b()Vintermediary method_15530Lnet/minecraft/class_3560;method_15530()Vnamed notifyChangesLnet/minecraft/world/chunk/light/LightStorage;notifyChanges()V
-
getStatus
- Mappings:
Namespace Name Mixin selector official kLdwp;k(J)Ldwp$b;intermediary method_51549Lnet/minecraft/class_3560;method_51549(J)Lnet/minecraft/class_3560$class_8530;named getStatusLnet/minecraft/world/chunk/light/LightStorage;getStatus(J)Lnet/minecraft/world/chunk/light/LightStorage$Status;
-