mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Fix enderdragon tracking range to honor vanilla
This commit is contained in:
parent
6f1cc1e9d3
commit
9a12d91631
1 changed files with 10 additions and 3 deletions
|
@ -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;
|
||||
+ }
|
||||
+ }
|
||||
|
|
Loading…
Reference in a new issue