Add support for RanagedEntity API for newer mobs (Fixes #4678)

This commit is contained in:
Shane Freeder 2020-10-22 13:01:44 +01:00
parent d0ad658b0c
commit f8eaa58556
2 changed files with 73 additions and 0 deletions

View File

@ -92,6 +92,39 @@ index c43854298548391679c1d280bd42edbeed7759b9..d23226ccb0f6c25028f000ce31346cd0
/**
* Represents the base color that the llama has.
diff --git a/src/main/java/org/bukkit/entity/Piglin.java b/src/main/java/org/bukkit/entity/Piglin.java
index eefe96c997af7d4547de3e047c2d36f0e09e25e2..6e106e1291370416f53a597b48822d3e839ee73d 100644
--- a/src/main/java/org/bukkit/entity/Piglin.java
+++ b/src/main/java/org/bukkit/entity/Piglin.java
@@ -1,9 +1,11 @@
package org.bukkit.entity;
+import com.destroystokyo.paper.entity.RangedEntity; // Paper
+
/**
* Represents a Piglin.
*/
-public interface Piglin extends PiglinAbstract {
+public interface Piglin extends PiglinAbstract, RangedEntity { // Paper
/**
* Get whether the piglin is able to hunt hoglins.
diff --git a/src/main/java/org/bukkit/entity/Pillager.java b/src/main/java/org/bukkit/entity/Pillager.java
index 9a2252fef56be1ed3ae2169aea46cb567e965c6c..11f38187fca830d974be01fea2966a31936184cb 100644
--- a/src/main/java/org/bukkit/entity/Pillager.java
+++ b/src/main/java/org/bukkit/entity/Pillager.java
@@ -1,8 +1,10 @@
package org.bukkit.entity;
+import com.destroystokyo.paper.entity.RangedEntity; // Paper
+
import org.bukkit.inventory.InventoryHolder;
/**
* Illager entity.
*/
-public interface Pillager extends Illager, InventoryHolder { }
+public interface Pillager extends Illager, InventoryHolder, RangedEntity { } // Paper
diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java
index 16b1293887cee2bc5267f3da771fb5a6ece1b4e9..1c367f78eadf24850061a84ce63b950b79d3c435 100644
--- a/src/main/java/org/bukkit/entity/Skeleton.java

View File

@ -101,6 +101,46 @@ index 23ab78da150cacefbac3e35f860dbd20548e54fa..3f94c5a9206e2da9c852d282e267ab4d
public CraftLlama(CraftServer server, EntityLlama entity) {
super(server, entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
index 6f83387c4c0978b427e64867f586890974dd9cbe..a7161a487ca9ff93b540a0b47e1ad47d55885735 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
@@ -1,11 +1,13 @@
package org.bukkit.craftbukkit.entity;
+import com.destroystokyo.paper.entity.CraftRangedEntity; // Paper
+
import net.minecraft.server.EntityPiglin;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Piglin;
-public class CraftPiglin extends CraftPiglinAbstract implements Piglin {
+public class CraftPiglin extends CraftPiglinAbstract implements Piglin, CraftRangedEntity<EntityPiglin> { // Paper
public CraftPiglin(CraftServer server, EntityPiglin entity) {
super(server, entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
index 9c659d764b57adf7b5dda0dbd7358cf9df1a1065..662caa42ebb51c3a1ecf0fbe21605589882f62d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
@@ -1,5 +1,7 @@
package org.bukkit.craftbukkit.entity;
+import com.destroystokyo.paper.entity.CraftRangedEntity; // Paper
+
import net.minecraft.server.EntityPillager;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.inventory.CraftInventory;
@@ -7,7 +9,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Pillager;
import org.bukkit.inventory.Inventory;
-public class CraftPillager extends CraftIllager implements Pillager {
+public class CraftPillager extends CraftIllager implements Pillager, CraftRangedEntity<EntityPillager> { // Paper
public CraftPillager(CraftServer server, EntityPillager entity) {
super(server, entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java
index b4ae8984019b09ae52d708a48663d9ca7509eb29..02df66ecfe92727e1b8e662bb41faac0dc014a44 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java