13
0
geforkt von Mirrors/Paper

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>
Dieser Commit ist enthalten in:
Aikar 2018-07-04 15:30:22 -04:00
Ursprung 3430a002d1
Commit 904c0460cc

Datei anzeigen

@ -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";