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 970735ca15
commit 4d21a2e77a
2 changed files with 73 additions and 0 deletions

View file

@ -92,6 +92,39 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Piglin.java
+++ b/src/main/java/org/bukkit/entity/Piglin.java
@@ -0,0 +0,0 @@
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Pillager.java
+++ b/src/main/java/org/bukkit/entity/Pillager.java
@@ -0,0 +0,0 @@
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Skeleton.java

View file

@ -101,6 +101,46 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
@@ -0,0 +0,0 @@
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPillager.java
@@ -0,0 +0,0 @@
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;
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java