Vex#get/setSummoner API
Get's the NPC that summoned this Vex and Allow setting the vex's summoner Co-authored-by: BillyGalbreath <Blake.Galbreath@GMail.com>
This commit is contained in:
@@ -18,6 +18,19 @@ public class CraftVex extends CraftMonster implements Vex {
|
||||
return (net.minecraft.world.entity.monster.Vex) super.getHandle();
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public org.bukkit.entity.Mob getSummoner() {
|
||||
net.minecraft.world.entity.Mob owner = getHandle().getOwner();
|
||||
return owner != null ? (org.bukkit.entity.Mob) owner.getBukkitEntity() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSummoner(org.bukkit.entity.Mob summoner) {
|
||||
getHandle().setOwner(summoner == null ? null : ((CraftMob) summoner).getHandle());
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftVex";
|
||||
|
||||
Reference in New Issue
Block a user