diff --git a/patches/server/0009-Fakeplayer-support.patch b/patches/server/0009-Fakeplayer-support.patch index c5dba0aa..99967993 100644 --- a/patches/server/0009-Fakeplayer-support.patch +++ b/patches/server/0009-Fakeplayer-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fakeplayer support diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cab8412d5183427b02c5f5d7b76aded8e9fbc491..9904aa8178bf64768a646dbc886cb774cb013af9 100644 +index cab8412d5183427b02c5f5d7b76aded8e9fbc491..811e52d1dada0858348c162e80aec630da3283a7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -125,6 +125,7 @@ import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvi @@ -16,19 +16,23 @@ index cab8412d5183427b02c5f5d7b76aded8e9fbc491..9904aa8178bf64768a646dbc886cb774 import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.ai.village.VillageSiege; import net.minecraft.world.entity.npc.CatSpawner; -@@ -193,6 +194,7 @@ import org.bukkit.event.server.ServerLoadEvent; - // CraftBukkit end +@@ -632,6 +633,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { - -@@ -939,6 +941,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop itemStackList) { @@ -623,6 +635,41 @@ index 0000000000000000000000000000000000000000..5a66ebb4c3c15162fab7be4fd0a16044 + public static boolean isDamage(@NotNull ItemStack item, int minDamage) { + return item.isDamageableItem() && (item.getMaxDamage() - item.getDamageValue()) <= minDamage; + } ++ ++ @NotNull ++ public static JsonObject saveBot(@NotNull ServerBot bot) { ++ double pos_x = bot.getX(); ++ double pos_y = bot.getY(); ++ double pos_z = bot.getZ(); ++ float yaw = bot.getYRot(); ++ float pitch = bot.getXRot(); ++ String dimension = bot.level.dimension().location().getPath(); ++ String skin = bot.skinName == null ? "null" : bot.skinName; ++ JsonObject fakePlayer = new JsonObject(); ++ fakePlayer.addProperty("pos_x", pos_x); ++ fakePlayer.addProperty("pos_y", pos_y); ++ fakePlayer.addProperty("pos_z", pos_z); ++ fakePlayer.addProperty("yaw", yaw); ++ fakePlayer.addProperty("pitch", pitch); ++ fakePlayer.addProperty("dimension", dimension); ++ fakePlayer.addProperty("skin", skin); ++ return fakePlayer; ++ } ++ ++ public static void loadBot(Map.@NotNull Entry entry) { ++ String username = entry.getKey(); ++ JsonObject fakePlayer = entry.getValue().getAsJsonObject(); ++ double pos_x = fakePlayer.get("pos_x").getAsDouble(); ++ double pos_y = fakePlayer.get("pos_y").getAsDouble(); ++ double pos_z = fakePlayer.get("pos_z").getAsDouble(); ++ float yaw = fakePlayer.get("yaw").getAsFloat(); ++ float pitch = fakePlayer.get("pitch").getAsFloat(); ++ String dimension = fakePlayer.get("dimension").getAsString(); ++ String skin = fakePlayer.get("skin").getAsString(); ++ skin = skin.equals("null") ? null : skin; ++ ServerBot.createBot(new Location(Bukkit.getWorld(dimension), pos_x, pos_y, pos_z, yaw, pitch), ++ username, skin); ++ } +} diff --git a/src/main/java/top/leavesmc/leaves/bot/MojangAPI.java b/src/main/java/top/leavesmc/leaves/bot/MojangAPI.java new file mode 100644 @@ -673,13 +720,16 @@ index 0000000000000000000000000000000000000000..d6466ee4db637106e1394bb462d875e5 +} 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..4f3c5ab80f721b6cb40ea005dab47c8a60fa5416 +index 0000000000000000000000000000000000000000..0dbaf5f409a616e20286cdba93846268d60f1e4a --- /dev/null +++ b/src/main/java/top/leavesmc/leaves/bot/ServerBot.java -@@ -0,0 +1,700 @@ +@@ -0,0 +1,759 @@ +package top.leavesmc.leaves.bot; + +import com.google.common.collect.Lists; ++import com.google.gson.Gson; ++import com.google.gson.JsonElement; ++import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import com.mojang.datafixers.util.Pair; @@ -711,6 +761,7 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.MoverType; +import net.minecraft.world.entity.item.ItemEntity; ++import net.minecraft.world.level.storage.LevelResource; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.Vec3; +import org.bukkit.Bukkit; @@ -739,11 +790,18 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a +import top.leavesmc.leaves.util.MathUtils; + +import javax.annotation.Nullable; ++import java.io.BufferedReader; ++import java.io.BufferedWriter; ++import java.io.File; ++import java.io.IOException; ++import java.nio.charset.StandardCharsets; ++import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; ++import java.util.Map; +import java.util.Objects; +import java.util.UUID; + @@ -765,11 +823,16 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a + + private final ItemStack defaultItem; + private final ServerStatsCounter stats; ++ public final String skinName; + + private static final List bots = new ArrayList<>(); + private static final Plugin MINECRAFT_PLUGIN = new MinecraftInternalPlugin(); + + private ServerBot(MinecraftServer server, ServerLevel world, GameProfile profile) { ++ this(server, world, profile, null); ++ } ++ ++ private ServerBot(MinecraftServer server, ServerLevel world, GameProfile profile, String skinName) { + super(server, world, profile); + this.entityData.set(new EntityDataAccessor<>(16, EntityDataSerializers.INT), 0xFF); + @@ -782,6 +845,7 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a + this.defaultItem = new ItemStack(Material.AIR); + this.removeOnDeath = true; + this.stats = new BotStatsCounter(server); ++ this.skinName = skinName; + server.getPlayerList().addNewBot(this); + } + @@ -793,15 +857,15 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a + if (skinName != null) { + Bukkit.getScheduler().runTaskAsynchronously(MINECRAFT_PLUGIN, () -> { + String[] skin = MojangAPI.getSkin(skinName); -+ Bukkit.getScheduler().runTask(MINECRAFT_PLUGIN, () -> createBot(loc, realName, skin)); ++ Bukkit.getScheduler().runTask(MINECRAFT_PLUGIN, () -> createBot(loc, realName, skin, skinName)); + }); + } else { -+ createBot(loc, realName, (String[]) null); ++ createBot(loc, realName, null, null); + } + } + + @Nullable -+ public static ServerBot createBot(@NotNull Location loc, @NotNull String name, String[] skin) { ++ public static ServerBot createBot(@NotNull Location loc, @NotNull String name, String[] skin, String skinName) { + if (!isCreateLegal(name)) { + return null; + } @@ -817,7 +881,7 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a + UUID uuid = UUID.randomUUID(); + CustomGameProfile profile = new CustomGameProfile(uuid, name.length() > 16 ? name.substring(0, 16) : name, skin); + -+ ServerBot bot = new ServerBot(server, world, profile); ++ ServerBot bot = new ServerBot(server, world, profile, skinName); + + bot.connection = new ServerGamePacketListenerImpl(server, new Connection(PacketFlow.CLIENTBOUND) { + @Override @@ -1349,6 +1413,48 @@ index 0000000000000000000000000000000000000000..4f3c5ab80f721b6cb40ea005dab47c8a + return bot; + } + ++ public static void saveAllBot() { ++ if (LeavesConfig.fakeplayerSupport && LeavesConfig.fakeplayerResident) { ++ JsonObject fakePlayerList = new JsonObject(); ++ bots.forEach((bot -> { ++ String name = bot.getName().getString(); ++ fakePlayerList.add(name, BotUtil.saveBot(bot)); ++ })); ++ File file = MinecraftServer.getServer().getWorldPath(LevelResource.ROOT).resolve("fake_player.leaves.json").toFile(); ++ if (!file.isFile()) { ++ try { ++ file.createNewFile(); ++ } catch (IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ try (BufferedWriter bfw = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { ++ bfw.write(new Gson().toJson(fakePlayerList)); ++ } catch (IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ } ++ ++ public static void loadAllBot() { ++ if (LeavesConfig.fakeplayerSupport && LeavesConfig.fakeplayerResident) { ++ JsonObject fakePlayerList = new JsonObject(); ++ File file = MinecraftServer.getServer().getWorldPath(LevelResource.ROOT).resolve("fake_player.leaves.json").toFile(); ++ if (!file.isFile()) { ++ return; ++ } ++ try (BufferedReader bfr = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) { ++ fakePlayerList = new Gson().fromJson(bfr, JsonObject.class); ++ } catch (IOException e) { ++ e.printStackTrace(); ++ } ++ for (Map.Entry entry : fakePlayerList.entrySet()) { ++ BotUtil.loadBot(entry); ++ } ++ file.delete(); ++ } ++ } ++ + public static boolean removeAllBot() { + Iterator iterator = bots.iterator(); + while (iterator.hasNext()) { diff --git a/patches/server/0010-Make-shears-in-dispenser-can-unlimited-use.patch b/patches/server/0010-Make-shears-in-dispenser-can-unlimited-use.patch index fc5a2f2f..72aa5144 100644 --- a/patches/server/0010-Make-shears-in-dispenser-can-unlimited-use.patch +++ b/patches/server/0010-Make-shears-in-dispenser-can-unlimited-use.patch @@ -18,7 +18,7 @@ index d1127d93a85a837933d0d73c24cacac4adc3a5b9..bca725f614893458f825768e8dfb6ff9 } } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 746b3873782d3ee13a30b8b65b4970b140b6f0fc..adb206f659631537f0d42e53dc6a1c290898d508 100644 +index a3aceccc7f2d1e8a525ac849c3818d8de4047ed1..5c9f5ef69f075ae10a92049a67605cbc63aea4c6 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -104,10 +104,12 @@ public final class LeavesConfig { @@ -34,8 +34,8 @@ index 746b3873782d3ee13a30b8b65b4970b140b6f0fc..adb206f659631537f0d42e53dc6a1c29 } } -@@ -177,6 +179,11 @@ public final class LeavesConfig { - alwaysSendFakeplayerData = getBoolean("settings.modify.fakeplayer.always-send-data", alwaysSendFakeplayerData); +@@ -179,6 +181,11 @@ public final class LeavesConfig { + fakeplayerResident = getBoolean("settings.modify.fakeplayer.resident-fakeplayer", fakeplayerResident); } + public static boolean shearsInDispenserCanZeroAmount = false; diff --git a/patches/server/0011-Redstone-Shears-Wrench.patch b/patches/server/0011-Redstone-Shears-Wrench.patch index 1ca81fef..1bf51099 100644 --- a/patches/server/0011-Redstone-Shears-Wrench.patch +++ b/patches/server/0011-Redstone-Shears-Wrench.patch @@ -98,7 +98,7 @@ index e77af779c77de6d5580c13699df3e7d890fe7aba..c9310e88b3a967cb9cacb80288e74757 + // Leaves end - shears wrench } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index adb206f659631537f0d42e53dc6a1c290898d508..2cdf760ca9e1a53965e313bc9c067e9214d0b91b 100644 +index 5c9f5ef69f075ae10a92049a67605cbc63aea4c6..f5a0193e581a875039ab27cc23acc4be3d0772f3 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -105,11 +105,13 @@ public final class LeavesConfig { @@ -115,7 +115,7 @@ index adb206f659631537f0d42e53dc6a1c290898d508..2cdf760ca9e1a53965e313bc9c067e92 } } -@@ -184,6 +186,11 @@ public final class LeavesConfig { +@@ -186,6 +188,11 @@ public final class LeavesConfig { shearsInDispenserCanZeroAmount = getBoolean("settings.modify.shears-in-dispenser-can-zero-amount", shearsInDispenserCanZeroAmount); } diff --git a/patches/server/0013-Budding-Amethyst-can-push-by-piston.patch b/patches/server/0013-Budding-Amethyst-can-push-by-piston.patch index d0fecd57..c3f046d3 100644 --- a/patches/server/0013-Budding-Amethyst-can-push-by-piston.patch +++ b/patches/server/0013-Budding-Amethyst-can-push-by-piston.patch @@ -21,7 +21,7 @@ index bedccb8717d08d5a60058445b04ddff149e7d36c..2b452ae8d26107973f503451164f65de } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 2cdf760ca9e1a53965e313bc9c067e9214d0b91b..fa2a3b3683b45992cea5d01376cd84fe5b668be8 100644 +index f5a0193e581a875039ab27cc23acc4be3d0772f3..1a7f70fc937647486f87345c499cea5f243118d9 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -106,12 +106,14 @@ public final class LeavesConfig { @@ -39,7 +39,7 @@ index 2cdf760ca9e1a53965e313bc9c067e9214d0b91b..fa2a3b3683b45992cea5d01376cd84fe } } -@@ -191,6 +193,11 @@ public final class LeavesConfig { +@@ -193,6 +195,11 @@ public final class LeavesConfig { redstoneShearsWrench = getBoolean("settings.modify.redstone-shears-wrench", redstoneShearsWrench); } diff --git a/patches/server/0014-Spectator-dont-get-Advancement.patch b/patches/server/0014-Spectator-dont-get-Advancement.patch index 94d062b2..22712fdd 100644 --- a/patches/server/0014-Spectator-dont-get-Advancement.patch +++ b/patches/server/0014-Spectator-dont-get-Advancement.patch @@ -29,7 +29,7 @@ index 8873e12cbd3d6f9071efedb35ea3c69c78033d78..1fdaa8a9993dd6881877a3b00b02487a AdvancementProgress advancementprogress = this.getOrStartProgress(advancement); boolean flag1 = advancementprogress.isDone(); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index fa2a3b3683b45992cea5d01376cd84fe5b668be8..561a8141dcd5fba8d03afc95d0df735729ee87ee 100644 +index 1a7f70fc937647486f87345c499cea5f243118d9..eff8e2f83a52b2ec32b2b8cef04cb810ad229011 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -107,6 +107,7 @@ public final class LeavesConfig { @@ -48,7 +48,7 @@ index fa2a3b3683b45992cea5d01376cd84fe5b668be8..561a8141dcd5fba8d03afc95d0df7357 } } -@@ -197,6 +199,11 @@ public final class LeavesConfig { +@@ -199,6 +201,11 @@ public final class LeavesConfig { private static void buddingAmethystCanPushByPiston() { buddingAmethystCanPushByPiston = getBoolean("settings.modify.budding-amethyst-can-push-by-piston", buddingAmethystCanPushByPiston); } diff --git a/patches/server/0015-Stick-can-change-ArmorStand-arm-status.patch b/patches/server/0015-Stick-can-change-ArmorStand-arm-status.patch index 7f20e6a3..ebee07ba 100644 --- a/patches/server/0015-Stick-can-change-ArmorStand-arm-status.patch +++ b/patches/server/0015-Stick-can-change-ArmorStand-arm-status.patch @@ -22,7 +22,7 @@ index b136cdc13d94bc34c998a1986e0c93525356ac5c..a1dd65d71606e1da07be781bf95a3268 return InteractionResult.FAIL; } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 561a8141dcd5fba8d03afc95d0df735729ee87ee..3a982e2bb5b19ebdd4500d7bc651e6bf420a0e9f 100644 +index eff8e2f83a52b2ec32b2b8cef04cb810ad229011..5965ca2990caa88876be9b7a2400b24bd760193d 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java @@ -108,6 +108,7 @@ public final class LeavesConfig { @@ -41,7 +41,7 @@ index 561a8141dcd5fba8d03afc95d0df735729ee87ee..3a982e2bb5b19ebdd4500d7bc651e6bf } } -@@ -204,6 +206,11 @@ public final class LeavesConfig { +@@ -206,6 +208,11 @@ public final class LeavesConfig { private static void spectatorDontGetAdvancement() { spectatorDontGetAdvancement = getBoolean("settings.modify.spectator-dont-get-advancement", spectatorDontGetAdvancement); } diff --git a/patches/server/0017-No-chat-sign.patch b/patches/server/0017-No-chat-sign.patch index 320dc967..55edc72d 100644 --- a/patches/server/0017-No-chat-sign.patch +++ b/patches/server/0017-No-chat-sign.patch @@ -138,10 +138,10 @@ index 6e0a3086da142f1c42007a16bbec7edbab17da04..776be7f58746f96fe9bf7daf11053d39 } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9904aa8178bf64768a646dbc886cb774cb013af9..7347cb4daf40996a559c2a4dec9b22b04d07ae53 100644 +index 811e52d1dada0858348c162e80aec630da3283a7..a3b545dd722f912a64a0d0dc92525f0f0f86b7ea 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1109,6 +1109,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return !entry.getValue().isStillValid(time); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 6ed61312bf9d263f4fe8e5717a6d48667b26f683..cbfb3e1cb2cf04b6774c78ef5c76f67bf38ed39e 100644 +index 6820cfaef561f337c66b5fd67b6c28b965b72e6f..33d7872fd42f356d91ce5c54d5d2901abdd240f3 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -285,6 +285,11 @@ public final class LeavesConfig { +@@ -287,6 +287,11 @@ public final class LeavesConfig { } } diff --git a/patches/server/0029-Early-return-optimization-for-target-finding.patch b/patches/server/0029-Early-return-optimization-for-target-finding.patch index d749a9bf..521f5b8d 100644 --- a/patches/server/0029-Early-return-optimization-for-target-finding.patch +++ b/patches/server/0029-Early-return-optimization-for-target-finding.patch @@ -29,10 +29,10 @@ index a7575b5ef56af6f53448d391abb4956e130148ca..e2764cbc888be39943728ff810e1e44b return false; } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index cbfb3e1cb2cf04b6774c78ef5c76f67bf38ed39e..912d86c188f6422c920e1f355a81e3ad0c21e56b 100644 +index 33d7872fd42f356d91ce5c54d5d2901abdd240f3..41c8ba388c1a2026fce9765344da2324d487a81a 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -289,6 +289,11 @@ public final class LeavesConfig { +@@ -291,6 +291,11 @@ public final class LeavesConfig { private static void skipPOIFindingInVehicle() { skipPOIFindingInVehicle = getBoolean("settings.performance.skip-poi-find-in-vehicle", skipPOIFindingInVehicle); } diff --git a/patches/server/0030-Use-thread-unsafe-random-for-mob-spawning.patch b/patches/server/0030-Use-thread-unsafe-random-for-mob-spawning.patch index 55210e92..481a82a3 100644 --- a/patches/server/0030-Use-thread-unsafe-random-for-mob-spawning.patch +++ b/patches/server/0030-Use-thread-unsafe-random-for-mob-spawning.patch @@ -38,10 +38,10 @@ index dca0d9611593a0f3b921b314b4b458cc95f08ebc..612d536f8a1b4e45d7431dc8bbd1c7aa public static boolean isValidEmptySpawnBlock(BlockGetter blockView, BlockPos pos, BlockState state, FluidState fluidState, EntityType entityType) { diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 912d86c188f6422c920e1f355a81e3ad0c21e56b..a55d962816739265f71d691412d72c8a746e4988 100644 +index 41c8ba388c1a2026fce9765344da2324d487a81a..c651fea47720c49af4ff3f4af192c878b98c2453 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -295,6 +295,11 @@ public final class LeavesConfig { +@@ -297,6 +297,11 @@ public final class LeavesConfig { entityTargetFindingOptimization = getBoolean("settings.performance.entity-target-find-optimization", entityTargetFindingOptimization); } diff --git a/patches/server/0031-Config-to-disable-method-profiler.patch b/patches/server/0031-Config-to-disable-method-profiler.patch index e67f7211..14d8f508 100644 --- a/patches/server/0031-Config-to-disable-method-profiler.patch +++ b/patches/server/0031-Config-to-disable-method-profiler.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Config to disable method profiler This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 81699351c4f9aa3a66270bcee060a504263cbed4..f834a809431ca3667be0c74d8fcbe9db46cbda22 100644 +index 9c8d1043e7c23f1c61c48364d7266e1f8b568262..253a80121043d124dd1c1f2bbf1418d6d3a2e10b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2246,6 +2246,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop parameter) { diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index e20b518013fc6ee858b966050c8a85b29302b7ae..0529d3254fc591a368759903a16cbd281e02518b 100644 +index 3df8b025fce50491c644bde0e8b05c3d5329a8c6..8570b5d9ca7aa0e9253d3e481c68fe13c8df25f4 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -310,6 +310,11 @@ public final class LeavesConfig { +@@ -312,6 +312,11 @@ public final class LeavesConfig { throttleInactiveGoalSelectorTick = getBoolean("settings.performance.inactive-goal-selector-disable", throttleInactiveGoalSelectorTick); } diff --git a/patches/server/0034-Reduce-entity-allocations.patch b/patches/server/0034-Reduce-entity-allocations.patch index cc83905c..fce4ca1d 100644 --- a/patches/server/0034-Reduce-entity-allocations.patch +++ b/patches/server/0034-Reduce-entity-allocations.patch @@ -54,10 +54,10 @@ index dd1102d5291ef6f18e82400a6d8a0a376cc071e9..53c094c8a674b2842009727569e7e1f6 @Nullable diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 0529d3254fc591a368759903a16cbd281e02518b..42b78a401f66597888bf769ddffd35a7edc337a8 100644 +index 8570b5d9ca7aa0e9253d3e481c68fe13c8df25f4..c51f15356dd018925afe3c3c877f410d0e9966fe 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -315,6 +315,11 @@ public final class LeavesConfig { +@@ -317,6 +317,11 @@ public final class LeavesConfig { skipCloneLootParameters = getBoolean("settings.performance.skip-clone-loot-parameters", skipCloneLootParameters); } diff --git a/patches/server/0035-Remove-lambda-from-ticking-guard.patch b/patches/server/0035-Remove-lambda-from-ticking-guard.patch index a5a6f48e..b474af29 100644 --- a/patches/server/0035-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0035-Remove-lambda-from-ticking-guard.patch @@ -36,10 +36,10 @@ index c41ae38038fb0f9e2010c59bd25860c9051034bb..1b17976702676755c986512507bfc322 } } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 42b78a401f66597888bf769ddffd35a7edc337a8..ea01d3dc4758eb26655ba15cc08a1a0d56da2c14 100644 +index c51f15356dd018925afe3c3c877f410d0e9966fe..322367cd087a14ce6bff2ca14ff792bd12bb1ad4 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -320,6 +320,11 @@ public final class LeavesConfig { +@@ -322,6 +322,11 @@ public final class LeavesConfig { reduceEntityAllocations = getBoolean("settings.performance.reduce-entity-allocations", reduceEntityAllocations); } diff --git a/patches/server/0036-Remove-iterators-from-inventory-contains.patch b/patches/server/0036-Remove-iterators-from-inventory-contains.patch index bdfd20b6..2ede32e2 100644 --- a/patches/server/0036-Remove-iterators-from-inventory-contains.patch +++ b/patches/server/0036-Remove-iterators-from-inventory-contains.patch @@ -55,10 +55,10 @@ index 5bc033bf59d49eda1f8f2574165bbcbeab7faa0f..cf89cbffabf8b88265b5ffbc42b55fe6 } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index ea01d3dc4758eb26655ba15cc08a1a0d56da2c14..bc88b440d12c79f78b649ab3e6b7045c641ef3ca 100644 +index 322367cd087a14ce6bff2ca14ff792bd12bb1ad4..0582366bef7fdf57a1ebc3c01ac68be41d0bf3ac 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -325,6 +325,11 @@ public final class LeavesConfig { +@@ -327,6 +327,11 @@ public final class LeavesConfig { removeTickGuardLambda = getBoolean("settings.performance.remove.tick-guard-lambda", removeTickGuardLambda); } diff --git a/patches/server/0037-Remove-streams-from-getting-nearby-players.patch b/patches/server/0037-Remove-streams-from-getting-nearby-players.patch index 6ff5ed96..bd1b4613 100644 --- a/patches/server/0037-Remove-streams-from-getting-nearby-players.patch +++ b/patches/server/0037-Remove-streams-from-getting-nearby-players.patch @@ -68,10 +68,10 @@ index 818952b1268688cf13a8ab22d38f05336bf740ad..c55eb9ef7217405c35661dbe03ae6be8 return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this)); } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index bc88b440d12c79f78b649ab3e6b7045c641ef3ca..a4daa3c43bc46df5f44518f457c6f49b050a8cdc 100644 +index 0582366bef7fdf57a1ebc3c01ac68be41d0bf3ac..26e99556e99dfbb02419190bee3a72a2ed12b350 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -330,6 +330,11 @@ public final class LeavesConfig { +@@ -332,6 +332,11 @@ public final class LeavesConfig { removeInventoryContainsIterators = getBoolean("settings.performance.remove.inventory-contains-iterators", removeInventoryContainsIterators); } diff --git a/patches/server/0038-Remove-streams-and-iterators-from-range-check.patch b/patches/server/0038-Remove-streams-and-iterators-from-range-check.patch index b0f7994a..c0ef1921 100644 --- a/patches/server/0038-Remove-streams-and-iterators-from-range-check.patch +++ b/patches/server/0038-Remove-streams-and-iterators-from-range-check.patch @@ -65,10 +65,10 @@ index 634cde8069fc5ba467170a597e02da7c6b4e7b80..893475f58f649a40e3962092a3608636 return this.scaledRange(i); } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index a4daa3c43bc46df5f44518f457c6f49b050a8cdc..bc33a464e84c95de104b038c994f2cbe6cbc08a4 100644 +index 26e99556e99dfbb02419190bee3a72a2ed12b350..7a66aba1ccb7182679e786688519aadc01ccec1f 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -335,6 +335,11 @@ public final class LeavesConfig { +@@ -337,6 +337,11 @@ public final class LeavesConfig { removeGetNearPlayerStreams = getBoolean("settings.performance.remove.get-nearby-players-streams", removeGetNearPlayerStreams); } diff --git a/patches/server/0039-Async-Pathfinding.patch b/patches/server/0039-Async-Pathfinding.patch index f698655b..b9530c4a 100644 --- a/patches/server/0039-Async-Pathfinding.patch +++ b/patches/server/0039-Async-Pathfinding.patch @@ -7,10 +7,10 @@ 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 bc33a464e84c95de104b038c994f2cbe6cbc08a4..b06f407f30e3f68d1ddf7b43ca4200dd14281288 100644 +index 7a66aba1ccb7182679e786688519aadc01ccec1f..7dfe1efadcb62ec304c02bf0b1ec1d93ae9205ae 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -340,6 +340,21 @@ public final class LeavesConfig { +@@ -342,6 +342,21 @@ public final class LeavesConfig { removeRangeCheckStreams = getBoolean("settings.performance.remove.range-check-streams-and-iterators", removeRangeCheckStreams); } diff --git a/patches/server/0040-Cache-climbing-check-for-activation.patch b/patches/server/0040-Cache-climbing-check-for-activation.patch index 196a1e64..8bc7c75c 100644 --- a/patches/server/0040-Cache-climbing-check-for-activation.patch +++ b/patches/server/0040-Cache-climbing-check-for-activation.patch @@ -46,10 +46,10 @@ index e881584d38dc354204479863f004e974a0ac6c07..9f17c6acb54a7620656832df62e57e9d return 1; // Paper } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index b06f407f30e3f68d1ddf7b43ca4200dd14281288..810b0e32931273fa6061d06f65558d8ec2ce1b79 100644 +index 7dfe1efadcb62ec304c02bf0b1ec1d93ae9205ae..2858a2f2d755cffd2e87f58a3468e45a35b5abe9 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -355,6 +355,11 @@ public final class LeavesConfig { +@@ -357,6 +357,11 @@ public final class LeavesConfig { } } diff --git a/patches/server/0041-Use-aging-cache-for-biome-temperatures.patch b/patches/server/0041-Use-aging-cache-for-biome-temperatures.patch index c7989bc6..47e9f5f6 100644 --- a/patches/server/0041-Use-aging-cache-for-biome-temperatures.patch +++ b/patches/server/0041-Use-aging-cache-for-biome-temperatures.patch @@ -102,10 +102,10 @@ index c4f1173aab1e53412a65793e06238e637910475a..44bb45b391a365d4ca4dcd7e284edbb0 public boolean shouldFreeze(LevelReader world, BlockPos blockPos) { diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 810b0e32931273fa6061d06f65558d8ec2ce1b79..9e09b0cc1f6b83ba5fd6076f0e9fed70866b3b18 100644 +index 2858a2f2d755cffd2e87f58a3468e45a35b5abe9..e117229dc47cd953ec148ac4e4d518e2a2e8e9cb 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -360,6 +360,15 @@ public final class LeavesConfig { +@@ -362,6 +362,15 @@ public final class LeavesConfig { cacheClimbCheck = getBoolean("settings.performance.cache-climb-check", cacheClimbCheck); } diff --git a/patches/server/0042-Reduce-entity-fluid-lookups-if-no-fluids.patch b/patches/server/0042-Reduce-entity-fluid-lookups-if-no-fluids.patch index a76aaf35..4ec464f9 100644 --- a/patches/server/0042-Reduce-entity-fluid-lookups-if-no-fluids.patch +++ b/patches/server/0042-Reduce-entity-fluid-lookups-if-no-fluids.patch @@ -217,10 +217,10 @@ index b0c9fce9d4e06cac139e341d218d0b6aac1f1943..f53fee91b78ba4c1e17360a40d5a94fe }); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 9e09b0cc1f6b83ba5fd6076f0e9fed70866b3b18..22b1a368313815d58cc04adb4e5368725bfa431f 100644 +index e117229dc47cd953ec148ac4e4d518e2a2e8e9cb..bab657dfc664da1c5fa2cea17069d08de7c378c8 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -369,6 +369,11 @@ public final class LeavesConfig { +@@ -371,6 +371,11 @@ public final class LeavesConfig { } } diff --git a/patches/server/0043-Reduce-chunk-loading-lookups.patch b/patches/server/0043-Reduce-chunk-loading-lookups.patch index 8f72c296..10450cc8 100644 --- a/patches/server/0043-Reduce-chunk-loading-lookups.patch +++ b/patches/server/0043-Reduce-chunk-loading-lookups.patch @@ -42,10 +42,10 @@ index f4002ac7cba7d5e41b4f11b98212c625f6a92a65..6feeb3d30e45c5aba4e8204fe7e76f8f boolean flag1 = iblockdata.getFluidState().is(FluidTags.WATER); diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index 22b1a368313815d58cc04adb4e5368725bfa431f..a4b59a56a49a7f68b137cc6bc6ae935da6a38a82 100644 +index bab657dfc664da1c5fa2cea17069d08de7c378c8..7c683f3f9e51cbcf1f451150d924a46c9f007068 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -374,6 +374,11 @@ public final class LeavesConfig { +@@ -376,6 +376,11 @@ public final class LeavesConfig { reduceEntityFluidLookup = getBoolean("settings.performance.reduce-entity-fluid-lookup", reduceEntityFluidLookup); } diff --git a/patches/server/0044-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch b/patches/server/0044-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch index 27954c78..c24bcbe7 100644 --- a/patches/server/0044-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch +++ b/patches/server/0044-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch @@ -73,10 +73,10 @@ index f7ea77dd82d978ad307f99c743efacfb34478b3d..96be7a7b030b2f82ac91f0c5c8e66f28 } } diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index a4b59a56a49a7f68b137cc6bc6ae935da6a38a82..c46bf36a89fa2c2f1fa4fecc15ef05575fc4f2e6 100644 +index 7c683f3f9e51cbcf1f451150d924a46c9f007068..27d791fa3f1c78ca5e7c32fbbdb357503458b419 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -379,6 +379,11 @@ public final class LeavesConfig { +@@ -381,6 +381,11 @@ public final class LeavesConfig { reduceChuckLoadAndLookup = getBoolean("settings.performance.reduce-chuck-load-and-lookup", reduceChuckLoadAndLookup); } diff --git a/patches/server/0045-PCA-sync-protocol.patch b/patches/server/0045-PCA-sync-protocol.patch index 9b4471a8..0741ac68 100644 --- a/patches/server/0045-PCA-sync-protocol.patch +++ b/patches/server/0045-PCA-sync-protocol.patch @@ -369,10 +369,10 @@ index a4f500464de6ee6e29cff84109357364e53de233..82b588b0736f18d265c1ab269fcbd4e4 // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -index c46bf36a89fa2c2f1fa4fecc15ef05575fc4f2e6..77640ca1207ac2d54b5e9badac9c5dac9bcdf021 100644 +index 27d791fa3f1c78ca5e7c32fbbdb357503458b419..c44850529dbff649a79cf0ee24c40550c9ea25f1 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -384,6 +384,21 @@ public final class LeavesConfig { +@@ -386,6 +386,21 @@ public final class LeavesConfig { simplerVanillaShapelessRecipes = getBoolean("settings.performance.simpler-vanilla-shapeless-recipes", simplerVanillaShapelessRecipes); } diff --git a/patches/server/0046-BBOR-Protocol.patch b/patches/server/0046-BBOR-Protocol.patch index 9b4438a5..07683644 100644 --- a/patches/server/0046-BBOR-Protocol.patch +++ b/patches/server/0046-BBOR-Protocol.patch @@ -5,10 +5,10 @@ Subject: [PATCH] BBOR Protocol diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f834a809431ca3667be0c74d8fcbe9db46cbda22..f6bc15c331f22aba5cbb41261dbc10a4dc1e2a8d 100644 +index 253a80121043d124dd1c1f2bbf1418d6d3a2e10b..325bca7d156eac56f80a4551d21dc9875bef7ed7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1581,6 +1581,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop