summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-02 09:38:44 +1000
committermd_5 <git@md-5.net>2018-08-02 09:38:44 +1000
commitcab9d86f6ccc8399010c0eac9d7986f55b4d8f23 (patch)
tree5b984c1f9bb5222b4ebbc233ac4b3c5087ad99e6
parent9415c3ea9118ee700ca32b819cb40cfeb016bb6a (diff)
downloadbukkit-cab9d86f6ccc8399010c0eac9d7986f55b4d8f23.tar
bukkit-cab9d86f6ccc8399010c0eac9d7986f55b4d8f23.tar.gz
bukkit-cab9d86f6ccc8399010c0eac9d7986f55b4d8f23.tar.lz
bukkit-cab9d86f6ccc8399010c0eac9d7986f55b4d8f23.tar.xz
bukkit-cab9d86f6ccc8399010c0eac9d7986f55b4d8f23.zip
SPIGOT-4199: Riptide related APIs
-rw-r--r--src/main/java/org/bukkit/entity/LivingEntity.java9
-rw-r--r--src/main/java/org/bukkit/event/player/PlayerRiptideEvent.java46
2 files changed, 55 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 97c2172b..9e05f913 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -342,6 +342,15 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
public void setSwimming(boolean swimming);
/**
+ * Checks to see if an entity is currently using the Riptide enchantment.
+ *
+ * @return True if this entity is currently riptiding.
+ * @deprecated draft API
+ */
+ @Deprecated
+ public boolean isRiptiding();
+
+ /**
* Sets whether an entity will have AI.
*
* @param ai whether the mob will have AI or not.
diff --git a/src/main/java/org/bukkit/event/player/PlayerRiptideEvent.java b/src/main/java/org/bukkit/event/player/PlayerRiptideEvent.java
new file mode 100644
index 00000000..57f69c9e
--- /dev/null
+++ b/src/main/java/org/bukkit/event/player/PlayerRiptideEvent.java
@@ -0,0 +1,46 @@
+package org.bukkit.event.player;
+
+import org.bukkit.Warning;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.inventory.ItemStack;
+
+/**
+ * This event is fired when the player activates the riptide enchantment, using
+ * their trident to propel them through the air.
+ * <br>
+ * N.B. the riptide action is currently performed client side, so manipulating
+ * the player in this event may have undesired effects
+ *
+ * @deprecated draft API
+ */
+@Deprecated
+@Warning(false)
+public class PlayerRiptideEvent extends PlayerEvent {
+
+ private static final HandlerList handlers = new HandlerList();
+ private final ItemStack item;
+
+ public PlayerRiptideEvent(final Player who, final ItemStack item) {
+ super(who);
+ this.item = item;
+ }
+
+ /**
+ * Gets the item containing the used enchantment.
+ *
+ * @return held enchanted item
+ */
+ public ItemStack getItem() {
+ return item;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}