9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-24 01:19:19 +00:00

Leaves config hot modify (#126)

This commit is contained in:
violetc
2024-01-10 13:32:42 +08:00
parent 11c94f7e39
commit 45c933a5b2
114 changed files with 1125 additions and 1299 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -77,7 +77,7 @@ index 192eeaffd6d51baca149c7b9eaccf53246cb3af5..00f4ee320f8a8d019cb311cee78bb384
ServerLevel worldserver = entityplayer.serverLevel();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f18225bff50f87e4dab89951a9f09947639b6a27..dc4ce7bbde058560c077fe2004da64e3113ccace 100644
index 417a808d2b99a0a3f499a457c93afb9494d22fff..1e904d37a4646ebd2c3913fb6157342678c06ba9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -463,6 +463,7 @@ public final class CraftServer implements Server {
@@ -88,8 +88,8 @@ index f18225bff50f87e4dab89951a9f09947639b6a27..dc4ce7bbde058560c077fe2004da64e3
}
public boolean getCommandBlockOverride(String command) {
@@ -1072,6 +1073,7 @@ public final class CraftServer implements Server {
top.leavesmc.leaves.LeavesConfig.registerCommands(); // Leaves - Server Command
@@ -1070,6 +1071,7 @@ public final class CraftServer implements Server {
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
+ top.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleServerReload(); // Leaves - protocol

View File

@@ -353,7 +353,7 @@ index dfeb3e336e06ef01f5401a362755030db942bb07..c51413bf02b3572a05f09d2f0d02493d
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index dc4ce7bbde058560c077fe2004da64e3113ccace..602d913b144c6d565e09c5623859c40775a4fcca 100644
index 1e904d37a4646ebd2c3913fb6157342678c06ba9..1dc51050065af9bfc760f0a2cd7a479817888280 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -259,6 +259,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
@@ -372,7 +372,7 @@ index dc4ce7bbde058560c077fe2004da64e3113ccace..602d913b144c6d565e09c5623859c407
// Paper start - Folia region threading API
private final io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler regionizedScheduler = new io.papermc.paper.threadedregions.scheduler.FallbackRegionScheduler();
@@ -3246,4 +3248,11 @@ public final class CraftServer implements Server {
@@ -3244,4 +3246,11 @@ public final class CraftServer implements Server {
}
// Paper end
@@ -419,35 +419,9 @@ index 74ff54724626908a083063c54983e0adfbbf7749..7afc1618f2014df67ca42f00c09e863c
/**
* The start ID for the counter.
*/
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index a1ca90ea40b4ccd8df290f8cc34d63d390acc87c..ae21d3e873b22849cc2f02444624d150e9e3868d 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -8,6 +8,9 @@ import org.bukkit.command.Command;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import top.leavesmc.leaves.command.LeavesCommand;
+import top.leavesmc.leaves.bot.BotCommand;
+import top.leavesmc.leaves.bot.agent.Actions;
+import top.leavesmc.leaves.util.MathUtils;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
@@ -70,6 +73,11 @@ public final class LeavesConfig {
commands = new HashMap<>();
commands.put("leaves", new LeavesCommand("leaves"));
+
+ if (top.leavesmc.leaves.LeavesConfig.fakeplayerSupport) {
+ commands.put("bot", new BotCommand("bot"));
+ Actions.registerAll();
+ }
}
public static void load(final YamlConfiguration config) {
diff --git a/src/main/java/top/leavesmc/leaves/bot/BotCommand.java b/src/main/java/top/leavesmc/leaves/bot/BotCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..6abc37cff54d876b598051bb23aa3a2c2e1a7baa
index 0000000000000000000000000000000000000000..6a67f2e548d5f0a5936cc7520eb8369788e9bea8
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/bot/BotCommand.java
@@ -0,0 +1,275 @@
@@ -467,7 +441,7 @@ index 0000000000000000000000000000000000000000..6abc37cff54d876b598051bb23aa3a2c
+import org.bukkit.permissions.PermissionDefault;
+import org.bukkit.plugin.PluginManager;
+import org.jetbrains.annotations.NotNull;
+import top.leavesmc.leaves.LeavesLogger;
+import top.leavesmc.leaves.LeavesConfig;
+import top.leavesmc.leaves.bot.agent.Actions;
+import top.leavesmc.leaves.bot.agent.BotAction;
+import top.leavesmc.leaves.bot.agent.actions.CraftCustomBotAction;
@@ -532,7 +506,7 @@ index 0000000000000000000000000000000000000000..6abc37cff54d876b598051bb23aa3a2c
+
+ @Override
+ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String[] args) {
+ if (!testPermission(sender)) return true;
+ if (!testPermission(sender) || !LeavesConfig.fakeplayerSupport) return true;
+
+ if (args.length == 0) {
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
@@ -1194,7 +1168,7 @@ index 0000000000000000000000000000000000000000..daaece30b2a3983f1cc9ee9a851e8f37
+}
diff --git a/src/main/java/top/leavesmc/leaves/bot/ServerBot.java b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
new file mode 100644
index 0000000000000000000000000000000000000000..02ef39695d921f804c2a89ae5cf7959c0c0e2903
index 0000000000000000000000000000000000000000..7a8eb0a472933239145e79930de28deb4cb7b0d6
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java
@@ -0,0 +1,722 @@
@@ -1518,7 +1492,7 @@ index 0000000000000000000000000000000000000000..02ef39695d921f804c2a89ae5cf7959c
+ if (server.getTickCount() % 20 == 0) {
+ float health = getHealth();
+ float maxHealth = getMaxHealth();
+ float regenAmount = LeavesConfig.fakeplayerRegenAmount * 20;
+ float regenAmount = (float) (LeavesConfig.fakeplayerRegenAmount * 20);
+ float amount;
+
+ if (health < maxHealth - regenAmount) {

View File

@@ -102,10 +102,10 @@ index 9d6db4a378036559efab91c8b7dcf2a6b0c2cce6..2c349dc502ce275a8215766933f4855f
}
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index fd89dfb3f2ceab015b74d7e3a061973e590cedd5..4b13af14fcbe1925f9d3104d95ebbfbc596cfb3c 100644
index 570310512c9ce5cf87f3fffe20d6d88c651aa83a..d4932ba7042b897a8561103367d0b7cf9a08234c 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -643,7 +643,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -642,7 +642,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper start - fix secure profile with proxy online mode
return dedicatedserverproperties.enforceSecureProfile
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()

View File

@@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sat, 13 Aug 2022 17:27:18 +0800
Subject: [PATCH] Optimize mob spawning
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index ae21d3e873b22849cc2f02444624d150e9e3868d..d5b4e98214f722e2709f542a1f5c3e19a8b1fabe 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -257,7 +257,7 @@ public final class LeavesConfig {
noChatSign = getBoolean("settings.misc.no-chat-sign", noChatSign);
}
- public static boolean asyncMobSpawning = false;
+ public static boolean asyncMobSpawning = false; // void
private static boolean asyncMobSpawningLock = false;
private static void asyncMobSpawning() {
if (!asyncMobSpawningLock) {

View File

@@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sun, 14 Aug 2022 00:39:45 +0800
Subject: [PATCH] Multithreaded Tracker
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index d5b4e98214f722e2709f542a1f5c3e19a8b1fabe..51295f0c5ee66a59a9847c4a4d4a7070fc17f62e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -271,7 +271,7 @@ public final class LeavesConfig {
dontSendUselessEntityPackets = getBoolean("settings.performance.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
}
- public static boolean asyncEntityTracker = false;
+ public static boolean asyncEntityTracker = false; // void
private static boolean asyncEntityTrackerLock = false;
private static void asyncEntityTracker() {
if (!asyncEntityTrackerLock) {

View File

@@ -25,7 +25,7 @@ index 200ed770b57e1a9240abf0473968d4b85cbefe3c..bf16715db2424f0b05854ae7665b4448
public static long getCoordinateKey(final ChunkPos pair) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2bd6e02291b6ac6ff31e85f6721bb89b2efc704b..0cdfb9470c29132f75a5b3df05178626a56e4e6e 100644
index f9e9b708eecae0dfdb283899ac293ddbfb986ade..b989029d7425cf410698ff477a3622b4c629ada3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -307,7 +307,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Move ThreadUnsafeRandom Initialization
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 62867bc387f49398ebb5d608c4f1e4e562079bd7..ddbe5ece289235cf5b9a0e9d532ab9b8f1ff200c 100644
index 90626c175b8bb496e2e1c18cc8a501d8eff44a87..eaad1404e690f1fe47a49df1447e31f068fcb0a2 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -971,7 +971,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -19,10 +19,10 @@ index 62867bc387f49398ebb5d608c4f1e4e562079bd7..ddbe5ece289235cf5b9a0e9d532ab9b8
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index c51d22285a253d4220ee967504ab9eef1403edbe..f434b1dc911ce45a4d309b892079a266f2485c90 100644
index 2f1e70a695b222dfa832b5d2c81544bc314b1aec..987c5d9c54d4fe101659c42a1113ecd5ab164a6c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -203,6 +203,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -202,6 +202,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey();
@@ -31,7 +31,7 @@ index c51d22285a253d4220ee967504ab9eef1403edbe..f434b1dc911ce45a4d309b892079a266
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
@@ -296,6 +298,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -294,6 +296,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end - optimise collisions
}

View File

@@ -22,7 +22,7 @@ index d6089c0d0b076d232834619bc93bc64f0be57340..c4577d7dc27bb48c95794212de4abf2e
// Paper - optimise chunk tick iteration
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ddbe5ece289235cf5b9a0e9d532ab9b8f1ff200c..1ed4e8b5feb4cad478ac6472b386ccb9b610a7de 100644
index eaad1404e690f1fe47a49df1447e31f068fcb0a2..e25361263cb354293d584b8f400c02065654b4b8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -974,6 +974,13 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@@ -22,10 +22,10 @@ index 37af0a508cfe56f23be806d2d4100d890ad5e7ec..89a50e07bc79cb0d5353f5a06fa037f3
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 0934de77256734d3dd50ea7e16662d49c3d58242..12f5a090affed70ba041f77fd0eacbeb4a700cb9 100644
index 987c5d9c54d4fe101659c42a1113ecd5ab164a6c..33dcb0c113614c7605ba750afb80459b68d78f99 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1791,6 +1791,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1789,6 +1789,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public ProfilerFiller getProfiler() {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Throttle goal selector during inactive ticking
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index e0cf7771488ab0065708d68b4e8550b865af0ed4..dc196d04afa8e74be1a43994212d17b430aad2ee 100644
index a7fbd329ea6d36a46c00b4476c74e426dbbfe238..f0e1318a0a7d7a409df8fc5567040de9da25b75d 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -221,11 +221,13 @@ public abstract class Mob extends LivingEntity implements Targeting {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Reduce entity allocations
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0cdfb9470c29132f75a5b3df05178626a56e4e6e..c4fb0f8e4aa77f8c6d77ad0ca9f8d985ea6cec3e 100644
index b989029d7425cf410698ff477a3622b4c629ada3..79b2831322b8312448c89b5276af40d1efa880d2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -439,6 +439,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Remove lambda from ticking guard
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1ed4e8b5feb4cad478ac6472b386ccb9b610a7de..fc2f0e767e079b9c7aba131e71f11eb8a8920be2 100644
index e25361263cb354293d584b8f400c02065654b4b8..3397a9f45a82e00b71578d82b6f5505288a79820 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -908,7 +908,24 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Wed, 17 Aug 2022 16:54:54 +0800
Subject: [PATCH] Async Pathfinding
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
But Pufferfish patch was ported downstream from the Petal fork
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 51295f0c5ee66a59a9847c4a4d4a7070fc17f62e..3c66bd015c493ab971c12be8e134fdaa13daa935 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -372,7 +372,7 @@ public final class LeavesConfig {
// only config now
public static boolean asyncPathfinding = false;
private static boolean asyncPathfindingLock = false;
- private static void asyncPathfinding() {
+ private static void asyncPathfinding() { // void
if (!asyncPathfindingLock) {
asyncPathfinding = getBoolean("settings.performance.async-pathfinding", asyncPathfinding);
asyncPathfindingLock = true;

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] InstantBlockUpdater Reintroduced
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 831a5795b08e9bb74649404d8ef767dc3f18f173..fa93fd1fbcc3b508e46a2d1df38bb2c7ca1903c2 100644
index 33dcb0c113614c7605ba750afb80459b68d78f99..e304b4977dd77bd770335accae697e7c7bc90ecc 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -70,6 +70,7 @@ import net.minecraft.world.level.lighting.LevelLightEngine;
@@ -17,7 +17,7 @@ index 831a5795b08e9bb74649404d8ef767dc3f18f173..fa93fd1fbcc3b508e46a2d1df38bb2c7
import net.minecraft.world.level.redstone.NeighborUpdater;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
import net.minecraft.world.level.storage.LevelData;
@@ -249,7 +250,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -247,7 +248,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.thread = Thread.currentThread();
this.biomeManager = new BiomeManager(this, i);
this.isDebug = flag1;

View File

@@ -62,7 +62,7 @@ index d9038d85f8a04381a92567acf1c8922d666aa3e8..b22dd3700c913d0391c8641fca46e89e
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 58f972832c39a27a8ccd606f9144e1c54adbf6f3..b2aae4463f2d0fc6ae03bbb9a63c5b8f08d67d43 100644
index a0d69082f5fdeee15bba0d76b940aa48cff36fa9..a8583c8a368466e9c9148b5620ec51cc1816711d 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -44,6 +44,7 @@ import org.bukkit.event.Event;

View File

@@ -19,14 +19,14 @@ index 5b446e6ac151f99f64f0c442d0b40b5e251bc4c4..c2eb3e8b019dbc0543a2308d7e88e324
final long timeout;
if (type == RegionizedPlayerChunkLoader.REGION_PLAYER_TICKET && delayTimeout > 0) {
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..8b0feb7f0d008e5b8a5294a014a0cd9b684707f2 100644
index fa1c0aee8c3a4d0868482cf5c703bbfd08e09874..c24148d8486420434922864df6f1ffa0b9929612 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -317,6 +317,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
for (ServerLevel level : server.getAllLevels()) {
this.createWorldConfig(createWorldContextMap(level), reloader(this.worldConfigClass, level.paperConfig()));
}
+ top.leavesmc.leaves.LeavesConfig.doMcTechnicalMode(); // Leaves - mc technical survival mode
+ top.leavesmc.leaves.util.McTechnicalModeHelper.doMcTechnicalModeIf(); // Leaves - mc technical survival mode
} catch (Exception ex) {
throw new RuntimeException("Could not reload paper configuration files", ex);
}
@@ -95,22 +95,28 @@ index 5eded2322d604c3a304194926a740818631f36de..797725f7472ed36bf5a1369a7dfe600a
!(entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL ||
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
continue;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 3c66bd015c493ab971c12be8e134fdaa13daa935..4c9793761cdb6fabddd939d1d9d20bf43e977b8e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -2,6 +2,7 @@ package top.leavesmc.leaves;
import com.destroystokyo.paper.util.SneakyThrow;
import com.google.common.base.Throwables;
diff --git a/src/main/java/top/leavesmc/leaves/util/McTechnicalModeHelper.java b/src/main/java/top/leavesmc/leaves/util/McTechnicalModeHelper.java
new file mode 100644
index 0000000000000000000000000000000000000000..b34ff1484e5d16d6ef5a948c792fd12d9bf284ed
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/util/McTechnicalModeHelper.java
@@ -0,0 +1,26 @@
+package top.leavesmc.leaves.util;
+
+import io.papermc.paper.configuration.GlobalConfiguration;
import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
@@ -492,6 +493,14 @@ public final class LeavesConfig {
public static void doMcTechnicalMode() {
if (mcTechnicalMode) {
+import top.leavesmc.leaves.LeavesConfig;
+
+import java.util.Map;
+
+public class McTechnicalModeHelper {
+
+ public static void doMcTechnicalModeIf() {
+ if (LeavesConfig.mcTechnicalMode) {
+ doMcTechnicalMode();
+ }
+ }
+
+ public static void doMcTechnicalMode() {
+ GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication = true;
+ GlobalConfiguration.get().unsupportedSettings.allowHeadlessPistons = true;
+ GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits = true;
@@ -119,6 +125,5 @@ index 3c66bd015c493ab971c12be8e134fdaa13daa935..4c9793761cdb6fabddd939d1d9d20bf4
+ GlobalConfiguration.get().packetLimiter.overrides = Map.of();
+ GlobalConfiguration.get().unsupportedSettings.allowGrindstoneOverstacking = true;
+ GlobalConfiguration.get().itemValidation.resolveSelectorsInBooks = true;
}
}
+ }
+}

View File

@@ -56,28 +56,6 @@ index 89a50e07bc79cb0d5353f5a06fa037f3942c5940..760b1fb833fea279062965002686b57f
private long lastServerStatus;
public final Thread serverThread;
private long nextTickTimeNanos;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 4c9793761cdb6fabddd939d1d9d20bf43e977b8e..6f08cdecbc1175ca2808a4d798252b91341c88eb 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import top.leavesmc.leaves.command.LeavesCommand;
import top.leavesmc.leaves.bot.BotCommand;
import top.leavesmc.leaves.bot.agent.Actions;
+import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
import top.leavesmc.leaves.util.MathUtils;
import java.io.File;
@@ -529,6 +530,9 @@ public final class LeavesConfig {
extraYggdrasilLoginProtect = getBoolean("settings.misc.extra-yggdrasil-service.login-protect", extraYggdrasilLoginProtect);
extraYggdrasilServiceList = getList("settings.misc.extra-yggdrasil-service.urls", extraYggdrasilServiceList);
if (extraYggdrasilService) {
+ LeavesLogger.LOGGER.warning("extra-yggdrasil-service is an unofficial support. Enabling it may cause data security problems!");
+ GlobalConfiguration.get().unsupportedSettings.performUsernameValidation = true; // always check user name
+ LeavesMinecraftSessionService.initExtraYggdrasilList();
}
}
diff --git a/src/main/java/top/leavesmc/leaves/profile/LeavesAuthenticationService.java b/src/main/java/top/leavesmc/leaves/profile/LeavesAuthenticationService.java
new file mode 100644
index 0000000000000000000000000000000000000000..3da207a13fce243bf880c8a4f7054cf20997991d

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Use vanilla random config
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 76508bdb3331f8b33d1b7575e8500cef3fa7e8f4..e4ad454fed1d4f615621c7973598f8106f57b5ab 100644
index 1f3a8f314832acc575e7d9d054eaa09ab6fdd1e4..042653db5ec360e0dc67b7457b742432b76458a6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -547,7 +547,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Syncmatica Protocol
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ae7cf2b0a90044e93360fc914573c6a549cb6731..eacc68696f8d78114c7129b390e1a1e915f29223 100644
index 0fe509e4e47cfb9d2a96704a35f7532865684db8..8cae2004b3ffec981be1fe277a97321843f4a2cf 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -313,6 +313,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -26,26 +26,6 @@ index ae7cf2b0a90044e93360fc914573c6a549cb6731..eacc68696f8d78114c7129b390e1a1e9
@Override
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 6f08cdecbc1175ca2808a4d798252b91341c88eb..9214b89a27b2f922971c58f3e49058ea9887959c 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -12,6 +12,7 @@ import top.leavesmc.leaves.command.LeavesCommand;
import top.leavesmc.leaves.bot.BotCommand;
import top.leavesmc.leaves.bot.agent.Actions;
import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
+import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
import top.leavesmc.leaves.util.MathUtils;
import java.io.File;
@@ -567,6 +568,7 @@ public final class LeavesConfig {
syncmaticaQuota = getBoolean("settings.protocol.syncmatica.quota", syncmaticaQuota);
syncmaticaQuotaLimit = getInt("settings.protocol.syncmatica.quota-limit", syncmaticaQuotaLimit);
if (syncmaticaProtocol) {
+ SyncmaticaProtocol.init();
}
}
diff --git a/src/main/java/top/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java b/src/main/java/top/leavesmc/leaves/protocol/syncmatica/CommunicationManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..fc229f23076147304754a267bcc345cc836b648b

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Disable distance check for UseItemOnPacket
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index eacc68696f8d78114c7129b390e1a1e915f29223..6e70d8832ca06367573b0c8066a5d9fe41c0d9cf 100644
index 8cae2004b3ffec981be1fe277a97321843f4a2cf..bcd90c6a9173d2b089995cd1049e0db1d7316719 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1936,7 +1936,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl

View File

@@ -4,28 +4,6 @@ Date: Tue, 27 Jun 2023 01:54:43 +0800
Subject: [PATCH] Leaves carpet support
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 9214b89a27b2f922971c58f3e49058ea9887959c..d9a11d6228f3ea86705503d394e6632deda8e1ef 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -14,6 +14,8 @@ import top.leavesmc.leaves.bot.agent.Actions;
import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
import top.leavesmc.leaves.util.MathUtils;
+import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
+import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
@@ -611,6 +613,8 @@ public final class LeavesConfig {
}
public static void registerCarpetRules() {
+ CarpetRules.register(CarpetRule.of("carpet", "creativeNoClip", creativeNoClip));
+ CarpetRules.register(CarpetRule.of("pca", "avoidAnvilTooExpensive", avoidAnvilTooExpensive));
}
public static boolean creativeNoClip = false;
diff --git a/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/CarpetServerProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..207bbbdf462d12f39273eee1b1552477be35346f

View File

@@ -91,29 +91,6 @@ index 2708251ebc1995e71fb0e5dca9e158a3005f8a8a..e28351b379677fec356b6efec2d882ee
NeighborUpdater.executeUpdate(this.level, state, pos, sourceBlock, sourcePos, notify);
}
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index d9a11d6228f3ea86705503d394e6632deda8e1ef..d90a36e1a512842dc322787cc767239a34e895af 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import top.leavesmc.leaves.command.LeavesCommand;
import top.leavesmc.leaves.bot.BotCommand;
import top.leavesmc.leaves.bot.agent.Actions;
+import top.leavesmc.leaves.command.NoBlockUpdateCommand;
import top.leavesmc.leaves.profile.LeavesMinecraftSessionService;
import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
import top.leavesmc.leaves.util.MathUtils;
@@ -83,6 +84,10 @@ public final class LeavesConfig {
commands.put("bot", new BotCommand("bot"));
Actions.registerAll();
}
+
+ if (LeavesConfig.noBlockUpdateCommand) {
+ commands.put("blockupdate", new NoBlockUpdateCommand("blockupdate"));
+ }
}
public static void load(final YamlConfiguration config) {
diff --git a/src/main/java/top/leavesmc/leaves/command/NoBlockUpdateCommand.java b/src/main/java/top/leavesmc/leaves/command/NoBlockUpdateCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..819d5a5383dc6978f53645b727722fa924b7a505

View File

@@ -4,38 +4,6 @@ Date: Fri, 7 Jul 2023 16:50:06 +0800
Subject: [PATCH] Bladeren Protocol
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index d90a36e1a512842dc322787cc767239a34e895af..73a951413c1518895bf8a0efb6267ba4c57d71e9 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -17,6 +17,8 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
import top.leavesmc.leaves.util.MathUtils;
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
+import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet;
+import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
@@ -76,6 +78,7 @@ public final class LeavesConfig {
LeavesConfig.load(config);
registerCarpetRules();
+ registerLeavesFeatures();
commands = new HashMap<>();
commands.put("leaves", new LeavesCommand("leaves"));
@@ -855,6 +858,10 @@ public final class LeavesConfig {
}
public static void registerLeavesFeatures() {
+ LeavesFeatureSet.register(LeavesFeature.of("lava_riptide", lavaRiptide));
+ LeavesFeatureSet.register(LeavesFeature.of("mspt_sync", msptSyncProtocol));
+ LeavesFeatureSet.register(LeavesFeature.of("loot_world_random", lootWorldRandom));
+ LeavesFeatureSet.register(LeavesFeature.of("use_vanilla_random", useVanillaRandom));
}
public static boolean hopperCounter = false;
diff --git a/src/main/java/top/leavesmc/leaves/protocol/bladeren/BladerenProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/bladeren/BladerenProtocol.java
new file mode 100644
index 0000000000000000000000000000000000000000..a91011c7a2c56646053bb9d158ff0c265c658c00

View File

@@ -504,7 +504,7 @@ index 6c2e8049c2197ddc912c1a0fc99c87beae81e25b..be13baa7b51c4ad377b50d8ca8f7cfad
private static Enchantment register(String name, Enchantment enchantment) {
return Registry.register(BuiltInRegistries.ENCHANTMENT, name, enchantment);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index bae8f999f4d9e798d87018cca3ff9c98c9337aab..ea3db1021a076d7b0560676ef2b916f7b0e514db 100644
index e304b4977dd77bd770335accae697e7c7bc90ecc..6517b7f2c21c971b6af3324c5a91bc17a052f349 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -97,6 +97,7 @@ import org.bukkit.craftbukkit.util.CraftSpawnCategory;
@@ -515,7 +515,7 @@ index bae8f999f4d9e798d87018cca3ff9c98c9337aab..ea3db1021a076d7b0560676ef2b916f7
public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1847,7 +1848,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1845,7 +1846,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Use optimized collection
This patch is Powered by Gale(https://github.com/GaleMC/Gale)
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 2e3061b3874764fa2bde068486fa0c03a6b6a6f4..a6eef599ce6023925328d68454a6570d56f07cda 100644
index 6edd6ae82a049d988331a22af8440ffacf0a6bbe..61a84fd1aeaa4ddd506a1879183c532540a055a6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -237,7 +237,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -84,7 +84,7 @@ index 4f2fa47d094348bb8f86a86e808019ddba56e187..e6938589bf12ccd401cc6700cfa5f28c
// Paper start
int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1;
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 478dcee61e4cb5e0691ce52a3be2e307f6d4af64..38f3644ffe7fd13f13b928ee8568860a23d7c69d 100644
index c498d397938c973608634867366aea8bfad7b3c9..96bf3845f5c76363726ebb934ab008c4c1807f26 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -62,6 +62,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;

View File

@@ -5,21 +5,21 @@ Subject: [PATCH] Leaves update command
diff --git a/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java b/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java
index e89bf96486c87cdff6c1a425afd10d744376c77f..8027a27b253db02570c2f28ebb200001b76a1fc3 100644
index 9b6fb546a672fa5b27047fec638e42b2b5dbf533..abf5c05cd5b54b53a192cc452f0e12c43f1fa2fa 100644
--- a/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java
+++ b/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java
@@ -12,6 +12,7 @@ import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginManager;
@@ -13,6 +13,7 @@ import org.bukkit.plugin.PluginManager;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull;
import top.leavesmc.leaves.command.subcommands.ConfigCommand;
+import top.leavesmc.leaves.command.subcommands.UpdateCommand;
import java.util.ArrayList;
import java.util.Arrays;
@@ -31,6 +32,7 @@ public final class LeavesCommand extends Command {
// subcommand label -> subcommand
@@ -33,6 +34,7 @@ public final class LeavesCommand extends Command {
private static final Map<String, LeavesSubcommand> SUBCOMMANDS = Util.make(() -> {
final Map<Set<String>, LeavesSubcommand> commands = new HashMap<>();
commands.put(Set.of("config"), new ConfigCommand());
+ commands.put(Set.of("update"), new UpdateCommand());
return commands.entrySet().stream()

View File

@@ -130,20 +130,20 @@ index 38d842bc0fb7d9c39a3673983a643248e9563fe2..8f57c3805547354af3f5167acc7efca9
if (!this.persistentDataContainer.isEmpty()) {
c.put("BukkitValues", this.persistentDataContainer.toTagCompound());
diff --git a/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java b/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java
index 8027a27b253db02570c2f28ebb200001b76a1fc3..da1f7ce2db23c509c70f673c8bb1c46af2ed7279 100644
index abf5c05cd5b54b53a192cc452f0e12c43f1fa2fa..5efdb9b5138738da7cfc075ce0be531d2608577e 100644
--- a/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java
+++ b/src/main/java/top/leavesmc/leaves/command/LeavesCommand.java
@@ -12,6 +12,7 @@ import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginManager;
@@ -13,6 +13,7 @@ import org.bukkit.plugin.PluginManager;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull;
import top.leavesmc.leaves.command.subcommands.ConfigCommand;
+import top.leavesmc.leaves.command.subcommands.PeacefulModeSwitchCommand;
import top.leavesmc.leaves.command.subcommands.UpdateCommand;
import java.util.ArrayList;
@@ -33,6 +34,7 @@ public final class LeavesCommand extends Command {
private static final Map<String, LeavesSubcommand> SUBCOMMANDS = Util.make(() -> {
@@ -35,6 +36,7 @@ public final class LeavesCommand extends Command {
final Map<Set<String>, LeavesSubcommand> commands = new HashMap<>();
commands.put(Set.of("config"), new ConfigCommand());
commands.put(Set.of("update"), new UpdateCommand());
+ commands.put(Set.of("peaceful"), new PeacefulModeSwitchCommand());

View File

@@ -4,28 +4,8 @@ Date: Sun, 6 Aug 2023 09:57:53 +0800
Subject: [PATCH] Add Leaves Auto Update
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 73a951413c1518895bf8a0efb6267ba4c57d71e9..f0caa9a182b1fe2a1b1e0a02c878afc0e61771a1 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -17,6 +17,7 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
import top.leavesmc.leaves.util.MathUtils;
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRule;
import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
+import top.leavesmc.leaves.util.LeavesUpdateHelper;
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeatureSet;
import top.leavesmc.leaves.protocol.bladeren.BladerenProtocol.LeavesFeature;
@@ -827,6 +828,7 @@ public final class LeavesConfig {
private static void autoUpdate() {
autoUpdate = getBoolean("settings.misc.auto-update.enable", autoUpdate);
autoUpdateTime = getList("settings.misc.auto-update.time", autoUpdateTime);
+ LeavesUpdateHelper.init();
if (autoUpdate) {
LeavesLogger.LOGGER.warning("Auto-Update is not completely safe. Enabling it may cause data security problems!");
}
diff --git a/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java b/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java
index 9b18d711191aa26c9afea85fc901e422e8f8496c..35a9ea436b86137d0329b16489e3fb3bbdedee48 100644
index e7060b91a27b1d0cddb14c155caaa0e78a043e20..68400212f121f57d3dfa0c3e5ccb2346ae95eb02 100644
--- a/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java
+++ b/src/main/java/top/leavesmc/leaves/util/LeavesUpdateHelper.java
@@ -7,8 +7,11 @@ import com.google.gson.JsonElement;

View File

@@ -334,7 +334,7 @@ index 5e156b229f132626ed1e15a92302f8c4e06b47db..a7eb6319f274c3fc7071251fe3a6aedb
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
UUID uuid = entityplayer.getUUID();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 602d913b144c6d565e09c5623859c40775a4fcca..48d105c48c51b006493de29baef4fe7236886eef 100644
index 1dc51050065af9bfc760f0a2cd7a479817888280..3997e5b56d99cb7374a0983ddb12caac12776b07 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -260,6 +260,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@@ -362,7 +362,7 @@ index 602d913b144c6d565e09c5623859c40775a4fcca..48d105c48c51b006493de29baef4fe72
@Override
public CraftPlayer apply(ServerPlayer player) {
return player.getBukkitEntity();
@@ -3255,4 +3257,11 @@ public final class CraftServer implements Server {
@@ -3253,4 +3255,11 @@ public final class CraftServer implements Server {
return botManager;
}
// Leaves end - Bot API

View File

@@ -51,12 +51,12 @@ index 571fdf253ebc5cf2a3ec120c53293b37b770836d..800cadbb379cb90d5351c6d73f994713
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
BiConsumer<String, String> biConsumer = builder::put;
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 4b13af14fcbe1925f9d3104d95ebbfbc596cfb3c..2225401b9b864d58803cfd76357c4e9f7d97e5ec 100644
index d4932ba7042b897a8561103367d0b7cf9a08234c..e23d90e2952efbab58e43b795550ae0db7b3c883 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -223,6 +223,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -222,6 +222,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
top.leavesmc.leaves.LeavesConfig.init((java.io.File) options.valueOf("leaves-settings")); // Leaves - Server Config
top.leavesmc.leaves.LeavesConfig.registerCommands(); // Leaves - Server Command
System.setProperty("spark.serverconfigs.extra", "leaves.yml"); // Leaves - spark config
+ net.minecraft.locale.Language.loadI18N(top.leavesmc.leaves.LeavesConfig.serverLang); // Leaves - i18n

Some files were not shown because too many files have changed in this diff Show More