2014-10-25 03:25:14 +00:00
|
|
|
From d9da9e413d37e05c22ac1568c4ac65ad9df12b20 Mon Sep 17 00:00:00 2001
|
2014-07-03 05:57:36 +00:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-08-05 23:45:22 +00:00
|
|
|
Date: Tue, 5 Aug 2014 17:56:02 -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-10-25 03:25:14 +00:00
|
|
|
index 10faa8c..26ce4ed 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
|
2014-08-24 07:40:45 +00:00
|
|
|
@@ -581,7 +581,8 @@ 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) {
|
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
|
2014-08-05 23:45:22 +00:00
|
|
|
index 2cc159b..25a94a6 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-08-05 23:45:22 +00:00
|
|
|
@@ -152,4 +152,13 @@ public class PaperSpigotConfig
|
|
|
|
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this may be bad depending on your plugins" );
|
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 );
|
2014-08-05 23:45:22 +00:00
|
|
|
+ if (!interactLimitEnabled) {
|
|
|
|
+ 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
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|