summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenmori <thesenmori@gmail.com>2018-02-03 17:47:37 +1100
committermd_5 <git@md-5.net>2018-02-03 17:47:37 +1100
commitd9006fb04c37444226a867b64c14cb4cfe830610 (patch)
tree3aa36ddc2a5398e5690bf8351b99523e6390aa5f
parent9bd34e7b7a0141e159dc786feca77847f01366dd (diff)
downloadbukkit-d9006fb04c37444226a867b64c14cb4cfe830610.tar
bukkit-d9006fb04c37444226a867b64c14cb4cfe830610.tar.gz
bukkit-d9006fb04c37444226a867b64c14cb4cfe830610.tar.lz
bukkit-d9006fb04c37444226a867b64c14cb4cfe830610.tar.xz
bukkit-d9006fb04c37444226a867b64c14cb4cfe830610.zip
Expand EnderSignal API
-rw-r--r--src/main/java/org/bukkit/entity/EnderSignal.java57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/entity/EnderSignal.java b/src/main/java/org/bukkit/entity/EnderSignal.java
index 3d2d76cf..8e2723f8 100644
--- a/src/main/java/org/bukkit/entity/EnderSignal.java
+++ b/src/main/java/org/bukkit/entity/EnderSignal.java
@@ -1,9 +1,62 @@
package org.bukkit.entity;
+import org.bukkit.Location;
+
/**
- * Represents an Ender Signal, which is often created upon throwing an ender
- * eye
+ * Represents an EnderSignal, which is created upon throwing an ender eye.
*/
public interface EnderSignal extends Entity {
+ /**
+ * Get the location this EnderSignal is moving towards.
+ *
+ * @return the {@link Location} this EnderSignal is moving towards.
+ */
+ public Location getTargetLocation();
+
+ /**
+ * Set the {@link Location} this EnderSignal is moving towards.
+ * <br>
+ * When setting a new target location, the {@link #getDropItem()} resets to
+ * a random value and the despawn timer gets set back to 0.
+ *
+ * @param location the new target location
+ */
+ public void setTargetLocation(Location location);
+
+ /**
+ * Gets if the EnderSignal should drop an item on death.<br>
+ * If {@code true}, it will drop an item. If {@code false}, it will shatter.
+ *
+ * @return true if the EnderSignal will drop an item on death, or false if
+ * it will shatter
+ */
+ public boolean getDropItem();
+
+ /**
+ * Sets if the EnderSignal should drop an item on death; or if it should
+ * shatter.
+ *
+ * @param drop true if the EnderSignal should drop an item on death, or
+ * false if it should shatter.
+ */
+ public void setDropItem(boolean drop);
+
+ /**
+ * Gets the amount of time this entity has been alive (in ticks).
+ * <br>
+ * When this number is greater than 80, it will despawn on the next tick.
+ *
+ * @return the number of ticks this EnderSignal has been alive.
+ */
+ public int getDespawnTimer();
+
+ /**
+ * Set how long this entity has been alive (in ticks).
+ * <br>
+ * When this number is greater than 80, it will despawn on the next tick.
+ *
+ * @param timer how long (in ticks) this EnderSignal has been alive.
+ */
+ public void setDespawnTimer(int timer);
}