From 5c925130eb91340b5a8aad9adb83920426d1e0ed Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 31 Dec 2022 10:23:59 +1100 Subject: [PATCH] SPIGOT-7221: Add Enemy (Entity) interface By: ShaneBee --- paper-api/src/main/java/org/bukkit/entity/EnderDragon.java | 2 +- paper-api/src/main/java/org/bukkit/entity/Enemy.java | 6 ++++++ paper-api/src/main/java/org/bukkit/entity/Ghast.java | 2 +- paper-api/src/main/java/org/bukkit/entity/Hoglin.java | 2 +- paper-api/src/main/java/org/bukkit/entity/Monster.java | 2 +- paper-api/src/main/java/org/bukkit/entity/Phantom.java | 2 +- paper-api/src/main/java/org/bukkit/entity/Shulker.java | 2 +- paper-api/src/main/java/org/bukkit/entity/Slime.java | 2 +- 8 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 paper-api/src/main/java/org/bukkit/entity/Enemy.java diff --git a/paper-api/src/main/java/org/bukkit/entity/EnderDragon.java b/paper-api/src/main/java/org/bukkit/entity/EnderDragon.java index 856015b08b..0449664d7c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/paper-api/src/main/java/org/bukkit/entity/EnderDragon.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents an Ender Dragon */ -public interface EnderDragon extends ComplexLivingEntity, Boss, Mob { +public interface EnderDragon extends ComplexLivingEntity, Boss, Mob, Enemy { /** * Represents a phase or action that an Ender Dragon can perform. diff --git a/paper-api/src/main/java/org/bukkit/entity/Enemy.java b/paper-api/src/main/java/org/bukkit/entity/Enemy.java new file mode 100644 index 0000000000..434fd8d677 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/entity/Enemy.java @@ -0,0 +1,6 @@ +package org.bukkit.entity; + +/** + * Represents an Enemy + */ +public interface Enemy extends LivingEntity {} diff --git a/paper-api/src/main/java/org/bukkit/entity/Ghast.java b/paper-api/src/main/java/org/bukkit/entity/Ghast.java index d8eb2b5007..6b3c9bef9a 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Ghast.java +++ b/paper-api/src/main/java/org/bukkit/entity/Ghast.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Represents a Ghast. */ -public interface Ghast extends Flying { +public interface Ghast extends Flying, Enemy { /** * Gets whether the Ghast is charging diff --git a/paper-api/src/main/java/org/bukkit/entity/Hoglin.java b/paper-api/src/main/java/org/bukkit/entity/Hoglin.java index b49670816d..83a9e06fe9 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Hoglin.java +++ b/paper-api/src/main/java/org/bukkit/entity/Hoglin.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Represents a Hoglin. */ -public interface Hoglin extends Animals { +public interface Hoglin extends Animals, Enemy { /** * Gets whether the hoglin is immune to zombification. diff --git a/paper-api/src/main/java/org/bukkit/entity/Monster.java b/paper-api/src/main/java/org/bukkit/entity/Monster.java index fce2efd821..cc0dfcbadf 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Monster.java +++ b/paper-api/src/main/java/org/bukkit/entity/Monster.java @@ -3,4 +3,4 @@ package org.bukkit.entity; /** * Represents a Monster. */ -public interface Monster extends Creature {} +public interface Monster extends Creature, Enemy {} diff --git a/paper-api/src/main/java/org/bukkit/entity/Phantom.java b/paper-api/src/main/java/org/bukkit/entity/Phantom.java index 1a1044edc5..86cfdcf306 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Phantom.java +++ b/paper-api/src/main/java/org/bukkit/entity/Phantom.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Represents a phantom. */ -public interface Phantom extends Flying { +public interface Phantom extends Flying, Enemy { /** * @return The size of the phantom diff --git a/paper-api/src/main/java/org/bukkit/entity/Shulker.java b/paper-api/src/main/java/org/bukkit/entity/Shulker.java index 010e1f9c35..4816e6956e 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Shulker.java +++ b/paper-api/src/main/java/org/bukkit/entity/Shulker.java @@ -4,7 +4,7 @@ import org.bukkit.block.BlockFace; import org.bukkit.material.Colorable; import org.jetbrains.annotations.NotNull; -public interface Shulker extends Golem, Colorable { +public interface Shulker extends Golem, Colorable, Enemy { /** * Gets the peek state of the shulker between 0.0 and 1.0. diff --git a/paper-api/src/main/java/org/bukkit/entity/Slime.java b/paper-api/src/main/java/org/bukkit/entity/Slime.java index 1119e26e27..a5ad3250ce 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Slime.java +++ b/paper-api/src/main/java/org/bukkit/entity/Slime.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Represents a Slime. */ -public interface Slime extends Mob { +public interface Slime extends Mob, Enemy { /** * @return The size of the slime