PaperMC/Spigot-Server-Patches/Vex-getSummoner-API.patch
Jason Penilla 062733b903 Updated Upstream (CraftBukkit/Spigot)
Doesn't compile yet.

CraftBukkit Changes:
90d6905b Repackage NMS
69cf961d Repackage patches

Spigot Changes:
79d53c28 Repackage NMS
2021-03-16 00:19:45 -07:00

37 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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/EntityVex.java b/src/main/java/net/minecraft/world/entity/monster/EntityVex.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityVex.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityVex.java
@@ -0,0 +0,0 @@ public class EntityVex extends EntityMonster {
}
+ public EntityInsentient getOwner() { return eK(); } // Paper - OBFHELPER
public EntityInsentient eK() {
return this.c;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
@@ -0,0 +0,0 @@ public class CraftVex extends CraftMonster implements Vex {
return (EntityVex) super.getHandle();
}
+ // Paper start
+ public org.bukkit.entity.Mob getSummoner() {
+ net.minecraft.world.entity.EntityInsentient owner = getHandle().getOwner();
+ return owner != null ? (org.bukkit.entity.Mob) owner.getBukkitEntity() : null;
+ }
+ // Paper end
+
@Override
public String toString() {
return "CraftVex";