Iterate over entity array copy for entity scheduler
This commit is contained in:
parent
e8bec64217
commit
990be1691b
2 changed files with 19 additions and 12 deletions
|
@ -3742,10 +3742,10 @@ index 0000000000000000000000000000000000000000..924539d4ac50c70178ba220424ffacd6
|
|||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..82ccaf612548a7dbab7e5aeffb6eb8db84367477
|
||||
index 0000000000000000000000000000000000000000..41791c7331c80d496cde4e3d1846a178bef0bbe3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/entity/EntityLookup.java
|
||||
@@ -0,0 +1,840 @@
|
||||
@@ -0,0 +1,845 @@
|
||||
+package io.papermc.paper.chunk.system.entity;
|
||||
+
|
||||
+import com.destroystokyo.paper.util.maplist.EntityList;
|
||||
|
@ -3776,6 +3776,7 @@ index 0000000000000000000000000000000000000000..82ccaf612548a7dbab7e5aeffb6eb8db
|
|||
+import org.jetbrains.annotations.Nullable;
|
||||
+import org.slf4j.Logger;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Arrays;
|
||||
+import java.util.Iterator;
|
||||
+import java.util.List;
|
||||
+import java.util.NoSuchElementException;
|
||||
|
@ -3939,6 +3940,10 @@ index 0000000000000000000000000000000000000000..82ccaf612548a7dbab7e5aeffb6eb8db
|
|||
+ return new ArrayIterable<>(this.accessibleEntities.getRawData(), 0, this.accessibleEntities.size());
|
||||
+ }
|
||||
+
|
||||
+ public Entity[] getAllCopy() {
|
||||
+ return Arrays.copyOf(this.accessibleEntities.getRawData(), this.accessibleEntities.size(), Entity[].class);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public <U extends Entity> void get(final EntityTypeTest<Entity, U> filter, final AbortableIterationConsumer<U> action) {
|
||||
+ for (final Entity entity : this.entityById.values()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue