Use tracker field instead of entity map lookup in CraftEntity#getTrackedBy

Fixes compilation
This commit is contained in:
Spottedleaf 2023-10-06 18:29:06 -07:00
parent dc3fcef3bb
commit 8cde60d1f9
2 changed files with 11 additions and 2 deletions

View File

@ -22305,7 +22305,7 @@ index cd4ad8261e56365850068db1d83d6a8454026737..78f7e72f2912dae503c2dab7d1992b65
List<String> offers = waitable.get(); List<String> offers = waitable.get();
if (offers == null) { if (offers == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 315d8260e196709ed9084272aa640f11e327c0a8..a0fe9b92209798ec71c27709813f7040e944c49f 100644 index 315d8260e196709ed9084272aa640f11e327c0a8..1b4926c62e93158180714f58cafb31d9e365f6b3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -581,6 +581,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -581,6 +581,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@ -22320,6 +22320,15 @@ index 315d8260e196709ed9084272aa640f11e327c0a8..a0fe9b92209798ec71c27709813f7040
// Paper end // Paper end
Preconditions.checkArgument(location != null, "location cannot be null"); Preconditions.checkArgument(location != null, "location cannot be null");
location.checkFinite(); location.checkFinite();
@@ -1035,7 +1040,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
ImmutableSet.Builder<Player> players = ImmutableSet.builder();
ServerLevel world = ((CraftWorld) this.getWorld()).getHandle();
- ChunkMap.TrackedEntity entityTracker = world.getChunkSource().chunkMap.entityMap.get(this.getEntityId());
+ ChunkMap.TrackedEntity entityTracker = this.getHandle().tracker; // Folia - region threading
if (entityTracker != null) {
for (ServerPlayerConnection connection : entityTracker.seenBy) {
@@ -1293,7 +1298,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1293,7 +1298,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }

View File

@ -897,7 +897,7 @@ index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..9fc90b162aab15a9cd60b02aba563181
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index a0fe9b92209798ec71c27709813f7040e944c49f..9bcd9b5b519cc7289712f853f8017e6ed2b2ca61 100644 index 1b4926c62e93158180714f58cafb31d9e365f6b3..ca87a47afa4260d2dfc4f0010843aa0f4b7b6e9c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -826,7 +826,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -826,7 +826,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {