mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 06:32:17 -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:
@@ -992,7 +992,7 @@
|
||||
+ // Paper start - Folia scheduler API
|
||||
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) org.bukkit.Bukkit.getGlobalRegionScheduler()).tick();
|
||||
+ getAllLevels().forEach(level -> {
|
||||
+ for (final net.minecraft.world.entity.Entity entity : level.getEntities().getAll()) {
|
||||
+ for (final net.minecraft.world.entity.Entity entity : io.papermc.paper.FeatureHooks.getAllEntities(level)) {
|
||||
+ if (entity.isRemoved()) {
|
||||
+ continue;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user