From 42e3c45e2ab734d4d22081e4f19dc594d7a7d621 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 11 Jul 2014 08:17:00 -0500 Subject: [PATCH] Toggle for player interact limiter diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 4f7da33..1657c7c 100644 --- 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(); @@ -578,7 +580,7 @@ public class PlayerConnection implements PacketPlayInListener { public void a(PacketPlayInBlockPlace packetplayinblockplace) { boolean throttled = false; - if (lastPlace != -1 && MinecraftServer.currentTick - lastPlace < 1) { + if (lastPlace != -1 && MinecraftServer.currentTick - lastPlace < 1 && PaperSpigotConfig.interactLimitEnabled) { // PaperSpigot - Allow interact limit to be disabled throttled = true; } else { diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java index 3131c30..092b3d8 100644 --- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java @@ -129,4 +129,10 @@ public class PaperSpigotConfig Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" ); } } + + public static boolean interactLimitEnabled; + private static void interactLimitEnabled() + { + interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true ); + } } -- 1.9.1