Allow setting the vex's summoner (#1545)

This commit is contained in:
BillyGalbreath 2018-10-06 22:31:21 -05:00 committed by Daniel Ennis
parent 06eff136c8
commit 0ca403459b
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,34 @@
From 1b3e6a9e6dba9df96c4080e4bbcb5afe9466637c Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 6 Oct 2018 21:47:09 -0500
Subject: [PATCH] Allow setting the vex's summoner
diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java
index d395e405..78f0082e 100644
--- a/src/main/java/org/bukkit/entity/Vex.java
+++ b/src/main/java/org/bukkit/entity/Vex.java
@@ -7,6 +7,19 @@ public interface Vex extends Monster {
/**
* @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex
*/
- Mob getSummoner(); // Paper
+ // Paper start
+ /**
+ * Get the Mob that summoned this vex
+ *
+ * @return Mob that summoned this vex
+ */
+ Mob getSummoner();
+ /**
+ * Set the summoner of this vex
+ *
+ * @param summoner New summoner
+ */
+ void setSummoner(Mob summoner);
+ // Paper end
}
--
2.19.0

View file

@ -0,0 +1,36 @@
From 2cbaed2df34422ba2b69b734f6398acc03d1ffc0 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 6 Oct 2018 21:47:44 -0500
Subject: [PATCH] Allow setting the vex's summoner
diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java
index 6e029ff44..1bf705e82 100644
--- a/src/main/java/net/minecraft/server/EntityVex.java
+++ b/src/main/java/net/minecraft/server/EntityVex.java
@@ -127,6 +127,7 @@ public class EntityVex extends EntityMonster {
this.a(1, flag);
}
+ public void setOwner(EntityInsentient entityinsentient) { a(entityinsentient); } // Paper - OBFHELPER
public void a(EntityInsentient entityinsentient) {
this.b = entityinsentient;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
index 927ed9a9a..c23b1e960 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
@@ -23,6 +23,10 @@ public class CraftVex extends CraftMonster implements Vex {
EntityInsentient owner = getHandle().getOwner();
return owner != null ? (Mob) owner.getBukkitEntity() : null;
}
+
+ public void setSummoner(Mob summoner) {
+ getHandle().setOwner(summoner == null ? null : ((CraftMob) summoner).getHandle());
+ }
// Paper end
@Override
--
2.19.0