mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 21:33:49 -07:00
Add and use FeatureHooks.getAllEntities
The ServerLevel#getAllEntities function only returns entities which are accessible. FeatureHooks#getAllEntities will return all entities, whether or not they are accessible. Use the new hook in the EntityCommand, which allows server admins to inspect entities in unloaded chunks. Use the hook as well for ticking the EntityScheduler. This fixes an issue whether unloaded entities did not have their scheduler ticked.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- /dev/null
|
||||
+++ b/io/papermc/paper/FeatureHooks.java
|
||||
@@ -1,0 +_,241 @@
|
||||
@@ -1,0 +_,246 @@
|
||||
+package io.papermc.paper;
|
||||
+
|
||||
+import io.papermc.paper.command.PaperSubcommand;
|
||||
@@ -33,6 +33,11 @@
|
||||
+
|
||||
+public final class FeatureHooks {
|
||||
+
|
||||
+ // this includes non-accessible entities
|
||||
+ public static Iterable<Entity> getAllEntities(final net.minecraft.server.level.ServerLevel world) {
|
||||
+ return ((net.minecraft.world.level.entity.LevelEntityGetterAdapter<Entity>)world.getEntities()).sectionStorage.getAllEntities();
|
||||
+ }
|
||||
+
|
||||
+ public static void setPlayerChunkUnloadDelay(final long ticks) {
|
||||
+ }
|
||||
+
|
||||
|
Reference in New Issue
Block a user