2014-07-16 21:11:44 +02:00
|
|
|
From 89d24e2d915b377efa206cdbca29a7e7d6c23c6f Mon Sep 17 00:00:00 2001
|
2014-07-03 07:57:36 +02:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
2014-07-16 21:11:44 +02:00
|
|
|
Date: Wed, 16 Jul 2014 14:11:08 -0500
|
2014-07-11 15:17:54 +02:00
|
|
|
Subject: [PATCH] Toggle for player interact limiter
|
2014-07-03 07:57:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-07-16 21:11:44 +02:00
|
|
|
index 9a7b256..dd63b9f 100644
|
2014-07-03 07:57:36 +02: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-09 05:05:35 +02:00
|
|
|
@@ -578,7 +580,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
2014-07-03 07:57:36 +02:00
|
|
|
|
|
|
|
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
|
|
|
boolean throttled = false;
|
2014-07-16 21:11:44 +02:00
|
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 5) {
|
|
|
|
+ if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 5 && PaperSpigotConfig.interactLimitEnabled) {
|
2014-07-03 07:57:36 +02:00
|
|
|
throttled = true;
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
2014-07-13 02:38:57 +02:00
|
|
|
index f7dc787..ec800c3 100644
|
2014-07-03 07:57:36 +02:00
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
2014-07-13 02:38:57 +02:00
|
|
|
@@ -140,4 +140,10 @@ public class PaperSpigotConfig
|
2014-07-03 07:57:36 +02:00
|
|
|
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+
|
2014-07-11 15:17:54 +02:00
|
|
|
+ public static boolean interactLimitEnabled;
|
|
|
|
+ private static void interactLimitEnabled()
|
2014-07-03 07:57:36 +02:00
|
|
|
+ {
|
2014-07-11 15:17:54 +02:00
|
|
|
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
|
2014-07-03 07:57:36 +02:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|