2015-07-23 18:56:24 +02:00
|
|
|
From cf879d7842c571b6c0ce3918a4619aa4f7247650 Mon Sep 17 00:00:00 2001
|
2015-07-23 13:30:13 +02:00
|
|
|
From: Techcable <Techcable@outlook.com>
|
|
|
|
Date: Thu, 23 Jul 2015 03:19:57 -0700
|
|
|
|
Subject: [PATCH] Add PlayerMicroMoveEvent
|
|
|
|
|
|
|
|
|
2015-07-23 18:56:24 +02:00
|
|
|
diff --git a/src/main/java/org/github/paperspigot/event/player/PlayerMicroMoveEvent.java b/src/main/java/org/github/paperspigot/event/player/PlayerMicroMoveEvent.java
|
2015-07-23 13:30:13 +02:00
|
|
|
new file mode 100644
|
2015-07-23 18:56:24 +02:00
|
|
|
index 0000000..65b56d8
|
2015-07-23 13:30:13 +02:00
|
|
|
--- /dev/null
|
2015-07-23 18:56:24 +02:00
|
|
|
+++ b/src/main/java/org/github/paperspigot/event/player/PlayerMicroMoveEvent.java
|
2015-07-23 13:30:13 +02:00
|
|
|
@@ -0,0 +1,32 @@
|
2015-07-23 18:56:24 +02:00
|
|
|
+package org.github.paperspigot.event.player;
|
2015-07-23 13:30:13 +02:00
|
|
|
+
|
|
|
|
+import org.bukkit.Location;
|
|
|
|
+import org.bukkit.entity.Player;
|
|
|
|
+import org.bukkit.event.HandlerList;
|
|
|
|
+import org.bukkit.event.player.PlayerMoveEvent;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * This event is fired for player movements that are too small to track with PlayerMoveEvent.
|
|
|
|
+ *
|
|
|
|
+ * When used in combination with PlayerMoveEvent, it is possible to keep track of all
|
|
|
|
+ * PacketPlayInFlying movements. This can be particularly useful for anti-cheat plugins.
|
|
|
|
+ *
|
|
|
|
+ * Please note this event is not intended for casual use. Plugins that casually use this event
|
|
|
|
+ * may cause significant overhead depending on handler logic.
|
|
|
|
+ */
|
|
|
|
+public class PlayerMicroMoveEvent extends PlayerMoveEvent {
|
|
|
|
+ private static final HandlerList handlerList = new HandlerList();
|
|
|
|
+
|
|
|
|
+ public PlayerMicroMoveEvent(Player player, Location from, Location to) {
|
|
|
|
+ super(player, from, to);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public HandlerList getHandlers() {
|
|
|
|
+ return getHandlerList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static HandlerList getHandlerList() {
|
|
|
|
+ return handlerList;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
--
|
|
|
|
1.9.5.msysgit.1
|
|
|
|
|