Update documentation around PlayerJumpEvent

This commit is contained in:
Zach Brown 2017-09-29 14:58:24 -04:00
parent 7b9c5a7c49
commit a8c503b86f
3 changed files with 27 additions and 11 deletions

View file

@ -1,4 +1,4 @@
From d1874a92aadb4b6161c2b49276cd76740cc30919 Mon Sep 17 00:00:00 2001
From e35607cf3ee0d7905ad75771762bc290f16cc359 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 28 Sep 2017 17:21:32 -0400
Subject: [PATCH] Add PlayerJumpEvent
@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java
new file mode 100644
index 00000000..1ea9c65f
index 00000000..dd24f9b0
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java
@@ -0,0 +1,97 @@
@@ -0,0 +1,101 @@
+package com.destroystokyo.paper.event.player;
+
+import com.google.common.base.Preconditions;
@ -20,7 +20,11 @@ index 00000000..1ea9c65f
+import org.bukkit.event.player.PlayerEvent;
+
+/**
+ * Holds information for player jump events
+ * Called when the server detects the player is jumping.
+ * <p>
+ * Added to avoid the overhead and special case logic that many plugins use
+ * when checking for jumps via PlayerMoveEvent, this event is fired whenever
+ * the server detects that the player is jumping.
+ */
+public class PlayerJumpEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
@ -95,7 +99,7 @@ index 00000000..1ea9c65f
+
+ private void validateLocation(Location loc) {
+ Preconditions.checkArgument(loc != null, "Cannot use null location!");
+ Preconditions.checkArgument(loc.getWorld() != null, "Cannot use null location with null world!");
+ Preconditions.checkArgument(loc.getWorld() != null, "Cannot use location with null world!");
+ }
+
+ @Override