mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +01:00
Fixed any chance of creatures .getTarget throwing a class cast exception - thanks to an old PR by garbagemule!
This commit is contained in:
parent
3d31c27864
commit
e6bb19f63a
@ -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 New Issue
Block a user