mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Format Leaf config
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Leaf Config
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index bb7ecba3612a77191d26a3da2a3609748860b540..b19fa7a84f97abb995143de14302658bf22b2904 100644
|
||||
index 6e68916e8db5819a56c2696ebf5f1742df7119f8..c745122af630d0f79bed7f0c03baa66eeb2e5da0 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -49,6 +49,13 @@ dependencies {
|
||||
@@ -64,7 +64,7 @@ index 1141b3a88e2eb1baa705b4f781353df0305a7c85..b104a38d2c879b649a3862876c389564
|
||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..770553ef8976d76067396276792ea23a7ab7d51d
|
||||
index 0000000000000000000000000000000000000000..309391c1da5ed895e9bf16361ec78944801a22d3
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -0,0 +1,139 @@
|
||||
@@ -120,10 +120,10 @@ index 0000000000000000000000000000000000000000..770553ef8976d76067396276792ea23a
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ getString("info.version", "1.0");
|
||||
+ getString("info.version", "1.1");
|
||||
+ setComment("info",
|
||||
+ "Leaf Config",
|
||||
+ "Github Repo: https://github.com/Dreeam-qwq/Leaf",
|
||||
+ "Github Repo: https://github.com/Winds-Studio/Leaf",
|
||||
+ "Discord: Dreeam#0851 | QQ: 2682173972");
|
||||
+
|
||||
+ for (Method method : LeafConfig.class.getDeclaredMethods()) {
|
||||
@@ -204,6 +204,6 @@ index 0000000000000000000000000000000000000000..770553ef8976d76067396276792ea23a
|
||||
+
|
||||
+ public static String serverModName = "Leaf";
|
||||
+ private static void serverModName() {
|
||||
+ serverModName = getString("settings.server-mod-name", serverModName);
|
||||
+ serverModName = getString("server-mod-name", serverModName);
|
||||
+ }
|
||||
+}
|
||||
|
||||
@@ -30,24 +30,23 @@ index 9b924f0793d8231244c160a5bc7ac8e1a35bad34..e9718dff0e81b474eebded583da6f47d
|
||||
ServerLoginPacketListenerImpl.this.disconnect("Failed to verify username!");
|
||||
return;
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 770553ef8976d76067396276792ea23a7ab7d51d..7870c85030144831936d692dde4fff7bedd692da 100644
|
||||
index 309391c1da5ed895e9bf16361ec78944801a22d3..434e3de4872a660725cf0bd462c97383f6915ed1 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -132,8 +132,17 @@ public class LeafConfig {
|
||||
@@ -132,8 +132,16 @@ public class LeafConfig {
|
||||
return config.getStringList(key);
|
||||
}
|
||||
|
||||
+
|
||||
public static String serverModName = "Leaf";
|
||||
private static void serverModName() {
|
||||
serverModName = getString("settings.server-mod-name", serverModName);
|
||||
serverModName = getString("server-mod-name", serverModName);
|
||||
}
|
||||
+
|
||||
+ public static boolean removeMojangUsernameCheck;
|
||||
+ private static void removeconfig() {
|
||||
+ removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", true,
|
||||
+ public static boolean removeMojangUsernameCheck = true;
|
||||
+ private static void removeConfig() {
|
||||
+ removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", removeMojangUsernameCheck,
|
||||
+ "Remove username check of Mojang",
|
||||
+ "enabling all characters as username");
|
||||
+
|
||||
+ }
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Remove Spigot Check for Broken BungeeCord Configurations
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index 8e68d1373a519cc12bf83de6aadcb24cbbd34af6..a5776ef739b1bf8c8efed0a97d0939e271c8ba72 100644
|
||||
index 8e68d1373a519cc12bf83de6aadcb24cbbd34af6..4b07c53efffff8c8c88e13c0c890eff8bc55c4f4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.network.protocol.handshake.ClientIntentionPacket;
|
||||
@@ -16,39 +16,36 @@ index 8e68d1373a519cc12bf83de6aadcb24cbbd34af6..a5776ef739b1bf8c8efed0a97d0939e2
|
||||
|
||||
// CraftBukkit start
|
||||
import java.net.InetAddress;
|
||||
@@ -135,7 +136,9 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -135,7 +136,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
{
|
||||
connection.spoofedProfile = ServerHandshakePacketListenerImpl.gson.fromJson(split[3], com.mojang.authlib.properties.Property[].class);
|
||||
}
|
||||
- } else if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) {
|
||||
+ // Leaf start - Remove Spigot check for broken BungeeCord configurations
|
||||
+ } else if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) && !(LeafConfig.removeSpigotCheckBungeeConfig)) {
|
||||
+ // Leaf end - Remove Spigot check for broken BungeeCord configurations
|
||||
+ } else if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) && !(LeafConfig.removeSpigotCheckBungeeConfig)) { // Leaf - Remove Spigot check for broken BungeeCord configurations
|
||||
Component chatmessage = Component.literal("Unknown data in login hostname, did you forget to enable BungeeCord in spigot.yml?");
|
||||
this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
|
||||
this.connection.disconnect(chatmessage);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 7870c85030144831936d692dde4fff7bedd692da..c107a0cab333b2b57931862073a4eb6832f755ab 100644
|
||||
index 434e3de4872a660725cf0bd462c97383f6915ed1..20ea046501763954eb97045d33101e6b043bc84d 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -132,17 +132,19 @@ public class LeafConfig {
|
||||
@@ -132,16 +132,19 @@ public class LeafConfig {
|
||||
return config.getStringList(key);
|
||||
}
|
||||
|
||||
-
|
||||
public static String serverModName = "Leaf";
|
||||
private static void serverModName() {
|
||||
serverModName = getString("settings.server-mod-name", serverModName);
|
||||
serverModName = getString("server-mod-name", serverModName);
|
||||
}
|
||||
|
||||
public static boolean removeMojangUsernameCheck;
|
||||
+ public static boolean removeSpigotCheckBungeeConfig;
|
||||
private static void removeconfig() {
|
||||
removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", true,
|
||||
public static boolean removeMojangUsernameCheck = true;
|
||||
+ public static boolean removeSpigotCheckBungeeConfig = true;
|
||||
private static void removeConfig() {
|
||||
removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", removeMojangUsernameCheck,
|
||||
"Remove username check of Mojang",
|
||||
"enabling all characters as username");
|
||||
-
|
||||
+ removeSpigotCheckBungeeConfig = getBoolean("remove-Spigot-check-bungee-config", true,
|
||||
+ removeSpigotCheckBungeeConfig = getBoolean("remove-Spigot-check-bungee-config", removeSpigotCheckBungeeConfig,
|
||||
+ "Enable player enter backend server through proxy",
|
||||
+ "without backend server enabling its bungee mode");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ This Check is added in 1.17.x -> 1.18.x update by Mojang.
|
||||
By removing this check, it enable hackers to use some modules of hack clients.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 93a533bdeb5108f5c3e758f8062de083283fd075..5a656751b101d914afd5b07d70e60b50009ed215 100644
|
||||
index 8fd2a0a9f3990742c17d471b143c672163eb76aa..7b1368372b6c167638da18b16803d81cc38e238e 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -188,6 +188,7 @@ import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions;
|
||||
@@ -28,23 +28,22 @@ index 93a533bdeb5108f5c3e758f8062de083283fd075..5a656751b101d914afd5b07d70e60b50
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index c107a0cab333b2b57931862073a4eb6832f755ab..a221affdf87d28991248a4b83224194e222423e6 100644
|
||||
index 20ea046501763954eb97045d33101e6b043bc84d..d1e7e1163db58feb4e0ab41115bd5f3d5c0d0e39 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -139,6 +139,8 @@ public class LeafConfig {
|
||||
@@ -139,6 +139,7 @@ public class LeafConfig {
|
||||
|
||||
public static boolean removeMojangUsernameCheck;
|
||||
public static boolean removeSpigotCheckBungeeConfig;
|
||||
+ public static boolean removeUseItemOnPacketTooFar;
|
||||
+
|
||||
private static void removeconfig() {
|
||||
removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", true,
|
||||
public static boolean removeMojangUsernameCheck = true;
|
||||
public static boolean removeSpigotCheckBungeeConfig = true;
|
||||
+ public static boolean removeUseItemOnPacketTooFar = false;
|
||||
private static void removeConfig() {
|
||||
removeMojangUsernameCheck = getBoolean("remove-Mojang-username-check", removeMojangUsernameCheck,
|
||||
"Remove username check of Mojang",
|
||||
@@ -146,5 +148,7 @@ public class LeafConfig {
|
||||
removeSpigotCheckBungeeConfig = getBoolean("remove-Spigot-check-bungee-config", true,
|
||||
@@ -146,5 +147,7 @@ public class LeafConfig {
|
||||
removeSpigotCheckBungeeConfig = getBoolean("remove-Spigot-check-bungee-config", removeSpigotCheckBungeeConfig,
|
||||
"Enable player enter backend server through proxy",
|
||||
"without backend server enabling its bungee mode");
|
||||
+ removeUseItemOnPacketTooFar = getBoolean("remove-UseItemOnPacket-too-far-check", false,
|
||||
+ "To enable this, players can use some packet modules with hack clients");
|
||||
+ removeUseItemOnPacketTooFar = getBoolean("remove-UseItemOnPacket-too-far-check", removeUseItemOnPacketTooFar,
|
||||
+ "To enable this, players can use some packet modules with hack clients");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ index 6035af2cf08353b3d3801220d8116d8611a0cd37..7774ab6a2e553a40def4bb4dceea9e5f
|
||||
final String commandName;
|
||||
if (vanillaCommand.getRedirect() == null) {
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index a221affdf87d28991248a4b83224194e222423e6..a0bd1ec3f09959c7f72b484658c1c94a16818281 100644
|
||||
index d1e7e1163db58feb4e0ab41115bd5f3d5c0d0e39..d65f0188f824ab9e79e0557c3796aa0098d84d7a 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -1,8 +1,10 @@
|
||||
@@ -196,20 +196,12 @@ index a221affdf87d28991248a4b83224194e222423e6..a0bd1ec3f09959c7f72b484658c1c94a
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.simpleyaml.configuration.comments.CommentType;
|
||||
import org.simpleyaml.configuration.file.YamlFile;
|
||||
@@ -149,6 +151,36 @@ public class LeafConfig {
|
||||
"Enable player enter backend server through proxy",
|
||||
"without backend server enabling its bungee mode");
|
||||
removeUseItemOnPacketTooFar = getBoolean("remove-UseItemOnPacket-too-far-check", false,
|
||||
- "To enable this, players can use some packet modules with hack clients");
|
||||
+ "To enable this, players can use some packet modules with hack clients");
|
||||
+ }
|
||||
+
|
||||
+ public static String tpsbarCommandOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
+
|
||||
+ private static void messages() {
|
||||
+ tpsbarCommandOutput = getString("settings.messages.tpsbar-command-output", tpsbarCommandOutput);
|
||||
+ }
|
||||
@@ -150,4 +152,30 @@ public class LeafConfig {
|
||||
removeUseItemOnPacketTooFar = getBoolean("remove-UseItemOnPacket-too-far-check", removeUseItemOnPacketTooFar,
|
||||
"To enable this, players can use some packet modules with hack clients");
|
||||
}
|
||||
+
|
||||
+ public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
+ public static String commandTPSBarTitle = "<gray>TPS<yellow>:</yellow> <tps> MSPT<yellow>:</yellow> <mspt> Ping<yellow>:</yellow> <ping>ms";
|
||||
+ public static BossBar.Overlay commandTPSBarProgressOverlay = BossBar.Overlay.NOTCHED_20;
|
||||
+ public static TPSBarTask.FillMode commandTPSBarProgressFillMode = TPSBarTask.FillMode.MSPT;
|
||||
@@ -222,21 +214,22 @@ index a221affdf87d28991248a4b83224194e222423e6..a0bd1ec3f09959c7f72b484658c1c94a
|
||||
+ public static int commandTPSBarTickInterval = 20;
|
||||
+
|
||||
+ private static void commandSettings() {
|
||||
+ commandTPSBarTitle = getString("settings.command.tpsbar.title", commandTPSBarTitle);
|
||||
+ commandTPSBarProgressOverlay = BossBar.Overlay.valueOf(getString("settings.command.tpsbar.overlay", commandTPSBarProgressOverlay.name()));
|
||||
+ commandTPSBarProgressFillMode = TPSBarTask.FillMode.valueOf(getString("settings.command.tpsbar.fill-mode", commandTPSBarProgressFillMode.name()));
|
||||
+ commandTPSBarProgressColorGood = BossBar.Color.valueOf(getString("settings.command.tpsbar.progress-color.good", commandTPSBarProgressColorGood.name()));
|
||||
+ commandTPSBarProgressColorMedium = BossBar.Color.valueOf(getString("settings.command.tpsbar.progress-color.medium", commandTPSBarProgressColorMedium.name()));
|
||||
+ commandTPSBarProgressColorLow = BossBar.Color.valueOf(getString("settings.command.tpsbar.progress-color.low", commandTPSBarProgressColorLow.name()));
|
||||
+ commandTPSBarTextColorGood = getString("settings.command.tpsbar.text-color.good", commandTPSBarTextColorGood);
|
||||
+ commandTPSBarTextColorMedium = getString("settings.command.tpsbar.text-color.medium", commandTPSBarTextColorMedium);
|
||||
+ commandTPSBarTextColorLow = getString("settings.command.tpsbar.text-color.low", commandTPSBarTextColorLow);
|
||||
+ commandTPSBarTickInterval = getInt("settings.command.tpsbar.tick-interval", commandTPSBarTickInterval);
|
||||
}
|
||||
+ commandTPSBarOutput = getString("command.messages.tpsbar-command-output", commandTPSBarOutput);
|
||||
+ commandTPSBarTitle = getString("command.tpsbar.title", commandTPSBarTitle);
|
||||
+ commandTPSBarProgressOverlay = BossBar.Overlay.valueOf(getString("command.tpsbar.overlay", commandTPSBarProgressOverlay.name()));
|
||||
+ commandTPSBarProgressFillMode = TPSBarTask.FillMode.valueOf(getString("command.tpsbar.fill-mode", commandTPSBarProgressFillMode.name()));
|
||||
+ commandTPSBarProgressColorGood = BossBar.Color.valueOf(getString("command.tpsbar.progress-color.good", commandTPSBarProgressColorGood.name()));
|
||||
+ commandTPSBarProgressColorMedium = BossBar.Color.valueOf(getString("command.tpsbar.progress-color.medium", commandTPSBarProgressColorMedium.name()));
|
||||
+ commandTPSBarProgressColorLow = BossBar.Color.valueOf(getString("command.tpsbar.progress-color.low", commandTPSBarProgressColorLow.name()));
|
||||
+ commandTPSBarTextColorGood = getString("command.tpsbar.text-color.good", commandTPSBarTextColorGood);
|
||||
+ commandTPSBarTextColorMedium = getString("command.tpsbar.text-color.medium", commandTPSBarTextColorMedium);
|
||||
+ commandTPSBarTextColorLow = getString("command.tpsbar.text-color.low", commandTPSBarTextColorLow);
|
||||
+ commandTPSBarTickInterval = getInt("command.tpsbar.tick-interval", commandTPSBarTickInterval);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/commands/TPSBarCommand.java b/src/main/java/org/dreeam/leaf/commands/TPSBarCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..60742c5ecc99aa18d7292bd6df5e80441b19745b
|
||||
index 0000000000000000000000000000000000000000..186f29924edd411c6327fb4b53b069e85a4e0e91
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/commands/TPSBarCommand.java
|
||||
@@ -0,0 +1,43 @@
|
||||
@@ -273,7 +266,7 @@ index 0000000000000000000000000000000000000000..60742c5ecc99aa18d7292bd6df5e8044
|
||||
+ boolean result = TPSBarTask.instance().togglePlayer(player.getBukkitEntity());
|
||||
+ player.tpsBar(result);
|
||||
+
|
||||
+ Component output = MiniMessage.miniMessage().deserialize(LeafConfig.tpsbarCommandOutput,
|
||||
+ Component output = MiniMessage.miniMessage().deserialize(LeafConfig.commandTPSBarOutput,
|
||||
+ Placeholder.component("onoff", Component.translatable(result ? "options.on" : "options.off")
|
||||
+ .color(result ? NamedTextColor.GREEN : NamedTextColor.RED)),
|
||||
+ Placeholder.parsed("target", player.getGameProfile().getName()));
|
||||
|
||||
@@ -19,7 +19,7 @@ index 0e8700ccc884957f08fa382723a3784d94da0f0e..66242833210ae89cbca7448cd4e7cf1f
|
||||
|
||||
if (environment.includeIntegrated) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 66082298aea31d17c8e9a85e3cca1951b2d53f87..d1fd3eb9e51ace68d3ffc24579cdf95ebdaea039 100644
|
||||
index 39a0bd651736c80cc558775d94794ee020c574a8..09667820e41ef9c4e3aef9e2c8d18eb6aa0bdc1e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -270,6 +270,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -61,10 +61,10 @@ index 66082298aea31d17c8e9a85e3cca1951b2d53f87..d1fd3eb9e51ace68d3ffc24579cdf95e
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index a0bd1ec3f09959c7f72b484658c1c94a16818281..e56151fe0dbc0c867dff728a55daa35c7714d3a6 100644
|
||||
index d65f0188f824ab9e79e0557c3796aa0098d84d7a..d0ef118ed2e934a3d8f9e4b0d93b2f68bfa28454 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -170,6 +170,11 @@ public class LeafConfig {
|
||||
@@ -164,6 +164,11 @@ public class LeafConfig {
|
||||
public static String commandTPSBarTextColorMedium = "<gradient:#ffff55:#ffaa00><text></gradient>";
|
||||
public static String commandTPSBarTextColorLow = "<gradient:#ff5555:#aa0000><text></gradient>";
|
||||
public static int commandTPSBarTickInterval = 20;
|
||||
@@ -75,22 +75,21 @@ index a0bd1ec3f09959c7f72b484658c1c94a16818281..e56151fe0dbc0c867dff728a55daa35c
|
||||
+ public static int commandCompassBarTickInterval = 5;
|
||||
|
||||
private static void commandSettings() {
|
||||
commandTPSBarTitle = getString("settings.command.tpsbar.title", commandTPSBarTitle);
|
||||
@@ -182,5 +187,17 @@ public class LeafConfig {
|
||||
commandTPSBarTextColorMedium = getString("settings.command.tpsbar.text-color.medium", commandTPSBarTextColorMedium);
|
||||
commandTPSBarTextColorLow = getString("settings.command.tpsbar.text-color.low", commandTPSBarTextColorLow);
|
||||
commandTPSBarTickInterval = getInt("settings.command.tpsbar.tick-interval", commandTPSBarTickInterval);
|
||||
+
|
||||
+ commandCompassBarTitle = getString("settings.command.compass.title", commandCompassBarTitle);
|
||||
+ commandCompassBarProgressOverlay = BossBar.Overlay.valueOf(getString("settings.command.compass.overlay", commandCompassBarProgressOverlay.name()));
|
||||
+ commandCompassBarProgressColor = BossBar.Color.valueOf(getString("settings.command.compass.progress-color", commandCompassBarProgressColor.name()));
|
||||
+ commandCompassBarProgressPercent = (float) getDouble("settings.command.compass.percent", commandCompassBarProgressPercent);
|
||||
+ commandCompassBarTickInterval = getInt("settings.command.compass.tick-interval", commandCompassBarTickInterval);
|
||||
commandTPSBarOutput = getString("command.messages.tpsbar-command-output", commandTPSBarOutput);
|
||||
@@ -177,5 +182,16 @@ public class LeafConfig {
|
||||
commandTPSBarTextColorMedium = getString("command.tpsbar.text-color.medium", commandTPSBarTextColorMedium);
|
||||
commandTPSBarTextColorLow = getString("command.tpsbar.text-color.low", commandTPSBarTextColorLow);
|
||||
commandTPSBarTickInterval = getInt("command.tpsbar.tick-interval", commandTPSBarTickInterval);
|
||||
+
|
||||
+ commandCompassBarTitle = getString("command.compass.title", commandCompassBarTitle);
|
||||
+ commandCompassBarProgressOverlay = BossBar.Overlay.valueOf(getString("command.compass.overlay", commandCompassBarProgressOverlay.name()));
|
||||
+ commandCompassBarProgressColor = BossBar.Color.valueOf(getString("command.compass.progress-color", commandCompassBarProgressColor.name()));
|
||||
+ commandCompassBarProgressPercent = (float) getDouble("command.compass.percent", commandCompassBarProgressPercent);
|
||||
+ commandCompassBarTickInterval = getInt("command.compass.tick-interval", commandCompassBarTickInterval);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean compassItemShowsBossBar = false;
|
||||
+ private static void itemSettings() {
|
||||
+ private static void gameplayMechanicSettings() {
|
||||
+ compassItemShowsBossBar = getBoolean("gameplay-mechanics.item.compass.holding-shows-bossbar", compassItemShowsBossBar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ index 66242833210ae89cbca7448cd4e7cf1fa774bcf0..ff19fcd83295c6936dd83c7780d57570
|
||||
|
||||
if (environment.includeIntegrated) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index d1fd3eb9e51ace68d3ffc24579cdf95ebdaea039..1b92480529c4436efe3d3b293a7af1fa95457a9d 100644
|
||||
index 09667820e41ef9c4e3aef9e2c8d18eb6aa0bdc1e..05ef07550dae98170a71968673addf9bf8c96769 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -271,6 +271,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -63,15 +63,15 @@ index d1fd3eb9e51ace68d3ffc24579cdf95ebdaea039..1b92480529c4436efe3d3b293a7af1fa
|
||||
// Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index e56151fe0dbc0c867dff728a55daa35c7714d3a6..afdee99c7d5ecedf8d2f6856f0aa9271c6bbb23d 100644
|
||||
index d0ef118ed2e934a3d8f9e4b0d93b2f68bfa28454..71f09693fd21908253fd56048be3668704192436 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -175,6 +175,17 @@ public class LeafConfig {
|
||||
@@ -169,6 +169,17 @@ public class LeafConfig {
|
||||
public static BossBar.Color commandCompassBarProgressColor = BossBar.Color.BLUE;
|
||||
public static float commandCompassBarProgressPercent = 1.0F;
|
||||
public static int commandCompassBarTickInterval = 5;
|
||||
+ public static String ramCommandOutput = "<green>Ram Usage: <used>/<xmx> (<percent>)";
|
||||
+ public static String rambarCommandOutput = "<green>Rambar toggled <onoff> for <target>";
|
||||
+ public static String commandRamOutput = "<green>Ram Usage: <used>/<xmx> (<percent>)";
|
||||
+ public static String commandRamBarOutput = "<green>Rambar toggled <onoff> for <target>";
|
||||
+ public static String commandRamBarTitle = "<gray>Ram<yellow>:</yellow> <used>/<xmx> (<percent>)";
|
||||
+ public static BossBar.Overlay commandRamBarProgressOverlay = BossBar.Overlay.NOTCHED_20;
|
||||
+ public static BossBar.Color commandRamBarProgressColorGood = BossBar.Color.GREEN;
|
||||
@@ -83,28 +83,29 @@ index e56151fe0dbc0c867dff728a55daa35c7714d3a6..afdee99c7d5ecedf8d2f6856f0aa9271
|
||||
+ public static int commandRamBarTickInterval = 20;
|
||||
|
||||
private static void commandSettings() {
|
||||
commandTPSBarTitle = getString("settings.command.tpsbar.title", commandTPSBarTitle);
|
||||
@@ -194,6 +205,17 @@ public class LeafConfig {
|
||||
commandCompassBarProgressPercent = (float) getDouble("settings.command.compass.percent", commandCompassBarProgressPercent);
|
||||
commandCompassBarTickInterval = getInt("settings.command.compass.tick-interval", commandCompassBarTickInterval);
|
||||
|
||||
+ ramCommandOutput = getString("settings.messages.ram-command-output", ramCommandOutput);
|
||||
+ rambarCommandOutput = getString("settings.messages.rambar-command-output", rambarCommandOutput);
|
||||
+ commandRamBarTitle = getString("settings.command.rambar.title", commandRamBarTitle);
|
||||
+ commandRamBarProgressOverlay = BossBar.Overlay.valueOf(getString("settings.command.rambar.overlay", commandRamBarProgressOverlay.name()));
|
||||
+ commandRamBarProgressColorGood = BossBar.Color.valueOf(getString("settings.command.rambar.progress-color.good", commandRamBarProgressColorGood.name()));
|
||||
+ commandRamBarProgressColorMedium = BossBar.Color.valueOf(getString("settings.command.rambar.progress-color.medium", commandRamBarProgressColorMedium.name()));
|
||||
+ commandRamBarProgressColorLow = BossBar.Color.valueOf(getString("settings.command.rambar.progress-color.low", commandRamBarProgressColorLow.name()));
|
||||
+ commandRamBarTextColorGood = getString("settings.command.rambar.text-color.good", commandRamBarTextColorGood);
|
||||
+ commandRamBarTextColorMedium = getString("settings.command.rambar.text-color.medium", commandRamBarTextColorMedium);
|
||||
+ commandRamBarTextColorLow = getString("settings.command.rambar.text-color.low", commandRamBarTextColorLow);
|
||||
+ commandRamBarTickInterval = getInt("settings.command.rambar.tick-interval", commandRamBarTickInterval);
|
||||
commandTPSBarOutput = getString("command.messages.tpsbar-command-output", commandTPSBarOutput);
|
||||
@@ -188,6 +199,18 @@ public class LeafConfig {
|
||||
commandCompassBarProgressColor = BossBar.Color.valueOf(getString("command.compass.progress-color", commandCompassBarProgressColor.name()));
|
||||
commandCompassBarProgressPercent = (float) getDouble("command.compass.percent", commandCompassBarProgressPercent);
|
||||
commandCompassBarTickInterval = getInt("command.compass.tick-interval", commandCompassBarTickInterval);
|
||||
+
|
||||
+ commandRamOutput = getString("command.messages.ram-command-output", commandRamOutput);
|
||||
+ commandRamBarOutput = getString("command.messages.rambar-command-output", commandRamBarOutput);
|
||||
+ commandRamBarTitle = getString("command.rambar.title", commandRamBarTitle);
|
||||
+ commandRamBarProgressOverlay = BossBar.Overlay.valueOf(getString("command.rambar.overlay", commandRamBarProgressOverlay.name()));
|
||||
+ commandRamBarProgressColorGood = BossBar.Color.valueOf(getString("command.rambar.progress-color.good", commandRamBarProgressColorGood.name()));
|
||||
+ commandRamBarProgressColorMedium = BossBar.Color.valueOf(getString("command.rambar.progress-color.medium", commandRamBarProgressColorMedium.name()));
|
||||
+ commandRamBarProgressColorLow = BossBar.Color.valueOf(getString("command.rambar.progress-color.low", commandRamBarProgressColorLow.name()));
|
||||
+ commandRamBarTextColorGood = getString("command.rambar.text-color.good", commandRamBarTextColorGood);
|
||||
+ commandRamBarTextColorMedium = getString("command.rambar.text-color.medium", commandRamBarTextColorMedium);
|
||||
+ commandRamBarTextColorLow = getString("command.rambar.text-color.low", commandRamBarTextColorLow);
|
||||
+ commandRamBarTickInterval = getInt("command.rambar.tick-interval", commandRamBarTickInterval);
|
||||
}
|
||||
|
||||
public static boolean compassItemShowsBossBar = false;
|
||||
diff --git a/src/main/java/org/dreeam/leaf/commands/RamBarCommand.java b/src/main/java/org/dreeam/leaf/commands/RamBarCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..084be8ead4845af5669dbbebc3ebc80facb3e454
|
||||
index 0000000000000000000000000000000000000000..900a5ab318d5b17cea7129088aa84c015dde0b53
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/commands/RamBarCommand.java
|
||||
@@ -0,0 +1,43 @@
|
||||
@@ -141,7 +142,7 @@ index 0000000000000000000000000000000000000000..084be8ead4845af5669dbbebc3ebc80f
|
||||
+ boolean result = RamBarTask.instance().togglePlayer(player.getBukkitEntity());
|
||||
+ player.ramBar(result);
|
||||
+
|
||||
+ Component output = MiniMessage.miniMessage().deserialize(LeafConfig.rambarCommandOutput,
|
||||
+ Component output = MiniMessage.miniMessage().deserialize(LeafConfig.commandRamBarOutput,
|
||||
+ Placeholder.component("onoff", Component.translatable(result ? "options.on" : "options.off")
|
||||
+ .color(result ? NamedTextColor.GREEN : NamedTextColor.RED)),
|
||||
+ Placeholder.parsed("target", player.getGameProfile().getName()));
|
||||
@@ -153,7 +154,7 @@ index 0000000000000000000000000000000000000000..084be8ead4845af5669dbbebc3ebc80f
|
||||
+}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/commands/RamCommand.java b/src/main/java/org/dreeam/leaf/commands/RamCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6cfb2791afed4122782ae5a8a5a9ecef698d8823
|
||||
index 0000000000000000000000000000000000000000..dd9492ffb7f92c69dd37bf197ec1bacb5f206f05
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/dreeam/leaf/commands/RamCommand.java
|
||||
@@ -0,0 +1,30 @@
|
||||
@@ -175,7 +176,7 @@ index 0000000000000000000000000000000000000000..6cfb2791afed4122782ae5a8a5a9ecef
|
||||
+ .executes(context -> {
|
||||
+ CommandSourceStack sender = context.getSource();
|
||||
+ RamBarTask ramBar = RamBarTask.instance();
|
||||
+ sender.sendSuccess(PaperAdventure.asVanilla(MiniMessage.miniMessage().deserialize(LeafConfig.ramCommandOutput,
|
||||
+ sender.sendSuccess(PaperAdventure.asVanilla(MiniMessage.miniMessage().deserialize(LeafConfig.commandRamOutput,
|
||||
+ Placeholder.component("allocated", ramBar.format(ramBar.getAllocated())),
|
||||
+ Placeholder.component("used", ramBar.format(ramBar.getUsed())),
|
||||
+ Placeholder.component("xmx", ramBar.format(ramBar.getXmx())),
|
||||
|
||||
@@ -42,16 +42,18 @@ index b4cb8cdacc822d9bf238fcc2029b21c28ea1753b..8e3d8b34816a4c097fa6a001aae6eaa2
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index afdee99c7d5ecedf8d2f6856f0aa9271c6bbb23d..a723d5a6bb69543072b8e9a7082ba3f0e89d453e 100644
|
||||
index 71f09693fd21908253fd56048be3668704192436..f74093bd3be900dec53cf927d31fb10dba169214 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -222,4 +222,9 @@ public class LeafConfig {
|
||||
private static void itemSettings() {
|
||||
compassItemShowsBossBar = getBoolean("gameplay-mechanics.item.compass.holding-shows-bossbar", compassItemShowsBossBar);
|
||||
@@ -153,6 +153,11 @@ public class LeafConfig {
|
||||
"To enable this, players can use some packet modules with hack clients");
|
||||
}
|
||||
+
|
||||
|
||||
+ public static double laggingThreshold = 19.0D;
|
||||
+ private static void tickLoopSettings() {
|
||||
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
+ private static void performance() {
|
||||
+ laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
||||
+ }
|
||||
}
|
||||
+
|
||||
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
public static String commandTPSBarTitle = "<gray>TPS<yellow>:</yellow> <tps> MSPT<yellow>:</yellow> <mspt> Ping<yellow>:</yellow> <ping>ms";
|
||||
public static BossBar.Overlay commandTPSBarProgressOverlay = BossBar.Overlay.NOTCHED_20;
|
||||
|
||||
@@ -25,16 +25,17 @@ index fe25f51ee708c76bcf66e3280bb235713c99f79c..1f3f414ede558f590a5e68256a60d9ca
|
||||
this.isReady = true;
|
||||
JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index a723d5a6bb69543072b8e9a7082ba3f0e89d453e..66092bc87472278898743971dd80244cb750297e 100644
|
||||
index f74093bd3be900dec53cf927d31fb10dba169214..eaf4438f1d2b4f062f1ff0c591f90adb6e6bd95b 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -227,4 +227,9 @@ public class LeafConfig {
|
||||
private static void tickLoopSettings() {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
@@ -154,8 +154,10 @@ public class LeafConfig {
|
||||
}
|
||||
+
|
||||
|
||||
public static double laggingThreshold = 19.0D;
|
||||
+ public static boolean tpsCatchup = true;
|
||||
+ private static void tpsCatchup() {
|
||||
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
+ }
|
||||
}
|
||||
private static void performance() {
|
||||
laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
||||
+ tpsCatchup = getBoolean("performance.tps-catchup", tpsCatchup);
|
||||
}
|
||||
|
||||
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
|
||||
@@ -70,16 +70,16 @@ index 64206d94a5bf210116d208f9678618b905a61428..fbb06c5db6f80008a54563b7d959e55e
|
||||
} else {
|
||||
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 66092bc87472278898743971dd80244cb750297e..06664bb40fe4b55998e7a0957cbb4b9fa4f8b05f 100644
|
||||
index eaf4438f1d2b4f062f1ff0c591f90adb6e6bd95b..2c870c56752a7c67762684d581cfdb37f11e3ca9 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -232,4 +232,9 @@ public class LeafConfig {
|
||||
private static void tpsCatchup() {
|
||||
tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
@@ -221,7 +221,9 @@ public class LeafConfig {
|
||||
}
|
||||
+
|
||||
|
||||
public static boolean compassItemShowsBossBar = false;
|
||||
+ public static boolean allowWaterPlacementInTheEnd = true;
|
||||
+ private static void allowWaterPlacementInEnd() {
|
||||
+ allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
+ }
|
||||
private static void gameplayMechanicSettings() {
|
||||
compassItemShowsBossBar = getBoolean("gameplay-mechanics.item.compass.holding-shows-bossbar", compassItemShowsBossBar);
|
||||
+ allowWaterPlacementInTheEnd = getBoolean("gameplay-mechanics.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,17 +46,17 @@ index 7304b2659eb45bc4bc9fa7c43e6ca07221d0fc73..35a69bb50bc0575dd4f285cc9499d085
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 06664bb40fe4b55998e7a0957cbb4b9fa4f8b05f..680ada855140ad86c5c953c7357fc745b308b334 100644
|
||||
index 2c870c56752a7c67762684d581cfdb37f11e3ca9..328347af63b2b6cad67d3c5198bc0ec52daa9a31 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -237,4 +237,11 @@ public class LeafConfig {
|
||||
private static void allowWaterPlacementInEnd() {
|
||||
allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
@@ -226,4 +226,11 @@ public class LeafConfig {
|
||||
compassItemShowsBossBar = getBoolean("gameplay-mechanics.item.compass.holding-shows-bossbar", compassItemShowsBossBar);
|
||||
allowWaterPlacementInTheEnd = getBoolean("gameplay-mechanics.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
}
|
||||
+
|
||||
+ public static int spongeAbsorptionArea = 64;
|
||||
+ public static int spongeAbsorptionRadius = 6;
|
||||
+ private static void spongeSettings() {
|
||||
+ private static void blockSettings() {
|
||||
+ spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
|
||||
+ spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
||||
+ }
|
||||
|
||||
@@ -38,16 +38,17 @@ index 744d91546d1a810f60a43c15ed74b4158f341a4a..460609a50d0f68c191f0fd529a7dc582
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 680ada855140ad86c5c953c7357fc745b308b334..e04d0dc3ed108edee9b8cabea56f86556ac9fb78 100644
|
||||
index 328347af63b2b6cad67d3c5198bc0ec52daa9a31..69bba6ea56e1c1dbb55fdbcb0686dae6685b2150 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -244,4 +244,9 @@ public class LeafConfig {
|
||||
@@ -229,8 +229,10 @@ public class LeafConfig {
|
||||
|
||||
public static int spongeAbsorptionArea = 64;
|
||||
public static int spongeAbsorptionRadius = 6;
|
||||
+ public static int pistonBlockPushLimit = 12;
|
||||
private static void blockSettings() {
|
||||
spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
|
||||
spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
||||
}
|
||||
+
|
||||
+ public static int pistonBlockPushLimit = 12;
|
||||
+ private static void pistonSettings() {
|
||||
+ pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ index 5ba0a756d45350dcda3caa5518c9a47a4de06f14..e438597242adc99e88f465231a043ea2
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 1b92480529c4436efe3d3b293a7af1fa95457a9d..2c2262a2babd4fd5ca22b4630c1f0ae5e3a1a9ab 100644
|
||||
index 05ef07550dae98170a71968673addf9bf8c96769..f940f54841455caf5959cb7c9289c5bf4a159f55 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -948,6 +948,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -128,18 +128,20 @@ index ce197df36b3746dbd511287ecd78e46eaec3d5e0..b439a6033223269c94e988069c0df3ad
|
||||
public void sendSystemMessage(Component message) {}
|
||||
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index e04d0dc3ed108edee9b8cabea56f86556ac9fb78..040c1f584c525990ec844cba9f01df5b33fa2a37 100644
|
||||
index 69bba6ea56e1c1dbb55fdbcb0686dae6685b2150..0cdfab3476fb09ff19fa41dcac2fd27475c83258 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -249,4 +249,11 @@ public class LeafConfig {
|
||||
private static void pistonSettings() {
|
||||
pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
||||
@@ -220,6 +220,13 @@ public class LeafConfig {
|
||||
commandRamBarTickInterval = getInt("command.rambar.tick-interval", commandRamBarTickInterval);
|
||||
}
|
||||
+
|
||||
|
||||
+ public static boolean advancementOnlyBroadcastToAffectedPlayer = false;
|
||||
+ public static boolean deathMessageOnlyBroadcastToAffectedPlayer = false;
|
||||
+ private static void broadcastSettings() {
|
||||
+ advancementOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.advancement.only-broadcast-to-affected-player", advancementOnlyBroadcastToAffectedPlayer);
|
||||
+ deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
|
||||
+ advancementOnlyBroadcastToAffectedPlayer = getBoolean("broadcasts.advancement.only-broadcast-to-affected-player", advancementOnlyBroadcastToAffectedPlayer);
|
||||
+ deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
|
||||
+ }
|
||||
}
|
||||
+
|
||||
public static boolean compassItemShowsBossBar = false;
|
||||
public static boolean allowWaterPlacementInTheEnd = true;
|
||||
private static void gameplayMechanicSettings() {
|
||||
|
||||
@@ -198,16 +198,18 @@ index 58986bc0677c5ea1ad54d7d6d4efa5c2ea233aea..59d616137088af46d4494171fe96ba01
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 040c1f584c525990ec844cba9f01df5b33fa2a37..414516ee3596bcde783900200823e8ed00dae6fe 100644
|
||||
index 0cdfab3476fb09ff19fa41dcac2fd27475c83258..540be4932b006cdf9cabf804b49988f26a46b643 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -256,4 +256,9 @@ public class LeafConfig {
|
||||
advancementOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.advancement.only-broadcast-to-affected-player", advancementOnlyBroadcastToAffectedPlayer);
|
||||
deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
|
||||
}
|
||||
+
|
||||
@@ -229,9 +229,11 @@ public class LeafConfig {
|
||||
|
||||
public static boolean compassItemShowsBossBar = false;
|
||||
public static boolean allowWaterPlacementInTheEnd = true;
|
||||
+ public static boolean persistentTileEntityDisplayNames = false;
|
||||
+ private static void tileentitySetting() {
|
||||
private static void gameplayMechanicSettings() {
|
||||
compassItemShowsBossBar = getBoolean("gameplay-mechanics.item.compass.holding-shows-bossbar", compassItemShowsBossBar);
|
||||
allowWaterPlacementInTheEnd = getBoolean("gameplay-mechanics.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
||||
+ persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
public static int spongeAbsorptionArea = 64;
|
||||
|
||||
@@ -110,18 +110,20 @@ index a1a8ac55e572156671e47317ba061855be79e5ac..ec3fb8865211bd7625103c37af7b96df
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 414516ee3596bcde783900200823e8ed00dae6fe..55879146faa26d3ed58693627f8dfe9126bf5171 100644
|
||||
index 540be4932b006cdf9cabf804b49988f26a46b643..d519349d27c4e405d1ce57b07d89e09bbf7969d1 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -261,4 +261,11 @@ public class LeafConfig {
|
||||
private static void tileentitySetting() {
|
||||
persistentTileEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-tileentity-display-names-and-lore", persistentTileEntityDisplayNames);
|
||||
}
|
||||
+
|
||||
@@ -155,9 +155,13 @@ public class LeafConfig {
|
||||
|
||||
public static double laggingThreshold = 19.0D;
|
||||
public static boolean tpsCatchup = true;
|
||||
+ public static boolean villagerLobotomizeEnabled = false;
|
||||
+ public static int villagerLobotomizeCheckInterval = 100;
|
||||
+ private static void villagerSettings() {
|
||||
+ villagerLobotomizeEnabled = getBoolean("mobs.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
||||
+ villagerLobotomizeCheckInterval = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
||||
+ }
|
||||
}
|
||||
private static void performance() {
|
||||
laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
||||
tpsCatchup = getBoolean("performance.tps-catchup", tpsCatchup);
|
||||
+ villagerLobotomizeEnabled = getBoolean("performance.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
||||
+ villagerLobotomizeCheckInterval = getInt("performance.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
||||
}
|
||||
|
||||
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
|
||||
@@ -7,7 +7,7 @@ Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 4f131ca1977475513ee43120f06b7c026f49e91e..9305f5d0f1323604ae2bc7cee7c19d0304874883 100644
|
||||
index 3bb09b3b53ac0f480fd451871f96631c35ecf3a9..42dc4679e33c5193f0ac1ec8673f0d16ecbf68ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2405,7 +2405,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -20,16 +20,16 @@ index 4f131ca1977475513ee43120f06b7c026f49e91e..9305f5d0f1323604ae2bc7cee7c19d03
|
||||
} while (!this.lastChatTimeStamp.compareAndSet(instant1, timestamp));
|
||||
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 55879146faa26d3ed58693627f8dfe9126bf5171..e0d5e00b4291e66b27a3a0c1701af3c4e7b3db26 100644
|
||||
index d519349d27c4e405d1ce57b07d89e09bbf7969d1..f167937d80b5b83673e60a4814fcee4570eeff32 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -268,4 +268,9 @@ public class LeafConfig {
|
||||
villagerLobotomizeEnabled = getBoolean("mobs.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
||||
villagerLobotomizeCheckInterval = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
||||
@@ -248,4 +248,9 @@ public class LeafConfig {
|
||||
spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
||||
pistonBlockPushLimit = getInt("blocks.piston.block-push-limit", pistonBlockPushLimit);
|
||||
}
|
||||
+
|
||||
+ public static boolean kickForOutOfOrderChat = true;
|
||||
+ private static void networkSettings() {
|
||||
+ kickForOutOfOrderChat = getBoolean("settings.network.kick-for-out-of-order-chat", kickForOutOfOrderChat);
|
||||
+ kickForOutOfOrderChat = getBoolean("network.kick-for-out-of-order-chat", kickForOutOfOrderChat);
|
||||
+ }
|
||||
}
|
||||
|
||||
@@ -28,16 +28,20 @@ index 7b0374b6e22105e59b29995983a6ac50268c722e..da45ccd3b96158dace1dec4c291aa98f
|
||||
} else {
|
||||
ItemEntity.merge(other, itemstack1, this, itemstack);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index e0d5e00b4291e66b27a3a0c1701af3c4e7b3db26..aec438c9f551b3d93cc18fa61fe55296fc16b0d7 100644
|
||||
index f167937d80b5b83673e60a4814fcee4570eeff32..9f184ae7d61e4a082ceebeb9e6373ecc932e21f6 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -273,4 +273,9 @@ public class LeafConfig {
|
||||
private static void networkSettings() {
|
||||
kickForOutOfOrderChat = getBoolean("settings.network.kick-for-out-of-order-chat", kickForOutOfOrderChat);
|
||||
}
|
||||
+
|
||||
@@ -157,11 +157,13 @@ public class LeafConfig {
|
||||
public static boolean tpsCatchup = true;
|
||||
public static boolean villagerLobotomizeEnabled = false;
|
||||
public static int villagerLobotomizeCheckInterval = 100;
|
||||
+ public static boolean useSpigotItemMergingMechanism = true;
|
||||
+ private static void performance() {
|
||||
private static void performance() {
|
||||
laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
||||
tpsCatchup = getBoolean("performance.tps-catchup", tpsCatchup);
|
||||
villagerLobotomizeEnabled = getBoolean("performance.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
||||
villagerLobotomizeCheckInterval = getInt("performance.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
||||
+ useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
|
||||
@@ -487,23 +487,28 @@ index 731c7dd15f131dc124be6af8f342b122cb89491b..24a82111a5485da1e3903977d0519e9e
|
||||
return i;
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index aec438c9f551b3d93cc18fa61fe55296fc16b0d7..b2024c782c25da813a1f6595b94e6a8c14f6380d 100644
|
||||
index 9f184ae7d61e4a082ceebeb9e6373ecc932e21f6..b598b941a86452b663c4997ca5c7b2781f821976 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -278,4 +278,13 @@ public class LeafConfig {
|
||||
private static void performance() {
|
||||
useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
||||
}
|
||||
+
|
||||
@@ -158,12 +158,18 @@ public class LeafConfig {
|
||||
public static boolean villagerLobotomizeEnabled = false;
|
||||
public static int villagerLobotomizeCheckInterval = 100;
|
||||
public static boolean useSpigotItemMergingMechanism = true;
|
||||
+ public static boolean optimizedRound = true;
|
||||
+ public static boolean optimizedHypot = true;
|
||||
+ private static void fastMath() {
|
||||
+ optimizedRound = getBoolean("optimize-math-round", optimizedRound,
|
||||
private static void performance() {
|
||||
laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
||||
tpsCatchup = getBoolean("performance.tps-catchup", tpsCatchup);
|
||||
villagerLobotomizeEnabled = getBoolean("performance.villager.lobotomize.enabled", villagerLobotomizeEnabled);
|
||||
villagerLobotomizeCheckInterval = getInt("performance.villager.lobotomize.check-interval", villagerLobotomizeCheckInterval);
|
||||
useSpigotItemMergingMechanism = getBoolean("performance.use-spigot-item-merging-mechanism", useSpigotItemMergingMechanism);
|
||||
+ optimizedRound = getBoolean("performance.optimize-math-round", optimizedRound,
|
||||
+ "Whether or not Math.round should be replaced by a faster version.");
|
||||
+ optimizedHypot = getBoolean("optimize-math-hypot", optimizedHypot,
|
||||
+ optimizedHypot = getBoolean("performance.optimize-math-hypot", optimizedHypot,
|
||||
+ "Whether or not Math.hypot should be replaced by a faster version.");
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
index b42b31cd33232a99befd8334bc24b8ae8b021ccb..b339fd4b3b4bc48caa10d2707071b08e284b1992 100644
|
||||
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
|
||||
@@ -194,24 +194,27 @@ index 0000000000000000000000000000000000000000..bcacccd9d47697bea0405f2544be94fc
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index b2024c782c25da813a1f6595b94e6a8c14f6380d..92f0de1d6b9846a8873c076fdec5c4480e0277ce 100644
|
||||
index b598b941a86452b663c4997ca5c7b2781f821976..bdf5ada9efaf99ceae576e0f9be6e835cfcd74cc 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -139,6 +139,17 @@ public class LeafConfig {
|
||||
serverModName = getString("settings.server-mod-name", serverModName);
|
||||
}
|
||||
|
||||
+ public static String sentryDsn;
|
||||
+ private static void sentry() {
|
||||
@@ -160,6 +160,7 @@ public class LeafConfig {
|
||||
public static boolean useSpigotItemMergingMechanism = true;
|
||||
public static boolean optimizedRound = true;
|
||||
public static boolean optimizedHypot = true;
|
||||
+ public static String sentryDsn = "";
|
||||
private static void performance() {
|
||||
laggingThreshold = getDouble("performance.lagging-threshold", laggingThreshold);
|
||||
tpsCatchup = getBoolean("performance.tps-catchup", tpsCatchup);
|
||||
@@ -170,6 +171,12 @@ public class LeafConfig {
|
||||
"Whether or not Math.round should be replaced by a faster version.");
|
||||
optimizedHypot = getBoolean("performance.optimize-math-hypot", optimizedHypot,
|
||||
"Whether or not Math.hypot should be replaced by a faster version.");
|
||||
+ String sentryEnvironment = System.getenv("SENTRY_DSN");
|
||||
+ String sentryConfig = getString("sentry-dsn", "", "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
+
|
||||
+ String sentryConfig = getString("performance.sentry-dsn", sentryDsn, "Sentry DSN for improved error logging, leave blank to disable", "Obtain from https://sentry.io/");
|
||||
+ sentryDsn = sentryEnvironment == null ? sentryConfig : sentryEnvironment;
|
||||
+ if (sentryDsn != null && !sentryDsn.isBlank()) {
|
||||
+ gg.pufferfish.pufferfish.sentry.SentryManager.init();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public static boolean removeMojangUsernameCheck;
|
||||
public static boolean removeSpigotCheckBungeeConfig;
|
||||
public static boolean removeUseItemOnPacketTooFar;
|
||||
}
|
||||
|
||||
public static String commandTPSBarOutput = "<green>Tpsbar toggled <onoff> for <target>";
|
||||
|
||||
@@ -8,12 +8,12 @@ Original project: https://github.com/PaperMC/Velocity
|
||||
Paper pull request: https://github.com/PaperMC/Paper/pull/8418
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
index 35377576ed182814051c11f902e02e8e921e84e3..636c066651f3a4fd27923059877b1bc393dee826 100644
|
||||
index 32ee4ed11aefd82dca2e3e78b3108f041fdc3695..b54a4b2df126006b200a9e2dfda85303e6baa0ee 100644
|
||||
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -88,6 +88,18 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -94,6 +94,18 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
}
|
||||
|
||||
|
||||
public static int getVarIntSize(int value) {
|
||||
+ //Paper start - Optimize VarInts
|
||||
+ return VARINT_EXACT_BYTE_LENGTHS[Integer.numberOfLeadingZeros(value)]; // Paper - Optimize VarInts
|
||||
@@ -30,9 +30,9 @@ index 35377576ed182814051c11f902e02e8e921e84e3..636c066651f3a4fd27923059877b1bc3
|
||||
for (int j = 1; j < 5; ++j) {
|
||||
if ((value & -1 << j * 7) == 0) {
|
||||
return j;
|
||||
@@ -504,6 +516,21 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
@@ -566,6 +578,21 @@ public class FriendlyByteBuf extends ByteBuf {
|
||||
}
|
||||
|
||||
|
||||
public FriendlyByteBuf writeVarInt(int value) {
|
||||
+ // Paper start - Optimize VarInts
|
||||
+ // Peel the one and two byte count cases explicitly as they are the most common VarInt sizes
|
||||
|
||||
Reference in New Issue
Block a user