From 0dfb243c86eb2a1e214f5d7b7a43291381412d30 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 12 Jun 2015 15:34:54 +1000 Subject: [PATCH] SPIGOT-436: Add accompanying getSpectatorTarget(). --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 82e2a90afc..813adbba37 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1315,6 +1315,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { collection.add(new AttributeModifiable(getHandle().getAttributeMap(), (new AttributeRanged(null, "generic.maxHealth", scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); } + @Override + public org.bukkit.entity.Entity getSpectatorTarget() { + Entity followed = getHandle().C(); // PAIL + return followed == getHandle() ? null : followed.getBukkitEntity(); + } + @Override public void setSpectatorTarget(org.bukkit.entity.Entity entity) { Preconditions.checkArgument(getGameMode() == GameMode.SPECTATOR, "Player must be in spectator mode");