Paper 1.9
This commit is contained in:
@@ -1,40 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
||||
Date: Sat, 7 Mar 2015 21:07:10 -0600
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.u());
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
this.player.resetIdleTimer();
|
||||
// Spigot start
|
||||
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) {
|
||||
+ // 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 )
|
||||
{
|
||||
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
||||
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
|
||||
@@ -0,0 +0,0 @@ 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 );
|
||||
+ if ( !interactLimitEnabled )
|
||||
+ {
|
||||
+ Bukkit.getLogger().log( Level.INFO, "Disabling player interaction limiter, your server may be more vulnerable to malicious users" );
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user