2014-07-06 03:55:30 +00:00
|
|
|
From 93a0fc4b68a3803e2206b098f81b7d183c1e4e44 Mon Sep 17 00:00:00 2001
|
2014-07-03 05:57:36 +00:00
|
|
|
From: Zach Brown <Zbob750@live.com>
|
|
|
|
Date: Thu, 3 Jul 2014 00:53:47 -0500
|
|
|
|
Subject: [PATCH] Configurable interaction limit restriction
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2014-07-06 03:55:30 +00:00
|
|
|
index baa89ef..d5f3b7b 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-06 03:55:30 +00:00
|
|
|
@@ -570,7 +572,7 @@ public class PlayerConnection implements PacketPlayInListener {
|
2014-07-03 05:57:36 +00:00
|
|
|
|
|
|
|
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
|
|
|
|
boolean throttled = false;
|
|
|
|
- if (lastPlace != -1 && MinecraftServer.currentTick - lastPlace < 2) {
|
|
|
|
+ if (lastPlace != -1 && MinecraftServer.currentTick - lastPlace < PaperSpigotConfig.interactLimit) { // PaperSpigot - Configurable interaction limit restriction
|
|
|
|
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..7bda065 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 int interactLimit;
|
|
|
|
+ private static void interactLimit()
|
|
|
|
+ {
|
|
|
|
+ interactLimit = getInt( "settings.player-interaction-limit", 2 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|