mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
3da6be053f
Provides an API to control the loot table for an object. Also provides a feature that any Lootable Inventory (Chests in Structures) can automatically replenish after a given time. This feature is good for long term worlds so that newer players do not suffer with "Every chest has been looted" API and Event added to control the Auto Replenish feature for players.
38 lines
No EOL
2.1 KiB
Diff
38 lines
No EOL
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <1254957+zachbr@users.noreply.github.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 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 {
|
|
" - Interval: " + timeSummary(Timings.getHistoryInterval() / 20) +
|
|
" - Length: " + timeSummary(Timings.getHistoryLength() / 20));
|
|
}
|
|
+
|
|
+ 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, 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 )
|
|
{
|
|
--
|