43 Zeilen
2.2 KiB
Diff
43 Zeilen
2.2 KiB
Diff
From 4793f39be57f4440a7346ef536a1eaffe51ab9b7 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Sat, 7 Mar 2015 21:07:10 -0600
|
|
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 b639293..56cd3c9 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -660,7 +660,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
|
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.u());
|
|
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
|
boolean throttled = false;
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
+ // PaperSpigot - Allow disabling the player interaction limiter
|
|
+ if (org.github.paperspigot.PaperSpigotConfig.interactLimitEnabled && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
throttled = true;
|
|
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
|
|
{
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
|
index ae3d107..ae410b6 100644
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
|
@@ -154,4 +154,14 @@ public class PaperSpigotConfig
|
|
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this is not recommended and may cause issues" );
|
|
}
|
|
}
|
|
+
|
|
+ public static boolean interactLimitEnabled;
|
|
+ private static void interactLimitEnabled()
|
|
+ {
|
|
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
|
|
+ if ( !interactLimitEnabled )
|
|
+ {
|
|
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
|
|
+ }
|
|
+ }
|
|
}
|
|
--
|
|
1.9.5.msysgit.1
|
|
|