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