From 0969fa97c6013c56c7d0734e60392c59c17edf03 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 15 Mar 2015 22:09:27 +0000 Subject: [PATCH] SPIGOT-709: Extend the block place limit to arm swings --- ...-block-placement-interaction-packets.patch | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/CraftBukkit-Patches/0125-Limit-block-placement-interaction-packets.patch b/CraftBukkit-Patches/0125-Limit-block-placement-interaction-packets.patch index de4fcd06b5..65accfcf1f 100644 --- a/CraftBukkit-Patches/0125-Limit-block-placement-interaction-packets.patch +++ b/CraftBukkit-Patches/0125-Limit-block-placement-interaction-packets.patch @@ -1,11 +1,11 @@ -From 60bb367ecd43ae6099214c05bca623be2088ff5e Mon Sep 17 00:00:00 2001 +From bbc82ac5ec6cf152414fa0b8e7ccd080535cc993 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 29 Jun 2014 21:10:34 +0100 Subject: [PATCH] Limit block placement/interaction packets diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ee6fa34..b4b3cbc 100644 +index ee6fa34..d63c65d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -626,10 +626,23 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList @@ -61,6 +61,26 @@ index ee6fa34..b4b3cbc 100644 } flag = true; +@@ -1130,6 +1146,19 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList + public void a(PacketPlayInArmAnimation packetplayinarmanimation) { + if (this.player.dead) return; // CraftBukkit + PlayerConnectionUtils.ensureMainThread(packetplayinarmanimation, this, this.player.u()); ++ // Spigot start ++ boolean throttled = false; ++ if (lastPlace != -1 && packetplayinarmanimation.timestamp - lastPlace < 30 && packets++ >= 4) { ++ throttled = true; ++ } else if ( packetplayinarmanimation.timestamp - lastPlace >= 30 || lastPlace == -1 ) ++ { ++ lastPlace = packetplayinarmanimation.timestamp; ++ packets = 0; ++ } ++ if (throttled) { ++ return; ++ } ++ // Spigot end + this.player.z(); + // CraftBukkit start - Raytrace to look for 'rogue armswings' + float f1 = this.player.pitch; -- 2.1.0