mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
30f02fe6e5
I think its pretty clear that no one uses this given that it didn't work at all before
41 lines
1.9 KiB
Diff
41 lines
1.9 KiB
Diff
From ce52d5924a508126ad400c493de30523f6eb535a Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Tue, 1 Mar 2016 13:31:05 -0600
|
|
Subject: [PATCH] Toggle for player interact limiter
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
index dca7763..0ffa733 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -119,4 +119,12 @@ public class PaperConfig {
|
|
config.addDefault(path, def);
|
|
return config.getString(path, config.getString(path));
|
|
}
|
|
+
|
|
+ public static boolean useInteractLimiter;
|
|
+ private static void useInteractLimiter() {
|
|
+ useInteractLimiter = getBoolean("settings.limit-player-interactions", true);
|
|
+ if (!useInteractLimiter) {
|
|
+ Bukkit.getLogger().log(Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users");
|
|
+ }
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
index 39ba550..cbffd19 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -912,7 +912,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
|
this.player.resetIdleTimer();
|
|
// Spigot start
|
|
boolean throttled = false;
|
|
- if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
+ // Paper - Allow disabling interact limiter
|
|
+ if (com.destroystokyo.paper.PaperConfig.useInteractLimiter && lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) {
|
|
throttled = true;
|
|
} else if ( packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1 )
|
|
{
|
|
--
|
|
2.7.2
|
|
|