Yatopia/patches/server/0008-EMC-MovedTooQuickly-event.patch

30 lines
1.5 KiB
Diff
Raw Normal View History

2020-05-19 00:10:42 +02:00
From 590cd93be05350962a3c1423796a1521c5d4450a Mon Sep 17 00:00:00 2001
2020-02-26 20:12:29 +01:00
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Sep 2013 22:01:47 -0400
Subject: [PATCH] EMC MovedTooQuickly event
also make creative immune to this event
---
src/main/java/net/minecraft/server/PlayerConnection.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
2020-05-19 00:10:42 +02:00
index ecf7a8c6d9..64d5136346 100644
2020-02-26 20:12:29 +01:00
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2020-05-19 00:10:42 +02:00
@@ -1045,9 +1045,11 @@ public class PlayerConnection implements PacketListenerPlayIn {
2020-02-26 20:12:29 +01:00
if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) {
// CraftBukkit end
+ if (new com.empireminecraft.customevents.MovedTooQuicklyEvent(d10, getPlayer()).callEvent()) { // EMC
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
this.a(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch);
return;
+ } // EMC
}
}
--
2.25.1.windows.1