diff --git a/Spigot-Server-Patches/Use-distance-map-to-optimise-entity-tracker.patch b/Spigot-Server-Patches/Use-distance-map-to-optimise-entity-tracker.patch index c5417374bb..b32e590025 100644 --- a/Spigot-Server-Patches/Use-distance-map-to-optimise-entity-tracker.patch +++ b/Spigot-Server-Patches/Use-distance-map-to-optimise-entity-tracker.patch @@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + configuredSpigotValue = spigotWorldConfig.otherTrackingRange; + break; + case ENDERDRAGON: -+ configuredSpigotValue = 10 * 16; // default is 10 chunk range // TODO check on update ++ configuredSpigotValue = EntityTypes.ENDER_DRAGON.getChunkRange() * 16; + break; + default: + throw new IllegalStateException("Missing case for enum " + trackingRangeType); @@ -337,12 +337,19 @@ diff --git a/src/main/java/org/spigotmc/TrackingRange.java b/src/main/java/org/s index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/TrackingRange.java +++ b/src/main/java/org/spigotmc/TrackingRange.java +@@ -0,0 +0,0 @@ public class TrackingRange + */ + public static int getEntityTrackingRange(Entity entity, int defaultRange) + { ++ if (entity instanceof EntityEnderDragon) return defaultRange; // Paper - enderdragon is exempt + SpigotWorldConfig config = entity.world.spigotConfig; + if ( entity instanceof EntityPlayer ) + { @@ -0,0 +0,0 @@ public class TrackingRange return config.miscTrackingRange; } else { - if (entity instanceof EntityEnderDragon) return ((WorldServer)(entity.getWorld())).getChunkProvider().playerChunkMap.getLoadViewDistance(); // Paper - enderdragon is exempt -+ if (entity instanceof EntityEnderDragon) return defaultRange; // Paper - enderdragon is exempt return config.otherTrackingRange; } } @@ -351,6 +358,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // copied from above, TODO check on update + public static TrackingRangeType getTrackingRangeType(Entity entity) + { ++ if (entity instanceof EntityEnderDragon) return TrackingRangeType.ENDERDRAGON; // Paper - enderdragon is exempt + if ( entity instanceof EntityPlayer ) + { + return TrackingRangeType.PLAYER; @@ -373,7 +381,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return TrackingRangeType.MISC; + } else + { -+ if (entity instanceof EntityEnderDragon) return TrackingRangeType.ENDERDRAGON; // Paper - enderdragon is exempt + return TrackingRangeType.OTHER; + } + }