From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 15:30:22 -0400 Subject: [PATCH] Vex#getSummoner API Get's the NPC that summoned this Vex diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java index 3204ae9a9243818727bedfa060c07bc34d3b4c66..ec4f6d96360e759ffc19de838fdbf3027164a424 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vex.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java @@ -124,6 +124,7 @@ public class Vex extends Monster { } + public Mob getOwner() { return getOwner(); } // Paper - OBFHELPER public Mob getOwner() { return this.owner; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java index 2b4e9ddca5c6429c01d780d65a64ef6a59446c69..56bec4350f36a94d4dfa71a234872a795c2dcb3f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java @@ -15,6 +15,13 @@ public class CraftVex extends CraftMonster implements Vex { return (net.minecraft.world.entity.monster.Vex) super.getHandle(); } + // Paper start + public org.bukkit.entity.Mob getSummoner() { + net.minecraft.world.entity.Mob owner = getHandle().getOwner(); + return owner != null ? (org.bukkit.entity.Mob) owner.getBukkitEntity() : null; + } + // Paper end + @Override public String toString() { return "CraftVex";