diff --git a/patches/server/0009-Fakeplayer-support.patch b/patches/server/0009-Fakeplayer-support.patch index f7e46831..ad573608 100644 --- a/patches/server/0009-Fakeplayer-support.patch +++ b/patches/server/0009-Fakeplayer-support.patch @@ -2144,7 +2144,7 @@ index 0000000000000000000000000000000000000000..d92ea54770bce73c2f10f1ebcb0dff5b +} diff --git a/src/main/java/top/leavesmc/leaves/bot/agent/actions/JumpAction.java b/src/main/java/top/leavesmc/leaves/bot/agent/actions/JumpAction.java new file mode 100644 -index 0000000000000000000000000000000000000000..62bd3679e1114abc5283dfc769cde0e1d7024d40 +index 0000000000000000000000000000000000000000..d99f667992e45e85c0fe0bd74682d563fe1315eb --- /dev/null +++ b/src/main/java/top/leavesmc/leaves/bot/agent/actions/JumpAction.java @@ -0,0 +1,35 @@ @@ -2175,7 +2175,7 @@ index 0000000000000000000000000000000000000000..62bd3679e1114abc5283dfc769cde0e1 + + @Override + public boolean doTick(@NotNull ServerBot bot) { -+ if (bot.isOnGround()) { ++ if (bot.onGround()) { + bot.jumpFromGround(); + return true; + } else { diff --git a/patches/server/0017-No-chat-sign.patch b/patches/server/0017-No-chat-sign.patch index 810d0293..efd38813 100644 --- a/patches/server/0017-No-chat-sign.patch +++ b/patches/server/0017-No-chat-sign.patch @@ -123,7 +123,7 @@ index 3e3e11d4207172d6c24895cef6c7b5a0b09352ee..9e374eb89e28a5406784a38ec146ee31 protected boolean convertOldUsers() { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..99e982f81745a65f0df6ccdf26b050ec0def4d31 100644 +index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..9c68dd4633d23310e7e1afb4fea52ceaeea00c02 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -2141,10 +2141,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -133,7 +133,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..99e982f81745a65f0df6ccdf26b050ec + // Leaves start - no ClientboundPlayerChatHeaderPacket and rebuild ClientboundPlayerChatPacket + if (top.leavesmc.leaves.LeavesConfig.noChatSign) { + if (packet instanceof ClientboundPlayerChatPacket chat) { -+ packet = new ClientboundSystemChatPacket(chat.chatType().resolve(this.player.level.registryAccess()) ++ packet = new ClientboundSystemChatPacket(chat.chatType().resolve(this.player.level().registryAccess()) + .get().decorate(chat.unsignedContent() != null ? chat.unsignedContent() + : Component.literal(chat.body().content())), false); + } @@ -155,7 +155,7 @@ index ae82ab0e3d8e99f87ca8465fbcbb44b5ce18bf96..99e982f81745a65f0df6ccdf26b050ec if (packet == null || this.processedDisconnect) { // Spigot return; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 254171bacd48142cc7bd0c8b79c6526984cd0033..e50bb5b8624411f775d05d59515db1af18d04355 100644 +index 4eaf7ae37557075ebe735827861507bee6b61eed..794386d40e2f53f2707b401907af5bb73e199eb1 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1450,7 +1450,7 @@ public abstract class PlayerList { diff --git a/patches/server/0033-Skip-cloning-loot-parameters.patch b/patches/server/0033-Skip-cloning-loot-parameters.patch index 44893e44..2909ba0a 100644 --- a/patches/server/0033-Skip-cloning-loot-parameters.patch +++ b/patches/server/0033-Skip-cloning-loot-parameters.patch @@ -5,30 +5,6 @@ Subject: [PATCH] Skip cloning loot parameters This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) -diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java -index 17df8b341c65ca24fd2a18424f221918d0a7a111..c666e7f401b0ed453e03e8bad9c2aca10b367bda 100644 ---- a/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java -+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootContext.java -@@ -28,6 +28,19 @@ public class LootContext { - LootContext(LootParams parameters, RandomSource random, LootDataResolver dataLookup) { - this.params = parameters; - this.random = random; -+ this.luck = luck; -+ this.level = world; -+ this.lootTables = tableGetter; -+ this.conditions = conditionGetter; -+ // Leaves start - use unmodifiable maps instead of immutable ones to skip the copy -+ if (top.leavesmc.leaves.LeavesConfig.skipCloneLootParameters) { -+ this.params = java.util.Collections.unmodifiableMap(parameters); -+ this.dynamicDrops = java.util.Collections.unmodifiableMap(drops); -+ } else { -+ this.params = ImmutableMap.copyOf(parameters); -+ this.dynamicDrops = ImmutableMap.copyOf(drops); -+ } -+ // Leaves end - use unmodifiable maps instead of immutable ones to skip the copy - this.lootDataResolver = dataLookup; - } - diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java index 53ccd141c53faa3fa53127f546ba0faeb685d731..1335959fc27da3e53ea845dff83fcac0b3a1e873 100644 --- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java diff --git a/patches/server/0035-Remove-lambda-from-ticking-guard.patch b/patches/server/0035-Remove-lambda-from-ticking-guard.patch index e06ec3ca..021e126c 100644 --- a/patches/server/0035-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0035-Remove-lambda-from-ticking-guard.patch @@ -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 bf05f321373c9cb5d42fd6cace010a75dc98b90a..5a373196692fd6eb408492c9c4539ec941a819b9 100644 +index bf05f321373c9cb5d42fd6cace010a75dc98b90a..c47df8d18be8ac7d32a16e6662dbbd850efc8e8a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -869,7 +869,24 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -22,7 +22,7 @@ index bf05f321373c9cb5d42fd6cace010a75dc98b90a..5a373196692fd6eb408492c9c4539ec9 + } catch (Throwable throwable) { + if (throwable instanceof ThreadDeath) throw throwable; // Paper + // Paper start - Prevent tile entity and entity crashes -+ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); ++ final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); + MinecraftServer.LOGGER.error(msg, throwable); + getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); + entity.discard(); diff --git a/patches/server/0036-Remove-iterators-from-inventory-contains.patch b/patches/server/0036-Remove-iterators-from-inventory-contains.patch index cd48b489..320e3ad7 100644 --- a/patches/server/0036-Remove-iterators-from-inventory-contains.patch +++ b/patches/server/0036-Remove-iterators-from-inventory-contains.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove iterators from inventory contains This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index 395cecc385e4126a7534ac9aeb15cf323efab03e..fee876947e0c00f3e0d0914cf84b5969cc788696 100644 +index 395cecc385e4126a7534ac9aeb15cf323efab03e..a8e8ed277bf467ca8a34e040bf7b1257ffe8a17e 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java @@ -681,21 +681,35 @@ public class Inventory implements Container, Nameable { @@ -21,7 +21,7 @@ index 395cecc385e4126a7534ac9aeb15cf323efab03e..fee876947e0c00f3e0d0914cf84b5969 + for (int j = 0; j < list.size(); j++) { + ItemStack itemstack1 = list.get(j); + -+ if (!itemstack1.isEmpty() && itemstack1.sameItem(stack)) { ++ if (!itemstack1.isEmpty() && ItemStack.isSameItemSameTags(itemstack1, stack)) { + return true; + } + } diff --git a/patches/server/0043-Reduce-chunk-loading-lookups.patch b/patches/server/0043-Reduce-chunk-loading-lookups.patch index 18453af8..28bf2717 100644 --- a/patches/server/0043-Reduce-chunk-loading-lookups.patch +++ b/patches/server/0043-Reduce-chunk-loading-lookups.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Reduce chunk loading & lookups This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 4616addb05fcc20b1ec6ca1dea01cbefed697acd..5fe47a97498177d7d131d32c95a7fbe8ee9c380f 100644 +index 4616addb05fcc20b1ec6ca1dea01cbefed697acd..2fce5952352ca09335d3ba74e6d779c447b1a734 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java @@ -322,11 +322,28 @@ public class EnderMan extends Monster implements NeutralMob { @@ -18,12 +18,12 @@ index 4616addb05fcc20b1ec6ca1dea01cbefed697acd..5fe47a97498177d7d131d32c95a7fbe8 + // Leaves start - single chunk lookup + BlockState iblockdata; + if (top.leavesmc.leaves.LeavesConfig.reduceChuckLoadAndLookup) { -+ net.minecraft.world.level.chunk.LevelChunk chunk = this.level.getChunkIfLoaded(blockposition_mutableblockposition); ++ net.minecraft.world.level.chunk.LevelChunk chunk = this.level().getChunkIfLoaded(blockposition_mutableblockposition); + if (chunk == null) { + return false; + } + -+ while (blockposition_mutableblockposition.getY() > this.level.getMinBuildHeight() && !chunk.getBlockState(blockposition_mutableblockposition).getMaterial().blocksMotion()) { ++ while (blockposition_mutableblockposition.getY() > this.level().getMinBuildHeight() && !chunk.getBlockState(blockposition_mutableblockposition).blocksMotion()) { + blockposition_mutableblockposition.move(Direction.DOWN); + } + diff --git a/patches/server/0045-PCA-sync-protocol.patch b/patches/server/0045-PCA-sync-protocol.patch index 61652ac9..50204c71 100644 --- a/patches/server/0045-PCA-sync-protocol.patch +++ b/patches/server/0045-PCA-sync-protocol.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PCA sync protocol This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition) diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 99e982f81745a65f0df6ccdf26b050ec0def4d31..ba990b85172a44333d619f82f4ad7f2b67c8765c 100644 +index 9c68dd4633d23310e7e1afb4fea52ceaeea00c02..5bf8c3e04905031c56ed775aaba762ef2fa35662 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -245,6 +245,7 @@ import org.bukkit.inventory.CraftingInventory; @@ -63,7 +63,7 @@ index 79b6e241f425622fdc575b77d8dce7061c0ab783..57579e83cb2ba6ad82509e9e7b8fdda9 this.updateContainerEquipment(); diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 564908ce0a560c2190fb624e77d227d3b7031024..806526e79c7d5380955e4dd9d6da865c73647329 100644 +index 564908ce0a560c2190fb624e77d227d3b7031024..5304ee89ce843c9ca860d68091162a976daee0ea 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -65,6 +65,15 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @@ -71,7 +71,7 @@ index 564908ce0a560c2190fb624e77d227d3b7031024..806526e79c7d5380955e4dd9d6da865c this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, 16.0F); this.setPathfindingMalus(BlockPathTypes.DAMAGE_FIRE, -1.0F); + // Leaves start - pca -+ if (!this.level.isClientSide()) { ++ if (!this.level().isClientSide()) { + this.inventory.addListener(inventory -> { + if (top.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { + top.leavesmc.leaves.protocol.PcaSyncProtocol.syncEntityToClient(this); diff --git a/patches/server/0056-Return-nether-portal-fix.patch b/patches/server/0056-Return-nether-portal-fix.patch index 24cac492..3a2c06b6 100644 --- a/patches/server/0056-Return-nether-portal-fix.patch +++ b/patches/server/0056-Return-nether-portal-fix.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Return nether portal fix This patch is powered by NetherPortalFix(https://github.com/TwelveIterationMods/NetherPortalFix) diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index afcc518ff50066e846e9b1a79cb99dc25cac4f24..02e1b6725f0129bb0dacc39b71b0397c9fe8da93 100644 +index afcc518ff50066e846e9b1a79cb99dc25cac4f24..90b6d5e4495526dd8d623443ae8cc3c0ee072734 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -186,6 +186,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -24,7 +24,7 @@ index afcc518ff50066e846e9b1a79cb99dc25cac4f24..02e1b6725f0129bb0dacc39b71b0397c + // Leaves start - nether portal fix + if (top.leavesmc.leaves.LeavesConfig.netherPortalFix) { + final ResourceKey fromDim = worldserver1.dimension(); -+ final ResourceKey toDim = getLevel().dimension(); ++ final ResourceKey toDim = level().dimension(); + final ResourceKey OVERWORLD = Level.OVERWORLD; + final ResourceKey THE_NETHER = Level.NETHER; + if (!((fromDim != OVERWORLD || toDim != THE_NETHER) && (fromDim != THE_NETHER || toDim != OVERWORLD))) { @@ -49,8 +49,8 @@ index afcc518ff50066e846e9b1a79cb99dc25cac4f24..02e1b6725f0129bb0dacc39b71b0397c + // Leaves start - nether portal fix + if (top.leavesmc.leaves.LeavesConfig.netherPortalFix) { + BlockPos fromPos = blockPosition(); -+ final ResourceKey fromDim = level.dimension(); -+ final ResourceKey toDim = level.dimension(); ++ final ResourceKey fromDim = level().dimension(); ++ final ResourceKey toDim = level().dimension(); + final ResourceKey OVERWORLD = Level.OVERWORLD; + final ResourceKey THE_NETHER = Level.NETHER; + boolean isTeleportBetweenNetherAndOverworld = (fromDim == OVERWORLD && toDim == THE_NETHER)