Skip to content

Commit

Permalink
Disable packet limit
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jul 19, 2023
1 parent 6d7b7cf commit e83d578
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
9 changes: 7 additions & 2 deletions patches/server/0004-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ index 35d2da9d91dcdd89de7c0f4af028fd182376ea8d..d73482fb1e71fe2951e96ae0593de268
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..d1a6bd01cb03424e0bdac98127dada77b3d11ea2
index 0000000000000000000000000000000000000000..5ca9ffe8747ef9e8bd2936402e2f7201ec3a5762
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,881 @@
@@ -0,0 +1,886 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -838,6 +838,11 @@ index 0000000000000000000000000000000000000000..d1a6bd01cb03424e0bdac98127dada77
+ optimizeNoiseGeneration = getBoolean("settings.performance.optimize-noise-generation", optimizeNoiseGeneration);
+ }
+
+ public static boolean disablePacketLimit = false;
+ private static void disablePacketLimit() {
+ disablePacketLimit = getBoolean("settings.modify.disable-packet-limit", disablePacketLimit);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;
Expand Down
19 changes: 19 additions & 0 deletions patches/server/0098-Disable-packet-limit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <[email protected]>
Date: Wed, 19 Jul 2023 19:59:58 +0800
Subject: [PATCH] Disable packet limit


diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index cacd808f1d03c9729bcf2110bffceb940c0e11c0..adebf345e433904ab095fe40eb3053e9512c7d8f 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -204,7 +204,7 @@ public class GlobalConfiguration extends ConfigurationPart {
}

public boolean isEnabled() {
- return this.interval > 0.0 && this.maxPacketRate > 0.0;
+ return !top.leavesmc.leaves.LeavesConfig.disablePacketLimit && (this.interval > 0.0 && this.maxPacketRate > 0.0); // Leaves - disable packet limit
}

public enum ViolateAction {

0 comments on commit e83d578

Please sign in to comment.