mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Fixed any chance of creatures .getTarget throwing a class cast exception - thanks to an old PR by garbagemule!
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
e75caa842b
commit
b7d840939b
1 changed files with 1 additions and 0 deletions
|
@ -24,6 +24,7 @@ public class CraftCreature extends CraftLivingEntity implements Creature {
|
|||
|
||||
public CraftLivingEntity getTarget() {
|
||||
if (getHandle().target == null) return null;
|
||||
if (!(getHandle().target instanceof CraftLivingEntity)) return null;
|
||||
|
||||
return (CraftLivingEntity) getHandle().target.getBukkitEntity();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue