mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-01 04:43:50 -07:00
RangedEntity API
Allows you to determine if an entity is capable of ranged attacks, and to perform an attack.
This commit is contained in:
132
Spigot-API-Patches/RangedEntity-API.patch
Normal file
132
Spigot-API-Patches/RangedEntity-API.patch
Normal file
@@ -0,0 +1,132 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 26 Jun 2018 21:34:40 -0400
|
||||
Subject: [PATCH] RangedEntity API
|
||||
|
||||
Allows you to determine if an entity is capable of ranged attacks,
|
||||
and to perform an attack.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
||||
new file mode 100644
|
||||
index 00000000..5153efab
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
||||
@@ -0,0 +0,0 @@
|
||||
+package com.destroystokyo.paper.entity;
|
||||
+
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+
|
||||
+public interface RangedEntity extends SentientNPC {
|
||||
+ /**
|
||||
+ * Attack the specified entity using a ranged attack.
|
||||
+ *
|
||||
+ * @param charge How "charged" the attack is (how far back the bow was pulled for Bow attacks).
|
||||
+ * This should be a value between 0 and 1, represented as targetDistance/maxDistance.
|
||||
+ */
|
||||
+ void rangedAttack(LivingEntity target, float charge);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets that the Entity is "charging" up an attack, by raising its arms
|
||||
+ * @param charging Whether the entities arms are raised to charge attack
|
||||
+ */
|
||||
+ void setChargingAttack(boolean charging);
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java
|
||||
index 7c92c431..14e6c5ee 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Illusioner.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Illusioner.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
+
|
||||
/**
|
||||
* Represents an Illusioner "Illager".
|
||||
*/
|
||||
-public interface Illusioner extends Spellcaster { }
|
||||
+public interface Illusioner extends Spellcaster, RangedEntity { // Paper
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
|
||||
index 9422d56c..92c30ed5 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Llama.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Llama.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
import org.bukkit.inventory.LlamaInventory;
|
||||
|
||||
/**
|
||||
* Represents a Llama.
|
||||
*/
|
||||
-public interface Llama extends ChestedHorse {
|
||||
+public interface Llama extends ChestedHorse, RangedEntity { // Paper
|
||||
|
||||
/**
|
||||
* Represents the base color that the llama has.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
index e33d00b3..40157bef 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Skeleton.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
+
|
||||
/**
|
||||
* Represents a Skeleton.
|
||||
*/
|
||||
-public interface Skeleton extends Monster {
|
||||
+public interface Skeleton extends Monster, RangedEntity { // Paper
|
||||
|
||||
/**
|
||||
* Gets the current type of this skeleton.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java
|
||||
index 818efe2a..10f8f6d4 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Snowman.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Snowman.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
+
|
||||
/**
|
||||
* Represents a snowman entity
|
||||
*/
|
||||
-public interface Snowman extends Golem {
|
||||
+public interface Snowman extends Golem, RangedEntity { // Paper
|
||||
|
||||
/**
|
||||
* Gets whether this snowman is in "derp mode", meaning it is not wearing a
|
||||
diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java
|
||||
index 9c5dc1f9..4b27f689 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Witch.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Witch.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
+
|
||||
/**
|
||||
* Represents a Witch
|
||||
*/
|
||||
-public interface Witch extends Monster {
|
||||
+public interface Witch extends Monster, RangedEntity { // Paper
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java
|
||||
index 0922c5c6..c550ed06 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Wither.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Wither.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
+import com.destroystokyo.paper.entity.RangedEntity;
|
||||
+
|
||||
/**
|
||||
* Represents a Wither boss
|
||||
*/
|
||||
-public interface Wither extends Monster {
|
||||
+public interface Wither extends Monster, RangedEntity { // Paper
|
||||
}
|
||||
--
|
Reference in New Issue
Block a user