2014-07-25 03:21:57 +00:00
|
|
|
From 141d19426334270c18b49625a291185a7d542b36 Mon Sep 17 00:00:00 2001
|
2014-07-03 05:57:36 +00:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-07-25 03:21:57 +00:00
|
|
|
Date: Thu, 24 Jul 2014 22:19:44 -0500
|
2014-07-11 13:17:54 +00:00
|
|
|
Subject: [PATCH] Toggle for player interact limiter
|
2014-07-03 05:57:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-07-25 03:21:57 +00:00
|
|
|
index cd4f0c9..43c2278 100644
|
2014-07-03 05:57:36 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
@@ -59,6 +59,8 @@ import org.bukkit.inventory.InventoryView;
|
|
|
|
import org.bukkit.util.NumberConversions;
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
+import org.github.paperspigot.PaperSpigotConfig; // PaperSpigot
|
|
|
|
+
|
|
|
|
public class PlayerConnection implements PacketPlayInListener {
|
|
|
|
|
|
|
|
private static final Logger c = LogManager.getLogger();
|
2014-07-25 03:21:57 +00:00
|
|
|
@@ -580,7 +582,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
2014-07-03 05:57:36 +00:00
|
|
|
|
|
|
|
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
|
|
|
boolean throttled = false;
|
2014-07-25 03:21:57 +00:00
|
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
|
|
+ if (PaperSpigotConfig.interactLimitEnabled && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
2014-07-03 05:57:36 +00:00
|
|
|
throttled = true;
|
2014-07-25 03:21:57 +00:00
|
|
|
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
|
2014-07-03 05:57:36 +00:00
|
|
|
{
|
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
2014-07-13 00:38:57 +00:00
|
|
|
index f7dc787..ec800c3 100644
|
2014-07-03 05:57:36 +00:00
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
2014-07-13 00:38:57 +00:00
|
|
|
@@ -140,4 +140,10 @@ public class PaperSpigotConfig
|
2014-07-03 05:57:36 +00:00
|
|
|
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
2014-07-11 13:17:54 +00:00
|
|
|
+ public static boolean interactLimitEnabled;
|
|
|
|
+ private static void interactLimitEnabled()
|
2014-07-03 05:57:36 +00:00
|
|
|
+ {
|
2014-07-11 13:17:54 +00:00
|
|
|
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
|
2014-07-03 05:57:36 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|