mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-25 01:25:03 +01:00
SPIGOT-436: Add accompanying getSpectatorTarget().
By: md_5 <git@md-5.net>
This commit is contained in:
parent
90df5ef6df
commit
181cd3fd33
1 changed files with 6 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue