Package net.minecraft.server.world
Class ServerEntityManager<T extends EntityLike>
java.lang.Object
net.minecraft.server.world.ServerEntityManager<T>
- All Implemented Interfaces:
AutoCloseable
An entity manager for a server environment.
- Mappings:
Namespace Name named net/minecraft/server/world/ServerEntityManagerintermediary net/minecraft/class_5579official ejk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static enumThe status of chunks within a server entity manager. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final SectionedEntityCache<T> private final ChunkDataAccess<T> (package private) final EntityHandler<T> private final EntityIndex<T> private final Queue<ChunkDataList<T>> (package private) static final Loggerprivate final EntityLookup<T> private final Long2ObjectMap<ServerEntityManager.Status> private final LongSetprivate final Long2ObjectMap<EntityTrackingStatus> -
Constructor Summary
ConstructorsConstructorDescriptionServerEntityManager(Class<T> entityClass, EntityHandler<T> handler, ChunkDataAccess<T> dataAccess) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntities(Stream<T> entities) Adds a few newly created entities to this manager.booleanAdds a newly created entity to this manager.private booleanLoads or adds an entity to this manager.private booleanaddEntityUuid(T entity) voidclose()void(package private) voidentityLeftSection(long sectionPos, EntityTrackingSection<T> section) voidflush()intprivate LongSet(package private) static <T extends EntityLike>
EntityTrackingStatusgetNeededLoadStatus(T entity, EntityTrackingStatus current) booleanbooleanisLoaded(long chunkPos) private voidvoidloadEntities(Stream<T> entities) Loads a few entities from disk to this manager.private voidreadIfFresh(long chunkPos) voidsave()private voidscheduleRead(long chunkPos) booleanshouldTick(BlockPos pos) booleanshouldTick(ChunkPos pos) booleanshouldTickTest(ChunkPos pos) (package private) voidstartTicking(T entity) (package private) voidstartTracking(T entity) (package private) voidstopTicking(T entity) (package private) voidstopTracking(T entity) voidtick()private booleanTries to save entities in a chunk and performs anactionon each saved entity if successful.private booleanunload(long chunkPos) private voidunload(EntityLike entity) private voidvoidupdateTrackingStatus(ChunkPos chunkPos, ChunkLevelType levelType) Updates the tracking status of tracking sections in a chunk atchunkPosgiven thelevelType.voidupdateTrackingStatus(ChunkPos chunkPos, EntityTrackingStatus trackingStatus) Updates thetrackingStatusof tracking sections in a chunk atchunkPos.
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector named LOGGERLnet/minecraft/server/world/ServerEntityManager;LOGGER:Lorg/slf4j/Logger;intermediary field_27260Lnet/minecraft/class_5579;field_27260:Lorg/slf4j/Logger;official aLejk;a:Lorg/slf4j/Logger;
-
entityUuids
- Mappings:
Namespace Name Mixin selector named entityUuidsLnet/minecraft/server/world/ServerEntityManager;entityUuids:Ljava/util/Set;intermediary field_27261Lnet/minecraft/class_5579;field_27261:Ljava/util/Set;official bLejk;b:Ljava/util/Set;
-
handler
- Mappings:
Namespace Name Mixin selector named handlerLnet/minecraft/server/world/ServerEntityManager;handler:Lnet/minecraft/world/entity/EntityHandler;intermediary field_27262Lnet/minecraft/class_5579;field_27262:Lnet/minecraft/class_5576;official cLejk;c:Lejh;
-
dataAccess
- Mappings:
Namespace Name Mixin selector named dataAccessLnet/minecraft/server/world/ServerEntityManager;dataAccess:Lnet/minecraft/world/storage/ChunkDataAccess;intermediary field_27263Lnet/minecraft/class_5579;field_27263:Lnet/minecraft/class_5571;official dLejk;d:Lejc;
-
index
- Mappings:
Namespace Name Mixin selector named indexLnet/minecraft/server/world/ServerEntityManager;index:Lnet/minecraft/world/entity/EntityIndex;intermediary field_27264Lnet/minecraft/class_5579;field_27264:Lnet/minecraft/class_5570;official eLejk;e:Lejb;
-
cache
- Mappings:
Namespace Name Mixin selector named cacheLnet/minecraft/server/world/ServerEntityManager;cache:Lnet/minecraft/world/entity/SectionedEntityCache;intermediary field_27265Lnet/minecraft/class_5579;field_27265:Lnet/minecraft/class_5573;official fLejk;f:Leje;
-
lookup
- Mappings:
Namespace Name Mixin selector named lookupLnet/minecraft/server/world/ServerEntityManager;lookup:Lnet/minecraft/world/entity/EntityLookup;intermediary field_27266Lnet/minecraft/class_5579;field_27266:Lnet/minecraft/class_5577;official gLejk;g:Leji;
-
trackingStatuses
- Mappings:
Namespace Name Mixin selector named trackingStatusesLnet/minecraft/server/world/ServerEntityManager;trackingStatuses:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;intermediary field_27267Lnet/minecraft/class_5579;field_27267:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;official hLejk;h:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
-
managedStatuses
- Mappings:
Namespace Name Mixin selector named managedStatusesLnet/minecraft/server/world/ServerEntityManager;managedStatuses:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;intermediary field_27268Lnet/minecraft/class_5579;field_27268:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;official iLejk;i:Lit/unimi/dsi/fastutil/longs/Long2ObjectMap;
-
pendingUnloads
- Mappings:
Namespace Name Mixin selector named pendingUnloadsLnet/minecraft/server/world/ServerEntityManager;pendingUnloads:Lit/unimi/dsi/fastutil/longs/LongSet;intermediary field_27269Lnet/minecraft/class_5579;field_27269:Lit/unimi/dsi/fastutil/longs/LongSet;official jLejk;j:Lit/unimi/dsi/fastutil/longs/LongSet;
-
loadingQueue
- Mappings:
Namespace Name Mixin selector named loadingQueueLnet/minecraft/server/world/ServerEntityManager;loadingQueue:Ljava/util/Queue;intermediary field_27270Lnet/minecraft/class_5579;field_27270:Ljava/util/Queue;official kLejk;k:Ljava/util/Queue;
-
-
Constructor Details
-
ServerEntityManager
public ServerEntityManager(Class<T> entityClass, EntityHandler<T> handler, ChunkDataAccess<T> dataAccess) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/server/world/ServerEntityManager;<init>(Ljava/lang/Class;Lnet/minecraft/world/entity/EntityHandler;Lnet/minecraft/world/storage/ChunkDataAccess;)Vintermediary <init>Lnet/minecraft/class_5579;<init>(Ljava/lang/Class;Lnet/minecraft/class_5576;Lnet/minecraft/class_5571;)Vofficial <init>Lejk;<init>(Ljava/lang/Class;Lejh;Lejc;)V
-
-
Method Details
-
entityLeftSection
- Mappings:
Namespace Name Mixin selector named entityLeftSectionLnet/minecraft/server/world/ServerEntityManager;entityLeftSection(JLnet/minecraft/world/entity/EntityTrackingSection;)Vintermediary method_31811Lnet/minecraft/class_5579;method_31811(JLnet/minecraft/class_5572;)Vofficial aLejk;a(JLejd;)V
-
addEntityUuid
- Mappings:
Namespace Name Mixin selector named addEntityUuidLnet/minecraft/server/world/ServerEntityManager;addEntityUuid(Lnet/minecraft/world/entity/EntityLike;)Zintermediary method_31831Lnet/minecraft/class_5579;method_31831(Lnet/minecraft/class_5568;)Zofficial bLejk;b(Leiz;)Z
-
addEntity
Adds a newly created entity to this manager.- Parameters:
entity- the newly created entity- Returns:
- if the entity was added
- Mappings:
Namespace Name Mixin selector named addEntityLnet/minecraft/server/world/ServerEntityManager;addEntity(Lnet/minecraft/world/entity/EntityLike;)Zintermediary method_31818Lnet/minecraft/class_5579;method_31818(Lnet/minecraft/class_5568;)Zofficial aLejk;a(Leiz;)Z
-
addEntity
Loads or adds an entity to this manager.- Parameters:
entity- the entityexisting- whether this entity is loaded from the map than created anew- Returns:
- if the entity was loaded or added
- Mappings:
Namespace Name Mixin selector named addEntityLnet/minecraft/server/world/ServerEntityManager;addEntity(Lnet/minecraft/world/entity/EntityLike;Z)Zintermediary method_31820Lnet/minecraft/class_5579;method_31820(Lnet/minecraft/class_5568;Z)Zofficial aLejk;a(Leiz;Z)Z
-
getNeededLoadStatus
static <T extends EntityLike> EntityTrackingStatus getNeededLoadStatus(T entity, EntityTrackingStatus current) - Mappings:
Namespace Name Mixin selector named getNeededLoadStatusLnet/minecraft/server/world/ServerEntityManager;getNeededLoadStatus(Lnet/minecraft/world/entity/EntityLike;Lnet/minecraft/world/entity/EntityTrackingStatus;)Lnet/minecraft/world/entity/EntityTrackingStatus;intermediary method_31832Lnet/minecraft/class_5579;method_31832(Lnet/minecraft/class_5568;Lnet/minecraft/class_5584;)Lnet/minecraft/class_5584;official aLejk;a(Leiz;Lejo;)Lejo;
-
shouldTickTest
- Mappings:
Namespace Name Mixin selector named shouldTickTestLnet/minecraft/server/world/ServerEntityManager;shouldTickTest(Lnet/minecraft/util/math/ChunkPos;)Zintermediary method_66786Lnet/minecraft/class_5579;method_66786(Lnet/minecraft/class_1923;)Zofficial aLejk;a(Ldmd;)Z
-
loadEntities
Loads a few entities from disk to this manager.- Mappings:
Namespace Name Mixin selector named loadEntitiesLnet/minecraft/server/world/ServerEntityManager;loadEntities(Ljava/util/stream/Stream;)Vintermediary method_31828Lnet/minecraft/class_5579;method_31828(Ljava/util/stream/Stream;)Vofficial aLejk;a(Ljava/util/stream/Stream;)V
-
addEntities
Adds a few newly created entities to this manager.- Mappings:
Namespace Name Mixin selector named addEntitiesLnet/minecraft/server/world/ServerEntityManager;addEntities(Ljava/util/stream/Stream;)Vintermediary method_31835Lnet/minecraft/class_5579;method_31835(Ljava/util/stream/Stream;)Vofficial bLejk;b(Ljava/util/stream/Stream;)V
-
startTicking
- Mappings:
Namespace Name Mixin selector named startTickingLnet/minecraft/server/world/ServerEntityManager;startTicking(Lnet/minecraft/world/entity/EntityLike;)Vintermediary method_31838Lnet/minecraft/class_5579;method_31838(Lnet/minecraft/class_5568;)Vofficial cLejk;c(Leiz;)V
-
stopTicking
- Mappings:
Namespace Name Mixin selector named stopTickingLnet/minecraft/server/world/ServerEntityManager;stopTicking(Lnet/minecraft/world/entity/EntityLike;)Vintermediary method_31843Lnet/minecraft/class_5579;method_31843(Lnet/minecraft/class_5568;)Vofficial dLejk;d(Leiz;)V
-
startTracking
- Mappings:
Namespace Name Mixin selector named startTrackingLnet/minecraft/server/world/ServerEntityManager;startTracking(Lnet/minecraft/world/entity/EntityLike;)Vintermediary method_31847Lnet/minecraft/class_5579;method_31847(Lnet/minecraft/class_5568;)Vofficial eLejk;e(Leiz;)V
-
stopTracking
- Mappings:
Namespace Name Mixin selector named stopTrackingLnet/minecraft/server/world/ServerEntityManager;stopTracking(Lnet/minecraft/world/entity/EntityLike;)Vintermediary method_31850Lnet/minecraft/class_5579;method_31850(Lnet/minecraft/class_5568;)Vofficial fLejk;f(Leiz;)V
-
updateTrackingStatus
Updates the tracking status of tracking sections in a chunk atchunkPosgiven thelevelType.- Parameters:
chunkPos- the chunk to updatelevelType- the updated level type of the chunk- See Also:
- Mappings:
Namespace Name Mixin selector named updateTrackingStatusLnet/minecraft/server/world/ServerEntityManager;updateTrackingStatus(Lnet/minecraft/util/math/ChunkPos;Lnet/minecraft/server/world/ChunkLevelType;)Vintermediary method_31815Lnet/minecraft/class_5579;method_31815(Lnet/minecraft/class_1923;Lnet/minecraft/class_3194;)Vofficial aLejk;a(Ldmd;Lash;)V
-
updateTrackingStatus
Updates thetrackingStatusof tracking sections in a chunk atchunkPos.- Parameters:
chunkPos- the chunk to updatetrackingStatus- the updated section tracking status- Mappings:
Namespace Name Mixin selector named updateTrackingStatusLnet/minecraft/server/world/ServerEntityManager;updateTrackingStatus(Lnet/minecraft/util/math/ChunkPos;Lnet/minecraft/world/entity/EntityTrackingStatus;)Vintermediary method_31816Lnet/minecraft/class_5579;method_31816(Lnet/minecraft/class_1923;Lnet/minecraft/class_5584;)Vofficial aLejk;a(Ldmd;Lejo;)V
-
readIfFresh
private void readIfFresh(long chunkPos) - Mappings:
Namespace Name Mixin selector named readIfFreshLnet/minecraft/server/world/ServerEntityManager;readIfFresh(J)Vintermediary method_31810Lnet/minecraft/class_5579;method_31810(J)Vofficial bLejk;b(J)V
-
trySave
Tries to save entities in a chunk and performs anactionon each saved entity if successful.If a chunk is
ServerEntityManager.Status.FRESHorServerEntityManager.Status.PENDING, it cannot be saved.- Parameters:
action- action performed on each saved entity if saving is successful- Returns:
- whether the saving is successful
- Mappings:
Namespace Name Mixin selector named trySaveLnet/minecraft/server/world/ServerEntityManager;trySave(JLjava/util/function/Consumer;)Zintermediary method_31812Lnet/minecraft/class_5579;method_31812(JLjava/util/function/Consumer;)Zofficial aLejk;a(JLjava/util/function/Consumer;)Z
-
scheduleRead
private void scheduleRead(long chunkPos) - Mappings:
Namespace Name Mixin selector named scheduleReadLnet/minecraft/server/world/ServerEntityManager;scheduleRead(J)Vintermediary method_31830Lnet/minecraft/class_5579;method_31830(J)Vofficial cLejk;c(J)V
-
unload
private boolean unload(long chunkPos) - Mappings:
Namespace Name Mixin selector named unloadLnet/minecraft/server/world/ServerEntityManager;unload(J)Zintermediary method_31837Lnet/minecraft/class_5579;method_31837(J)Zofficial dLejk;d(J)Z
-
unload
- Mappings:
Namespace Name Mixin selector named unloadLnet/minecraft/server/world/ServerEntityManager;unload(Lnet/minecraft/world/entity/EntityLike;)Vintermediary method_31852Lnet/minecraft/class_5579;method_31852(Lnet/minecraft/class_5568;)Vofficial gLejk;g(Leiz;)V
-
unloadChunks
private void unloadChunks()- Mappings:
Namespace Name Mixin selector named unloadChunksLnet/minecraft/server/world/ServerEntityManager;unloadChunks()Vintermediary method_31851Lnet/minecraft/class_5579;method_31851()Vofficial gLejk;g()V
-
loadChunks
private void loadChunks()- Mappings:
Namespace Name Mixin selector named loadChunksLnet/minecraft/server/world/ServerEntityManager;loadChunks()Vintermediary method_31853Lnet/minecraft/class_5579;method_31853()Vofficial hLejk;h()V
-
tick
public void tick()- Mappings:
Namespace Name Mixin selector named tickLnet/minecraft/server/world/ServerEntityManager;tick()Vintermediary method_31809Lnet/minecraft/class_5579;method_31809()Vofficial aLejk;a()V
-
getLoadedChunks
- Mappings:
Namespace Name Mixin selector named getLoadedChunksLnet/minecraft/server/world/ServerEntityManager;getLoadedChunks()Lit/unimi/dsi/fastutil/longs/LongSet;intermediary method_31855Lnet/minecraft/class_5579;method_31855()Lit/unimi/dsi/fastutil/longs/LongSet;official iLejk;i()Lit/unimi/dsi/fastutil/longs/LongSet;
-
save
public void save()- Mappings:
Namespace Name Mixin selector named saveLnet/minecraft/server/world/ServerEntityManager;save()Vintermediary method_31829Lnet/minecraft/class_5579;method_31829()Vofficial bLejk;b()V
-
flush
public void flush()- Mappings:
Namespace Name Mixin selector named flushLnet/minecraft/server/world/ServerEntityManager;flush()Vintermediary method_31836Lnet/minecraft/class_5579;method_31836()Vofficial cLejk;c()V
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
has
- Mappings:
Namespace Name Mixin selector named hasLnet/minecraft/server/world/ServerEntityManager;has(Ljava/util/UUID;)Zintermediary method_31827Lnet/minecraft/class_5579;method_31827(Ljava/util/UUID;)Zofficial aLejk;a(Ljava/util/UUID;)Z
-
getLookup
- Mappings:
Namespace Name Mixin selector named getLookupLnet/minecraft/server/world/ServerEntityManager;getLookup()Lnet/minecraft/world/entity/EntityLookup;intermediary method_31841Lnet/minecraft/class_5579;method_31841()Lnet/minecraft/class_5577;official dLejk;d()Leji;
-
shouldTick
- Mappings:
Namespace Name Mixin selector named shouldTickLnet/minecraft/server/world/ServerEntityManager;shouldTick(Lnet/minecraft/util/math/BlockPos;)Zintermediary method_40022Lnet/minecraft/class_5579;method_40022(Lnet/minecraft/class_2338;)Zofficial aLejk;a(Lix;)Z
-
shouldTick
- Mappings:
Namespace Name Mixin selector named shouldTickLnet/minecraft/server/world/ServerEntityManager;shouldTick(Lnet/minecraft/util/math/ChunkPos;)Zintermediary method_40021Lnet/minecraft/class_5579;method_40021(Lnet/minecraft/class_1923;)Zofficial bLejk;b(Ldmd;)Z
-
isLoaded
public boolean isLoaded(long chunkPos) - Mappings:
Namespace Name Mixin selector named isLoadedLnet/minecraft/server/world/ServerEntityManager;isLoaded(J)Zintermediary method_37252Lnet/minecraft/class_5579;method_37252(J)Zofficial aLejk;a(J)Z
-
dump
- Throws:
IOException- Mappings:
Namespace Name Mixin selector named dumpLnet/minecraft/server/world/ServerEntityManager;dump(Ljava/io/Writer;)Vintermediary method_31826Lnet/minecraft/class_5579;method_31826(Ljava/io/Writer;)Vofficial aLejk;a(Ljava/io/Writer;)V
-
getDebugString
- Mappings:
Namespace Name Mixin selector named getDebugStringLnet/minecraft/server/world/ServerEntityManager;getDebugString()Ljava/lang/String;intermediary method_31845Lnet/minecraft/class_5579;method_31845()Ljava/lang/String;official eLejk;e()Ljava/lang/String;
-
getIndexSize
public int getIndexSize()- Mappings:
Namespace Name Mixin selector named getIndexSizeLnet/minecraft/server/world/ServerEntityManager;getIndexSize()Iintermediary method_54490Lnet/minecraft/class_5579;method_54490()Iofficial fLejk;f()I
-