PaperMC/Spigot-Server-Patches/0012-Toggle-for-player-interact-limiter.patch

43 lines
2.2 KiB
Diff
Raw Normal View History

From 0c1371c36a93de12180683ee8c33bb9fb8d61cec Mon Sep 17 00:00:00 2001
2015-01-29 22:25:50 +01:00
From: Zach Brown <zach.brown@destroystokyo.com>
2015-03-08 02:16:09 +01:00
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
2015-07-26 01:00:37 +02:00
index 68358e9..7ea74c0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2015-07-26 01:00:37 +02:00
@@ -661,7 +661,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
2014-11-28 02:17:45 +01:00
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) {
2014-08-06 01:45:22 +02:00
+ // 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 85ee51b..b0dd5b0 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -144,4 +144,14 @@ public class PaperSpigotConfig
{
babyZombieMovementSpeed = getDouble( "settings.baby-zombie-movement-speed", 0.5D ); // Player moves at 0.1F, for reference
}
+
+ public static boolean interactLimitEnabled;
+ private static void interactLimitEnabled()
+ {
+ interactLimitEnabled = getBoolean( "settings.limit-player-interactions", true );
2015-03-08 02:16:09 +01:00
+ if ( !interactLimitEnabled )
+ {
2014-08-06 01:45:22 +02:00
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
+ }
+ }
}
--
2.5.1