Package net.minecraft.world.level.entity
Class PersistentEntitySectionManager<T extends EntityAccess>
java.lang.Object
net.minecraft.world.level.entity.PersistentEntitySectionManager<T>
- All Implemented Interfaces:
AutoCloseable
public class PersistentEntitySectionManager<T extends EntityAccess>
extends Object
implements AutoCloseable
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
(package private) static enum
-
Field Summary
Modifier and TypeFieldDescription(package private) final LevelCallback<T>
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<PersistentEntitySectionManager.ChunkLoadStatus>
private final it.unimi.dsi.fastutil.longs.LongSet
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Visibility>
private final LevelEntityGetter<T>
private final Queue<ChunkEntities<T>>
(package private) static final org.slf4j.Logger
private final EntityPersistentStorage<T>
(package private) final EntitySectionStorage<T>
private final EntityLookup<T>
-
Constructor Summary
ConstructorDescriptionPersistentEntitySectionManager
(Class<T> p_157503_, LevelCallback<T> p_157504_, EntityPersistentStorage<T> p_157505_) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
private boolean
addEntityUuid
(T p_157558_) private boolean
addEntityWithoutEvent
(T p_157539_, boolean p_157540_) void
addLegacyChunkEntities
(Stream<T> p_157553_) boolean
addNewEntity
(T p_157534_) boolean
addNewEntityWithoutEvent
(T entity) void
addWorldGenChunkEntities
(Stream<T> p_157560_) boolean
areEntitiesLoaded
(long p_157508_) void
autoSave()
boolean
canPositionTick
(BlockPos p_202168_) boolean
canPositionTick
(ChunkPos p_202166_) void
close()
void
dumpSections
(Writer p_157549_) private void
ensureChunkQueuedForLoad
(long p_157556_) private it.unimi.dsi.fastutil.longs.LongSet
(package private) static <T extends EntityAccess>
VisibilitygetEffectiveStatus
(T p_157536_, Visibility p_157537_) boolean
private boolean
processChunkUnload
(long p_157569_) private void
private void
(package private) void
removeSectionIfEmpty
(long p_157510_, EntitySection<T> p_157511_) private void
requestChunkLoad
(long p_157563_) void
saveAll()
(package private) void
startTicking
(T p_157565_) (package private) void
startTracking
(T p_157576_) (package private) void
stopTicking
(T p_157571_) (package private) void
stopTracking
(T p_157581_) private boolean
storeChunkSections
(long p_157513_, Consumer<T> p_157514_) void
tick()
private void
unloadEntity
(EntityAccess p_157586_) void
updateChunkStatus
(ChunkPos p_157525_, ChunkHolder.FullChunkStatus p_157526_) void
updateChunkStatus
(ChunkPos p_157528_, Visibility p_157529_)
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
knownUuids
-
callbacks
-
permanentStorage
-
visibleEntityStorage
-
sectionStorage
-
entityGetter
-
chunkVisibility
-
chunkLoadStatuses
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<PersistentEntitySectionManager.ChunkLoadStatus> chunkLoadStatuses -
chunksToUnload
private final it.unimi.dsi.fastutil.longs.LongSet chunksToUnload -
loadingInbox
-
-
Constructor Details
-
PersistentEntitySectionManager
public PersistentEntitySectionManager(Class<T> p_157503_, LevelCallback<T> p_157504_, EntityPersistentStorage<T> p_157505_)
-
-
Method Details
-
removeSectionIfEmpty
-
addEntityUuid
-
addNewEntity
-
addNewEntityWithoutEvent
-
addEntity
-
addEntityWithoutEvent
-
getEffectiveStatus
-
addLegacyChunkEntities
-
addWorldGenChunkEntities
-
startTicking
-
stopTicking
-
startTracking
-
stopTracking
-
updateChunkStatus
-
updateChunkStatus
-
ensureChunkQueuedForLoad
private void ensureChunkQueuedForLoad(long p_157556_) -
storeChunkSections
-
requestChunkLoad
private void requestChunkLoad(long p_157563_) -
processChunkUnload
private boolean processChunkUnload(long p_157569_) -
unloadEntity
-
processUnloads
private void processUnloads() -
processPendingLoads
private void processPendingLoads() -
tick
public void tick() -
getAllChunksToSave
private it.unimi.dsi.fastutil.longs.LongSet getAllChunksToSave() -
autoSave
public void autoSave() -
saveAll
public void saveAll() -
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
isLoaded
-
getEntityGetter
-
canPositionTick
-
canPositionTick
-
areEntitiesLoaded
public boolean areEntitiesLoaded(long p_157508_) -
dumpSections
- Throws:
IOException
-
gatherStats
-