mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Updated Upstream (Bukkit/CraftBukkit), deprecate SentientNPC API
Upstream has added the equivalent of our SentientNPC API, with exception to the EnderDragon. We've added Mob to the EnderDragon, and our SentientNPC API should behave the same. Vex#getOwner has been deprecated and a replacement Vex#getSummoner has been added using Mob. However, since 1.13 is not production ready, SentientNPC API is subject for removal in 1.13.1 since 1.13 API is not compatible with 1.12. Please move to the Mob interface ASAP. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: c5ab54d8 Expand GameRule API ab9a606c Improve entity hierarchy by adding Mob interface. CraftBukkit Changes:29e75648
Expand GameRule API50e6858b
Improve entity hierarchy by adding Mob interface.0e1d79b4
Correct error in previous patch
This commit is contained in:
parent
3eaefbe3fc
commit
7c619bbae0
21 changed files with 136 additions and 294 deletions
|
@ -14,7 +14,7 @@ This interface lets you identify NPC entities capable of sentience, and able to
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java b/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java
|
||||
new file mode 100644
|
||||
index 00000000..7e393254
|
||||
index 000000000..cb8de4629
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -43,112 +43,68 @@ index 00000000..7e393254
|
|||
+
|
||||
+package com.destroystokyo.paper.entity;
|
||||
+
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+import org.bukkit.entity.Mob;
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * Used to determine ACTUAL Living NPC's. Spigot mistakenly inversed the conditions for LivingEntity, and
|
||||
+ * used LivingEntity for Insentient Entities, and named the actual EntityLiving class EntityInsentient.
|
||||
+ *
|
||||
+ * This should of all been inversed on the implementation side. To make matters worse, Spigot never
|
||||
+ * exposed the differentiator that there are entities with AI that are not sentient/alive such as
|
||||
+ * Armor stands and Players are the only things that do not implement the REAL EntityLiving class (named Insentient internally)
|
||||
+ *
|
||||
+ * This interface lets you identify NPC entities capable of sentience, and able to move about and react to the world.
|
||||
+ * @deprecated Upstream has added this API. Use {@link Mob}. Will be removed in 1.13.1
|
||||
+ */
|
||||
+public interface SentientNPC extends LivingEntity {
|
||||
+
|
||||
+ /**
|
||||
+ * Instructs this Creature to set the specified LivingEntity as its
|
||||
+ * target.
|
||||
+ * <p>
|
||||
+ * Hostile creatures may attack their target, and friendly creatures may
|
||||
+ * follow their target.
|
||||
+ *
|
||||
+ * @param target New LivingEntity to target, or null to clear the target
|
||||
+ */
|
||||
+ public void setTarget(LivingEntity target);
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the current target of this Creature
|
||||
+ *
|
||||
+ * @return Current target of this creature, or null if none exists
|
||||
+ */
|
||||
+ public LivingEntity getTarget();
|
||||
+@Deprecated
|
||||
+public interface SentientNPC extends Mob {
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Ambient.java b/src/main/java/org/bukkit/entity/Ambient.java
|
||||
index 779e3897..ef548fb4 100644
|
||||
index 613830a74..4ad71c825 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Ambient.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Ambient.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
/**
|
||||
* Represents an ambient mob
|
||||
*/
|
||||
-public interface Ambient extends LivingEntity {}
|
||||
+public interface Ambient extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java
|
||||
index f74411c3..1f00923e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java
|
||||
@@ -0,0 +0,0 @@ import java.util.Set;
|
||||
* Represents a complex living entity - one that is made up of various smaller
|
||||
* parts
|
||||
*/
|
||||
-public interface ComplexLivingEntity extends LivingEntity {
|
||||
+public interface ComplexLivingEntity extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
/**
|
||||
* Gets a list of parts that belong to this complex entity
|
||||
*
|
||||
-public interface Ambient extends Mob {}
|
||||
+public interface Ambient extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper {}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Creature.java b/src/main/java/org/bukkit/entity/Creature.java
|
||||
index f223f55b..bbfb248e 100644
|
||||
index 6c9c5e85e..c796c4dc2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Creature.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Creature.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
* Represents a Creature. Creatures are non-intelligent monsters or animals
|
||||
* which have very simple abilities.
|
||||
*/
|
||||
-public interface Creature extends LivingEntity {
|
||||
+public interface Creature extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
-public interface Creature extends Mob {}
|
||||
+public interface Creature extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper
|
||||
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
index 4ea0e44e7..8f200e6c4 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
/**
|
||||
* Represents an Ender Dragon
|
||||
*/
|
||||
-public interface EnderDragon extends ComplexLivingEntity {
|
||||
+public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
|
||||
/**
|
||||
* Instructs this Creature to set the specified LivingEntity as its
|
||||
@@ -0,0 +0,0 @@ public interface Creature extends LivingEntity {
|
||||
*
|
||||
* @param target New LivingEntity to target, or null to clear the target
|
||||
*/
|
||||
- public void setTarget(LivingEntity target);
|
||||
+ //public void setTarget(LivingEntity target); // Paper - moved to SentientNPC
|
||||
|
||||
/**
|
||||
* Gets the current target of this Creature
|
||||
*
|
||||
* @return Current target of this creature, or null if none exists
|
||||
*/
|
||||
- public LivingEntity getTarget();
|
||||
+ //public LivingEntity getTarget(); // Paper - moved to SentientNPC
|
||||
}
|
||||
* Represents a phase or action that an Ender Dragon can perform.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Flying.java b/src/main/java/org/bukkit/entity/Flying.java
|
||||
index 4f16a26c..207e9922 100644
|
||||
index 580ce18bf..45840ee1f 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Flying.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Flying.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
/**
|
||||
* Represents a Flying Entity.
|
||||
*/
|
||||
-public interface Flying extends LivingEntity {}
|
||||
+public interface Flying extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
+
|
||||
+}
|
||||
-public interface Flying extends Mob {}
|
||||
+public interface Flying extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper
|
||||
diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java
|
||||
index 0d87d203..d4eee19c 100644
|
||||
index 1119e26e2..46d03d29d 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Slime.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Slime.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
/**
|
||||
* Represents a Slime.
|
||||
*/
|
||||
-public interface Slime extends LivingEntity {
|
||||
+public interface Slime extends LivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
-public interface Slime extends Mob {
|
||||
+public interface Slime extends Mob, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
|
||||
/**
|
||||
* @return The size of the slime
|
||||
|
|
|
@ -10,7 +10,7 @@ This adds a new Builder API which is much friendlier to use.
|
|||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
|
||||
new file mode 100644
|
||||
index 00000000..2bccc409
|
||||
index 000000000..2bccc4098
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -380,7 +380,7 @@ index 00000000..2bccc409
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
|
||||
index 4d0acaf5..0ae85d85 100644
|
||||
index 4d0acaf5b..0ae85d855 100644
|
||||
--- a/src/main/java/org/bukkit/Particle.java
|
||||
+++ b/src/main/java/org/bukkit/Particle.java
|
||||
@@ -0,0 +0,0 @@ public enum Particle {
|
||||
|
@ -410,7 +410,7 @@ index 4d0acaf5..0ae85d85 100644
|
|||
* Options which can be applied to redstone dust particles - a particle
|
||||
* color and size.
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 49d2cc45..fd3a63fa 100644
|
||||
index cf5bd1540..a7964fb1e 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
|
|
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors
|
|||
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
|
||||
index 43239f84..fe8d3468 100644
|
||||
index 43239f844..fe8d34685 100644
|
||||
--- a/src/main/java/org/bukkit/NamespacedKey.java
|
||||
+++ b/src/main/java/org/bukkit/NamespacedKey.java
|
||||
@@ -0,0 +0,0 @@ public final class NamespacedKey {
|
||||
|
@ -21,7 +21,7 @@ index 43239f84..fe8d3468 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index d461c382..4e07af2e 100644
|
||||
index e2559c024..9f3d805c2 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
|
@ -73,7 +73,7 @@ index d461c382..4e07af2e 100644
|
|||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java
|
||||
index 10757454..6d5410ea 100644
|
||||
index 107574546..6d5410eab 100644
|
||||
--- a/src/main/java/org/bukkit/entity/AbstractHorse.java
|
||||
+++ b/src/main/java/org/bukkit/entity/AbstractHorse.java
|
||||
@@ -0,0 +0,0 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab
|
||||
|
@ -86,7 +86,7 @@ index 10757454..6d5410ea 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Guardian.java b/src/main/java/org/bukkit/entity/Guardian.java
|
||||
index 98af0563..ec6890ae 100644
|
||||
index 98af0563c..ec6890ae6 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Guardian.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Guardian.java
|
||||
@@ -0,0 +0,0 @@ public interface Guardian extends Monster {
|
||||
|
@ -99,7 +99,7 @@ index 98af0563..ec6890ae 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java
|
||||
index cfce8fa5..8660070b 100644
|
||||
index cfce8fa57..8660070bb 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Horse.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Horse.java
|
||||
@@ -0,0 +0,0 @@ public interface Horse extends AbstractHorse {
|
||||
|
@ -112,7 +112,7 @@ index cfce8fa5..8660070b 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 98c6039b..7c008237 100644
|
||||
index 98c6039b9..7c008237a 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
|
@ -205,7 +205,7 @@ index 98c6039b..7c008237 100644
|
|||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
index 2a02ab85..e33d00b3 100644
|
||||
index 2a02ab855..e33d00b30 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
@@ -0,0 +0,0 @@ public interface Skeleton extends Monster {
|
||||
|
@ -217,7 +217,7 @@ index 2a02ab85..e33d00b3 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java
|
||||
index cf53ea22..62923379 100644
|
||||
index cf53ea22f..629233796 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Zombie.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Zombie.java
|
||||
@@ -0,0 +0,0 @@ public interface Zombie extends Monster {
|
||||
|
@ -238,7 +238,7 @@ index cf53ea22..62923379 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
||||
index de4fb37f..f1de2af6 100644
|
||||
index de4fb37f3..f1de2af6e 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent {
|
||||
|
@ -258,7 +258,7 @@ index de4fb37f..f1de2af6 100644
|
|||
public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot
|
||||
this(player, hostname, address, realAddress); // Spigot
|
||||
diff --git a/src/main/java/org/bukkit/inventory/Merchant.java b/src/main/java/org/bukkit/inventory/Merchant.java
|
||||
index c8e68570..45431b36 100644
|
||||
index c8e68570f..45431b360 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/Merchant.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/Merchant.java
|
||||
@@ -0,0 +0,0 @@ public interface Merchant {
|
||||
|
@ -280,7 +280,7 @@ index c8e68570..45431b36 100644
|
|||
void setRecipe(int i, MerchantRecipe recipe) throws IndexOutOfBoundsException;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java
|
||||
index 1413b361..b4a8051c 100644
|
||||
index 1413b361b..b4a8051cc 100644
|
||||
--- a/src/main/java/org/bukkit/potion/Potion.java
|
||||
+++ b/src/main/java/org/bukkit/potion/Potion.java
|
||||
@@ -0,0 +0,0 @@ public class Potion {
|
||||
|
@ -292,7 +292,7 @@ index 1413b361..b4a8051c 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java
|
||||
index 40f8d12b..33d19228 100644
|
||||
index 40f8d12b9..33d192287 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionBrewer.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionBrewer.java
|
||||
@@ -0,0 +0,0 @@ public interface PotionBrewer {
|
||||
|
@ -305,7 +305,7 @@ index 40f8d12b..33d19228 100644
|
|||
*/
|
||||
public Collection<PotionEffect> getEffects(PotionType type, boolean upgraded, boolean extended);
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java
|
||||
index 034421a7..f1a54c23 100644
|
||||
index 034421a76..f1a54c23c 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionType.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionType.java
|
||||
@@ -0,0 +0,0 @@ public enum PotionType {
|
||||
|
@ -335,7 +335,7 @@ index 034421a7..f1a54c23 100644
|
|||
*/
|
||||
@Deprecated
|
||||
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
index ab71f3c3..358ea386 100644
|
||||
index ab71f3c31..358ea386b 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
|
||||
@@ -0,0 +0,0 @@ public interface Team {
|
||||
|
|
20
Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch
Normal file
20
Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 10 Aug 2018 22:08:34 -0400
|
||||
Subject: [PATCH] Make EnderDragon extend Mob
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
index 8f200e6c4..dad0b3141 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.entity;
|
||||
/**
|
||||
* Represents an Ender Dragon
|
||||
*/
|
||||
-public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper
|
||||
+public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC, org.bukkit.entity.Mob { // Paper - add Mob
|
||||
|
||||
/**
|
||||
* Represents a phase or action that an Ender Dragon can perform.
|
||||
--
|
|
@ -1,12 +1,12 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 4 Jul 2018 15:29:21 -0400
|
||||
Subject: [PATCH] Vex#getOwner API
|
||||
Subject: [PATCH] Vex#getSummoner API
|
||||
|
||||
Get's the NPC that summoned this Vex
|
||||
Get's the Mob that summoned this Vex
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java
|
||||
index a2f2fcae..540135c3 100644
|
||||
index a2f2fcaec..734683763 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Vex.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Vex.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -21,7 +21,12 @@ index a2f2fcae..540135c3 100644
|
|||
+public interface Vex extends Monster {
|
||||
+ /**
|
||||
+ * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex
|
||||
+ * @deprecated Use {@link #getSummoner()}
|
||||
+ */
|
||||
+ SentientNPC getOwner(); // Paper
|
||||
+ @Deprecated
|
||||
+ default SentientNPC getOwner() { return (SentientNPC) getSummoner(); } // Paper
|
||||
+
|
||||
+ Mob getSummoner(); // Paper
|
||||
+
|
||||
+}
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add 5 second short dumps to watchdog
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 57a4748a3..815c3e664 100644
|
||||
index 57a4748a30..815c3e6649 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||
|
|
|
@ -1,163 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 1 Jul 2018 22:06:29 -0400
|
||||
Subject: [PATCH] Add SentientNPC Interface to Entities
|
||||
|
||||
Used to determine ACTUAL Living NPC's. Spigot mistakenly inversed the conditions for LivingEntity, and
|
||||
used LivingEntity for Insentient Entities, and named the actual EntityLiving class EntityInsentient.
|
||||
|
||||
This should of all been inversed on the implementation side. To make matters worse, Spigot never
|
||||
exposed the differentiator that there are entities with AI that are not sentient/alive such as
|
||||
Armor stands and Players are the only things that do not implement the REAL EntityLiving class (named Insentient internally)
|
||||
|
||||
This interface lets you identify NPC entities capable of sentience, and able to move about and react to the world.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/CraftSentientNPC.java b/src/main/java/com/destroystokyo/paper/entity/CraftSentientNPC.java
|
||||
new file mode 100644
|
||||
index 0000000000..a60ba13495
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/CraftSentientNPC.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package com.destroystokyo.paper.entity;
|
||||
+
|
||||
+import net.minecraft.server.EntityInsentient;
|
||||
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+
|
||||
+public interface CraftSentientNPC <T extends EntityInsentient> extends SentientNPC {
|
||||
+ T getHandle();
|
||||
+
|
||||
+ default public void setTarget(LivingEntity target) {
|
||||
+ T entity = getHandle();
|
||||
+ if (target == null) {
|
||||
+ entity.setGoalTarget(null, null, false);
|
||||
+ } else if (target instanceof CraftLivingEntity) {
|
||||
+ entity.setGoalTarget(((CraftLivingEntity) target).getHandle(), null, false);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ default public LivingEntity getTarget() {
|
||||
+ if (getHandle().getGoalTarget() == null) return null;
|
||||
+
|
||||
+ return (CraftLivingEntity) getHandle().getGoalTarget().getBukkitEntity();
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java
|
||||
index 086980e76d..ccce080ab8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAmbient.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.CraftSentientNPC;
|
||||
import net.minecraft.server.EntityAmbient;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Ambient;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
-public class CraftAmbient extends CraftLivingEntity implements Ambient {
|
||||
+public class CraftAmbient extends CraftLivingEntity implements Ambient, CraftSentientNPC { // Paper
|
||||
public CraftAmbient(CraftServer server, EntityAmbient entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
||||
index cc115cc368..3a4e6f0c7e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.CraftSentientNPC;
|
||||
+import net.minecraft.server.EntityInsentient;
|
||||
import net.minecraft.server.EntityLiving;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.ComplexLivingEntity;
|
||||
|
||||
-public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity {
|
||||
+public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity, CraftSentientNPC { // Paper
|
||||
public CraftComplexLivingEntity(CraftServer server, EntityLiving entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
- public EntityLiving getHandle() {
|
||||
- return (EntityLiving) entity;
|
||||
+ public EntityInsentient getHandle() { // Paper
|
||||
+ return (EntityInsentient) entity; // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java
|
||||
index 09d42141fb..30004e5e8c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreature.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.CraftSentientNPC;
|
||||
import net.minecraft.server.EntityCreature;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
-public class CraftCreature extends CraftLivingEntity implements Creature {
|
||||
+public class CraftCreature extends CraftLivingEntity implements Creature, CraftSentientNPC { // Paper
|
||||
public CraftCreature(CraftServer server, EntityCreature entity) {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
- public void setTarget(LivingEntity target) {
|
||||
+ // Paper start - move down to SentientNPC
|
||||
+ /*public void setTarget(LivingEntity target) {
|
||||
EntityCreature entity = getHandle();
|
||||
if (target == null) {
|
||||
entity.setGoalTarget(null, null, false);
|
||||
@@ -0,0 +0,0 @@ public class CraftCreature extends CraftLivingEntity implements Creature {
|
||||
if (getHandle().getGoalTarget() == null) return null;
|
||||
|
||||
return (CraftLivingEntity) getHandle().getGoalTarget().getBukkitEntity();
|
||||
- }
|
||||
+ }*/
|
||||
+ // Paper end
|
||||
|
||||
@Override
|
||||
public EntityCreature getHandle() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java
|
||||
index f374c7b880..9e6f523bf1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFlying.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.CraftSentientNPC;
|
||||
import net.minecraft.server.EntityFlying;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Flying;
|
||||
|
||||
-public class CraftFlying extends CraftLivingEntity implements Flying {
|
||||
+public class CraftFlying extends CraftLivingEntity implements Flying, CraftSentientNPC { // Paper
|
||||
|
||||
public CraftFlying(CraftServer server, EntityFlying entity) {
|
||||
super(server, entity);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
||||
index 6bf30c834c..3768b9573a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.CraftSentientNPC;
|
||||
import net.minecraft.server.EntitySlime;
|
||||
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Slime;
|
||||
|
||||
-public class CraftSlime extends CraftLivingEntity implements Slime {
|
||||
+public class CraftSlime extends CraftLivingEntity implements Slime, CraftSentientNPC { // Paper
|
||||
|
||||
public CraftSlime(CraftServer server, EntitySlime entity) {
|
||||
super(server, entity);
|
||||
--
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add async chunk load API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 54a605f9b9..f4dc7e4ac6 100644
|
||||
index 654e7cdfa2..512b457e10 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
index b2010ffa6..3493c4c44 100644
|
||||
index b2010ffa6f..3493c4c44d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
@@ -0,0 +0,0 @@ public class EntityCow extends EntityAnimal {
|
||||
|
@ -18,7 +18,7 @@ index b2010ffa6..3493c4c44 100644
|
|||
if (event.isCancelled()) {
|
||||
return false;
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java
|
||||
index 2c36c3990..b38ee2853 100644
|
||||
index 2c36c3990e..b38ee28532 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemBucket.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemBucket.java
|
||||
@@ -0,0 +0,0 @@ public class ItemBucket extends Item {
|
||||
|
@ -67,7 +67,7 @@ index 2c36c3990..b38ee2853 100644
|
|||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity
|
||||
// TODO: inventory not updated
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 140ddae0d..9037a1233 100644
|
||||
index 140ddae0d7..9037a1233a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
|
|
|
@ -150,7 +150,7 @@ index 7dae87199e..b6efd8506b 100644
|
|||
this.methodProfiler.a(() -> {
|
||||
return String.valueOf(TileEntityTypes.a(tileentity.C()));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e3e45ed48a..d4851dd2a6 100644
|
||||
index 907791a5f1..579e783d11 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -14,7 +14,7 @@ Fix this by differing entity add to world for all entities at the same time
|
|||
the original entity is dead, overwrite it as the logic does for unloaod queued entities.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index e510940ab..db8fbc006 100644
|
||||
index e510940ab3..db8fbc006d 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -41,7 +41,7 @@ index e510940ab..db8fbc006 100644
|
|||
// CraftBukkit start
|
||||
org.bukkit.Server server = this.world.getServer();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index b0053e5e6..004c3ec47 100644
|
||||
index b0053e5e63..004c3ec474 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
|
||||
|
@ -70,7 +70,7 @@ index b0053e5e6..004c3ec47 100644
|
|||
}
|
||||
this.entityList.add(entity);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 7a9f28421..6412715b7 100644
|
||||
index 7a9f28421b..6412715b78 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
|
|
|
@ -37,7 +37,7 @@ index 5d5f6f6328..d506503e93 100644
|
|||
|
||||
if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index b3756074b5..62638d4e25 100644
|
||||
index 5cadee4ae0..aa8b237faf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -12,7 +12,7 @@ This allows the client to render multiple skull textures from the same user,
|
|||
for when different skins were used when skull was made.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index e52014fd8..da11ec167 100644
|
||||
index e52014fd8f..da11ec1672 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public final class ItemStack {
|
||||
|
@ -25,7 +25,7 @@ index e52014fd8..da11ec167 100644
|
|||
private EntityItemFrame i;
|
||||
private ShapeDetectorBlock j;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
index d04afceb7..b0e8ffc4b 100644
|
||||
index d04afceb70..b0e8ffc4b1 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
||||
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
||||
|
@ -62,7 +62,7 @@ index d04afceb7..b0e8ffc4b 100644
|
|||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
index 1aa36156a..c5f0b8530 100644
|
||||
index 1aa36156a8..c5f0b85309 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
|
||||
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
|
@ -83,7 +83,7 @@ index 1aa36156a..c5f0b8530 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java
|
||||
index 85fd8dab6..16a5537ce 100644
|
||||
index 85fd8dab60..16a5537ce0 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySkull.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java
|
||||
@@ -0,0 +0,0 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa
|
||||
|
|
|
@ -71,7 +71,7 @@ index ff0112c52a..82f4f00a76 100644
|
|||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index f4dc7e4ac6..8923df898f 100644
|
||||
index 512b457e10..051e840507 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement World.getEntity(UUID) API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 23f0d5cb7d..54a605f9b9 100644
|
||||
index dee9c01e77..654e7cdfa2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] MC-135506: Experience should save as Integers
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
index b8bfc7577..13299ad10 100644
|
||||
index b8bfc75771..13299ad102 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
@@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity {
|
||||
|
|
|
@ -58,19 +58,6 @@ index 002da2a191..9f3aa24590 100644
|
|||
++this.g.d;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneComparator.java b/src/main/java/net/minecraft/server/BlockRedstoneComparator.java
|
||||
index 1697e19e7a..699a9bea6a 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockRedstoneComparator.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockRedstoneComparator.java
|
||||
@@ -0,0 +0,0 @@ public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITile
|
||||
|
||||
@Nullable
|
||||
private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) {
|
||||
- List list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (entityitemframe) -> {
|
||||
+ List list = world.a(EntityItemFrame.class, new AxisAlignedBB((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), (double) (blockposition.getX() + 1), (double) (blockposition.getY() + 1), (double) (blockposition.getZ() + 1)), (Predicate<EntityItemFrame>)(entityitemframe) -> { // Paper - Fix compile issue
|
||||
return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
|
||||
});
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
index 650ef14758..35aea4829f 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkSection.java
|
||||
|
|
34
Spigot-Server-Patches/Make-EnderDragon-implement-Mob.patch
Normal file
34
Spigot-Server-Patches/Make-EnderDragon-implement-Mob.patch
Normal file
|
@ -0,0 +1,34 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 10 Aug 2018 22:11:49 -0400
|
||||
Subject: [PATCH] Make EnderDragon implement Mob
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
||||
index cc115cc368..4947249da2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import net.minecraft.server.EntityInsentient;
|
||||
import net.minecraft.server.EntityLiving;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.ComplexLivingEntity;
|
||||
|
||||
-public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity {
|
||||
- public CraftComplexLivingEntity(CraftServer server, EntityLiving entity) {
|
||||
+public abstract class CraftComplexLivingEntity extends CraftMob implements ComplexLivingEntity { // Paper
|
||||
+ public CraftComplexLivingEntity(CraftServer server, EntityInsentient entity) { // Paper
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
- public EntityLiving getHandle() {
|
||||
- return (EntityLiving) entity;
|
||||
+ public EntityInsentient getHandle() { // Paper
|
||||
+ return (EntityInsentient) entity; // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
|
@ -1,7 +1,7 @@
|
|||
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#getOwner API
|
||||
Subject: [PATCH] Vex#getSummoner API
|
||||
|
||||
Get's the NPC that summoned this Vex
|
||||
|
||||
|
@ -18,25 +18,28 @@ index 80403473c8..36f8c315b5 100644
|
|||
return this.b;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java
|
||||
index 787a41e015..5d5658136c 100644
|
||||
index 787a41e015..927ed9a9a8 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 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.SentientNPC;
|
||||
+import net.minecraft.server.EntityInsentient;
|
||||
import net.minecraft.server.EntityVex;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Mob;
|
||||
import org.bukkit.entity.Vex;
|
||||
|
||||
public class CraftVex extends CraftMonster implements Vex {
|
||||
@@ -0,0 +0,0 @@ public class CraftVex extends CraftMonster implements Vex {
|
||||
return (EntityVex) super.getHandle();
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public SentientNPC getOwner() {
|
||||
+ public Mob getSummoner() {
|
||||
+ EntityInsentient owner = getHandle().getOwner();
|
||||
+ return owner != null ? (SentientNPC) owner.getBukkitEntity() : null;
|
||||
+ return owner != null ? (Mob) owner.getBukkitEntity() : null;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
|
@ -1 +1 @@
|
|||
Subproject commit 6875ad8bb890376913d9141b955c996444fbe94c
|
||||
Subproject commit c5ab54d8912abadb0426ca9acd701732aa4c6e33
|
|
@ -1 +1 @@
|
|||
Subproject commit eb36029f1cc9e4dffaa757da980c7d100cf86605
|
||||
Subproject commit 29e75648741b877c06165d82241b6b3a417474f6
|
Loading…
Reference in a new issue