Paper/Spigot-Server-Patches/0428-Tracking-Range-Improvements.patch
Aikar e4d10a6d67
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches
a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType()

CraftBukkit Changes:
bbe3d58e SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException
3075579f Add FaceAttachable interface to handle Grindstone facing in common with Switches
95bd4238 SPIGOT-5647: ZombieVillager entity should have getVillagerType()
4d975ac3 SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
2020-04-02 17:09:17 -04:00

65 lines
2.6 KiB
Diff

From 0cfd2d9c26e2d1b12f6b3900812fc4e678a26a9e Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Sat, 21 Dec 2019 15:22:09 -0500
Subject: [PATCH] Tracking Range Improvements
Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/org/spigotmc/TrackingRange.java b/src/main/java/org/spigotmc/TrackingRange.java
index 6f8e6c1d07..46c33e6917 100644
--- a/src/main/java/org/spigotmc/TrackingRange.java
+++ b/src/main/java/org/spigotmc/TrackingRange.java
@@ -1,6 +1,7 @@
package org.spigotmc;
import net.minecraft.server.Entity;
+import net.minecraft.server.EntityEnderDragon; // Paper
import net.minecraft.server.EntityExperienceOrb;
import net.minecraft.server.EntityGhast;
import net.minecraft.server.EntityItem;
@@ -25,26 +26,24 @@ public class TrackingRange
if ( entity instanceof EntityPlayer )
{
return config.playerTrackingRange;
- } else if ( entity.activationType == ActivationRange.ActivationType.MONSTER || entity.activationType == ActivationRange.ActivationType.RAIDER )
- {
- return config.monsterTrackingRange;
- } else if ( entity instanceof EntityGhast )
- {
- if ( config.monsterTrackingRange > config.monsterActivationRange )
- {
+ // Paper start - Simplify and set water mobs to animal tracking range
+ }
+ switch (entity.activationType) {
+ case RAIDER:
+ case MONSTER:
return config.monsterTrackingRange;
- } else
- {
- return config.monsterActivationRange;
- }
- } else if ( entity.activationType == ActivationRange.ActivationType.ANIMAL )
- {
- return config.animalTrackingRange;
- } else if ( entity instanceof EntityItemFrame || entity instanceof EntityPainting || entity instanceof EntityItem || entity instanceof EntityExperienceOrb )
+ case WATER:
+ case ANIMAL:
+ return config.animalTrackingRange;
+ case MISC:
+ }
+ if ( entity instanceof EntityItemFrame || entity instanceof EntityPainting || entity instanceof EntityItem || entity instanceof EntityExperienceOrb )
+ // Paper end
{
return config.miscTrackingRange;
} else
{
+ if (entity instanceof EntityEnderDragon) return defaultRange; // Paper - enderdragon is exempt
return config.otherTrackingRange;
}
}
--
2.25.1