2015-04-16 20:38:30 +00:00
|
|
|
From db1b915f951ff35bab79eaf4791d064c2323c0ad Mon Sep 17 00:00:00 2001
|
2015-01-29 21:25:50 +00:00
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
2015-03-08 01:16:09 +00:00
|
|
|
Date: Sat, 7 Mar 2015 21:07:10 -0600
|
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
|
2015-04-16 20:38:30 +00:00
|
|
|
index 5f3884a..efd6241 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
|
2015-04-16 20:38:30 +00:00
|
|
|
@@ -636,7 +636,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
2014-11-28 01:17:45 +00:00
|
|
|
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.u());
|
|
|
|
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
2014-07-03 05:57:36 +00:00
|
|
|
boolean throttled = false;
|
2014-07-25 03:21:57 +00:00
|
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
2014-08-05 23:45:22 +00:00
|
|
|
+ // PaperSpigot - Allow disabling the player interaction limiter
|
|
|
|
+ if (org.github.paperspigot.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
|
2015-03-08 01:16:09 +00:00
|
|
|
index bff794a..02c4004 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
|
2015-03-08 01:16:09 +00:00
|
|
|
@@ -153,4 +153,14 @@ public class PaperSpigotConfig
|
|
|
|
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this is not recommended and may cause issues" );
|
2014-07-03 05:57:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
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 );
|
2015-03-08 01:16:09 +00:00
|
|
|
+ if ( !interactLimitEnabled )
|
|
|
|
+ {
|
2014-08-05 23:45:22 +00:00
|
|
|
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
|
|
|
|
+ }
|
2014-07-03 05:57:36 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-04-16 20:38:30 +00:00
|
|
|
1.9.1
|
2014-07-03 05:57:36 +00:00
|
|
|
|