From 2915edc2a0e31d6cea66b6570da29eaab744ef50 Mon Sep 17 00:00:00 2001 From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com> Date: Sat, 23 Aug 2025 02:53:05 -0700 Subject: [PATCH 1/3] Fix replay api crash with return-nether-portal-fix (#716) Thank you mojang for set "lastPos" to null instead of the spawning pos. --- .../org/leavesmc/leaves/replay/ServerPhotographer.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java b/leaves-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java index 23c7e5c5..d9d8ef31 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/replay/ServerPhotographer.java @@ -32,7 +32,7 @@ public class ServerPhotographer extends ServerPlayer { private ServerPlayer followPlayer; private Recorder recorder; private File saveFile; - private Vec3 lastPos; + private Vec3 lastPosVec3; private final ServerStatsCounter stats; @@ -41,7 +41,7 @@ public class ServerPhotographer extends ServerPlayer { this.gameMode = new ServerPhotographerGameMode(this); this.followPlayer = null; this.stats = new BotStatsCounter(server); - this.lastPos = this.position(); + this.lastPosVec3 = this.position(); } public static ServerPhotographer createPhotographer(@NotNull PhotographerCreateState state) throws IOException { @@ -76,6 +76,7 @@ public class ServerPhotographer extends ServerPlayer { @Override public void tick() { + this.lastPos = this.blockPosition(); super.tick(); if (this.getServer().getTickCount() % 10 == 0) { @@ -88,12 +89,12 @@ public class ServerPhotographer extends ServerPlayer { this.getBukkitPlayer().teleport(this.getCamera().getBukkitEntity().getLocation()); this.setCamera(followPlayer); } - if (lastPos.distanceToSqr(this.position()) > 1024D) { + if (lastPosVec3.distanceToSqr(this.position()) > 1024D) { this.getBukkitPlayer().teleport(this.getCamera().getBukkitEntity().getLocation()); } } - lastPos = this.position(); + lastPosVec3 = this.position(); } @Override From 13651b112033c8f212032a6edbe193114a98f241 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Sun, 24 Aug 2025 11:25:01 +0800 Subject: [PATCH 2/3] Update Paper --- gradle.properties | 2 +- .../features/0007-Leaves-Fakeplayer.patch | 20 +++++++++++++++---- .../0033-MC-Technical-Survival-Mode.patch | 17 ++++++++++++++-- .../features/0134-temp-fix-quick-craft.patch | 4 ++-- .../0138-Lithium-Sleeping-Block-Entity.patch | 8 ++++---- ...0-Do-not-tick-Arrow-life-regardless.patch} | 0 ...0-Remove-paper-stuck-poi-check-delay.patch | 20 ------------------- 7 files changed, 38 insertions(+), 33 deletions(-) rename leaves-server/minecraft-patches/features/{0141-Do-not-tick-Arrow-life-regardless.patch => 0140-Do-not-tick-Arrow-life-regardless.patch} (100%) delete mode 100644 leaves-server/minecraft-patches/features/0140-Remove-paper-stuck-poi-check-delay.patch diff --git a/gradle.properties b/gradle.properties index 3d531dee..881786c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group=org.leavesmc.leaves version=1.21.8-R0.1-SNAPSHOT mcVersion=1.21.8 -paperRef=f866a5fd5497798590aebefb99e417c97a8e1e76 +paperRef=614e9acfca696b98b810c65e3582993fcefc321e preVersion=false org.gradle.caching=true diff --git a/leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch b/leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch index 8fc4fcc2..02ba8d4c 100644 --- a/leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch +++ b/leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch @@ -199,6 +199,18 @@ index 14e2e0fcf20c8fa875bbefb97a673be4928d099a..8af40a77dc3da1599da2793168488f88 } else { return i; } +diff --git a/net/minecraft/server/commands/OpCommand.java b/net/minecraft/server/commands/OpCommand.java +index f2286b96b8f40b4588f817913c42ae7b4a92340f..e6c7bbb023000b9de90c1256274ff5aba4a6478a 100644 +--- a/net/minecraft/server/commands/OpCommand.java ++++ b/net/minecraft/server/commands/OpCommand.java +@@ -43,6 +43,7 @@ public class OpCommand { + int i = 0; + + for (GameProfile gameProfile : gameProfiles) { ++ if (gameProfile instanceof org.leavesmc.leaves.bot.BotList.CustomGameProfile) continue; // Leaves - disable op + if (!playerList.isOp(gameProfile)) { + playerList.op(gameProfile); + i++; diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java index 414a8357a7498c69341fa634ada2e664e18ca03a..f85993fc507d699728e058b12bb49dcb7aaea44b 100644 --- a/net/minecraft/server/dedicated/DedicatedServer.java @@ -482,7 +494,7 @@ index 61530843a32632f54f3d4ad913e649ee2dca3f38..d5051d8a2b0af5d8b63a0d10987c0a7e final boolean yZero = movement.y == 0.0; final boolean zZero = movement.z == 0.0; diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 0c52e315557e1dae6a852694786e72241fff1e29..fbee8c381bc5ed04f5fb0fbd7b67704b9a159b47 100644 +index 0268e02d2ef2cb3d699644a804e23a6da4521f4c..cc17fa4aa24d9fa258d61a74ba49c08979774698 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -3117,7 +3117,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin @@ -494,7 +506,7 @@ index 0c52e315557e1dae6a852694786e72241fff1e29..fbee8c381bc5ed04f5fb0fbd7b67704b this.setSpeed(this.getRiddenSpeed(player)); this.travel(riddenInput); } else { -@@ -3955,7 +3955,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3971,7 +3971,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin // Paper start - lag compensate eating // we add 1 to the expected time to avoid lag compensating when we should not final boolean shouldLagCompensate = this.useItem.has(DataComponents.FOOD) && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1L + this.totalEatTimeTicks) * 50L * (1000L * 1000L)); @@ -503,7 +515,7 @@ index 0c52e315557e1dae6a852694786e72241fff1e29..fbee8c381bc5ed04f5fb0fbd7b67704b this.useItemRemaining = 0; // Paper end - lag compensate eating this.completeUsingItem(); -@@ -4132,6 +4132,23 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -4148,6 +4148,23 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin this.stopUsingItem(); } @@ -697,7 +709,7 @@ index f1ce4cff1c03a0037ade2c8ef989cf327c973a7e..0976aef81b950a062152094501372d00 double d1 = deltaMovement.x; double d2 = deltaMovement.y; diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java -index d2e674b046bcf82a239b4706c3b89197ec6749c8..8e2c18fdb76ae6ea7402e6862a64c96db03f191a 100644 +index b3cfab9c82fe12694f5d2f56bd922828e51df680..3d5f64f67c402d7a86fd8a8e79b9fc90e61548a8 100644 --- a/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java @@ -48,6 +48,11 @@ public class PhantomSpawner implements CustomSpawner { diff --git a/leaves-server/minecraft-patches/features/0033-MC-Technical-Survival-Mode.patch b/leaves-server/minecraft-patches/features/0033-MC-Technical-Survival-Mode.patch index fcc7f502..1ce988f3 100644 --- a/leaves-server/minecraft-patches/features/0033-MC-Technical-Survival-Mode.patch +++ b/leaves-server/minecraft-patches/features/0033-MC-Technical-Survival-Mode.patch @@ -6,7 +6,7 @@ Subject: [PATCH] MC Technical Survival Mode Will automatically overwrite some configuration after startup diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 5f78a68170b390eb515af30e5cbe4559b1852706..51fd9298a931501ee15401b64f3194c72c00b00f 100644 +index 29b8e7b6d96ff7ca2dd53f00ea2010e6aad83a52..217bcd7f9aab84b9bff82af0f3cab95818ba51a2 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java @@ -1654,7 +1654,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc @@ -18,6 +18,19 @@ index 5f78a68170b390eb515af30e5cbe4559b1852706..51fd9298a931501ee15401b64f3194c7 } @Override +diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +index 57befff1f0675e889304a6258258384d8de02c87..36be5f1e3547d29fd85e3b3f0c39e8f5ec1adf4e 100644 +--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java ++++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +@@ -70,7 +70,7 @@ public class AcquirePoi { + return false; + } else { + mutableLong.setValue(time + 20L + level.getRandom().nextInt(20)); +- if (level.paperConfig().entities.behavior.stuckEntityPoiRetryDelay.enabled() && mob.getNavigation().isStuck()) mutableLong.add(level.paperConfig().entities.behavior.stuckEntityPoiRetryDelay.intValue()); // Paper - Next stuck check delay config ++ if (!org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode && level.paperConfig().entities.behavior.stuckEntityPoiRetryDelay.enabled() && mob.getNavigation().isStuck()) mutableLong.add(level.paperConfig().entities.behavior.stuckEntityPoiRetryDelay.intValue()); // Paper - Next stuck check delay config // Leaves - mc technical survival mode + PoiManager poiManager = level.getPoiManager(); + map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time)); + Predicate predicate1 = pos -> { diff --git a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java index a0e0fad40838fa7d835f31e5ce4ae3ab40e0bfa4..d8effc3a9773d29319b8e2bd15abbf03f0996ce5 100644 --- a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java @@ -58,7 +71,7 @@ index 4f647507d06d45a65b4b1793219d90c65e110225..dac4646902a93eaaa287f5b6da324eea entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { continue; diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 5f42af7c6fc82d6672ed06a2315254c9c5886ce4..e53b40c70c0a61cbe14a236a99725daa28512b0b 100644 +index d7755e6a4641b5463eb39885bf53b6950c09bfc9..1dd5538be2e45514c9009f60494ae5fceb2ad7e6 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -275,7 +275,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen diff --git a/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch b/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch index c6ee8526..60321a2c 100644 --- a/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch +++ b/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch @@ -7,10 +7,10 @@ caused by PaperMC/Paper#11765 should remove when PaperMC/Paper#11831 merged diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index e3673ababa41a4d65b87adbc6d79d53a196564b7..6c9a7ae3e9a340de35ca4dfcd486cfe5818d2aa5 100644 +index 6b776ff621275e842c113000bd69528c96a598c3..deec9de308c90aef7844623569e847c727644b74 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3945,11 +3945,11 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3961,11 +3961,11 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin return null; } else { double d = this.getEyeY() - 0.3F; diff --git a/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch b/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch index f57a4304..91bff4f1 100644 --- a/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch +++ b/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch @@ -1424,7 +1424,7 @@ index 363d85c96bd3fb1a1945595df36e30bd6dd2fa4e..542910b3d5faa85f2b14022932c058bc + // Leaves end - Lithium Sleeping Block Entity } diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index d8eede6272ee712c81ed9429539837fdbd27bfcd..2bd773aafba7ad1bb66a4e77b45df281ead98dda 100644 +index d9969741bb8efbf83df51692ebcd12e3d77c10f6..4ed998637ea724e95ba491534b1ca69a5bd314cd 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -27,8 +27,30 @@ import net.minecraft.world.level.block.state.BlockState; @@ -1540,7 +1540,7 @@ index d8eede6272ee712c81ed9429539837fdbd27bfcd..2bd773aafba7ad1bb66a4e77b45df281 if (addItem(hopper, itemEntity)) { return true; } -@@ -923,6 +971,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -925,6 +973,19 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } public void setCooldown(int cooldownTime) { @@ -1560,7 +1560,7 @@ index d8eede6272ee712c81ed9429539837fdbd27bfcd..2bd773aafba7ad1bb66a4e77b45df281 this.cooldownTime = cooldownTime; } -@@ -942,6 +1003,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -944,6 +1005,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @Override protected void setItems(NonNullList items) { this.items = items; @@ -1568,7 +1568,7 @@ index d8eede6272ee712c81ed9429539837fdbd27bfcd..2bd773aafba7ad1bb66a4e77b45df281 } public static void entityInside(Level level, BlockPos pos, BlockState state, Entity entity, HopperBlockEntity blockEntity) { -@@ -956,4 +1018,731 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -958,4 +1020,731 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen protected AbstractContainerMenu createMenu(int id, Inventory player) { return new HopperMenu(id, player, this); } diff --git a/leaves-server/minecraft-patches/features/0141-Do-not-tick-Arrow-life-regardless.patch b/leaves-server/minecraft-patches/features/0140-Do-not-tick-Arrow-life-regardless.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0141-Do-not-tick-Arrow-life-regardless.patch rename to leaves-server/minecraft-patches/features/0140-Do-not-tick-Arrow-life-regardless.patch diff --git a/leaves-server/minecraft-patches/features/0140-Remove-paper-stuck-poi-check-delay.patch b/leaves-server/minecraft-patches/features/0140-Remove-paper-stuck-poi-check-delay.patch deleted file mode 100644 index 35332a0e..00000000 --- a/leaves-server/minecraft-patches/features/0140-Remove-paper-stuck-poi-check-delay.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MC_XiaoHei -Date: Sun, 10 Aug 2025 17:03:40 +0800 -Subject: [PATCH] Remove paper stuck poi check delay - -Fix https://github.com/LeavesMC/Leaves/issues/626 - -diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -index b9174ae7e3a3e2de2d570b95ab5012ac3c3a2eda..a01e070ff90851890388d7e1c4496683cf8e941c 100644 ---- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -@@ -70,7 +70,7 @@ public class AcquirePoi { - return false; - } else { - mutableLong.setValue(time + 20L + level.getRandom().nextInt(20)); -- if (mob.getNavigation().isStuck()) mutableLong.add(200); // Paper - Perf: Wait an additional 10s to check again if they're stuck // TODO Modifies Vanilla behavior, add config option -+ // if (mob.getNavigation().isStuck()) mutableLong.add(200); // Paper - Perf: Wait an additional 10s to check again if they're stuck // TODO Modifies Vanilla behavior, add config option // Leaves: tmp remove this(https://github.com/LeavesMC/Leaves/issues/626) - PoiManager poiManager = level.getPoiManager(); - map.long2ObjectEntrySet().removeIf(entry -> !entry.getValue().isStillValid(time)); - Predicate predicate1 = pos -> { From 513768c965cb43bfb2361ca8689b6dee2ac0d792 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Sun, 24 Aug 2025 11:42:38 +0800 Subject: [PATCH 3/3] Merge Paper#11831 (#695) --- .../0134-TEMP-Merge-Paper-11831.patch | 82 +++++++++++++++++++ .../features/0134-temp-fix-quick-craft.patch | 29 ------- ...ender-dragon-part-can-use-end-portal.patch | 8 +- .../0138-Lithium-Sleeping-Block-Entity.patch | 8 +- 4 files changed, 90 insertions(+), 37 deletions(-) create mode 100644 leaves-server/minecraft-patches/features/0134-TEMP-Merge-Paper-11831.patch delete mode 100644 leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch diff --git a/leaves-server/minecraft-patches/features/0134-TEMP-Merge-Paper-11831.patch b/leaves-server/minecraft-patches/features/0134-TEMP-Merge-Paper-11831.patch new file mode 100644 index 00000000..17cb482c --- /dev/null +++ b/leaves-server/minecraft-patches/features/0134-TEMP-Merge-Paper-11831.patch @@ -0,0 +1,82 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MC_XiaoHei +Date: Sat, 5 Jul 2025 11:31:44 +0800 +Subject: [PATCH] TEMP Merge Paper#11831 + +Dec 27, 2024 ~ Today + +diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java +index f6e18d62db18616a422ae74d6f329d1b3a96300b..eb34f3f9821f50f0a31fb22d9314c26b3e829d47 100644 +--- a/net/minecraft/server/commands/GiveCommand.java ++++ b/net/minecraft/server/commands/GiveCommand.java +@@ -54,7 +54,6 @@ public class GiveCommand { + + private static int giveItem(CommandSourceStack source, ItemInput item, Collection targets, int count) throws CommandSyntaxException { + ItemStack itemStack = item.createItemStack(1, false); +- final Component displayName = itemStack.getDisplayName(); // Paper - get display name early + int maxStackSize = org.leavesmc.leaves.util.ItemOverstackUtils.getItemStackMaxCount(itemStack); // Leaves - item over-stack util + int i = maxStackSize * 100; + if (count > i) { +@@ -99,11 +98,11 @@ public class GiveCommand { + + if (targets.size() == 1) { + source.sendSuccess( +- () -> Component.translatable("commands.give.success.single", count, displayName, targets.iterator().next().getDisplayName()), // Paper - use cached display name ++ () -> Component.translatable("commands.give.success.single", count, itemStack.getDisplayName(), targets.iterator().next().getDisplayName()), // Paper - use cached display name + true + ); + } else { +- source.sendSuccess(() -> Component.translatable("commands.give.success.single", count, displayName, targets.size()), true); // Paper - use cached display name ++ source.sendSuccess(() -> Component.translatable("commands.give.success.single", count, itemStack.getDisplayName(), targets.size()), true); // Paper - use cached display name + } + + return targets.size(); +diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java +index bea4089920191b5e3231e9792a078747923d0c14..3b9bd49fa39e3b44a7cbf51072e7cf09b186f254 100644 +--- a/net/minecraft/world/entity/Entity.java ++++ b/net/minecraft/world/entity/Entity.java +@@ -2844,10 +2844,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + return null; + } + // CraftBukkit end +- ItemEntity itemEntity = new ItemEntity(level, this.getX() + offset.x, this.getY() + offset.y, this.getZ() + offset.z, stack.copy()); // Paper - copy so we can destroy original +- stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe +- +- itemEntity.setDefaultPickUpDelay(); ++ ItemEntity itemEntity = new ItemEntity(level, this.getX() + offset.x, this.getY() + offset.y, this.getZ() + offset.z, stack.copy()); // Paper - copy + itemEntity.setDefaultPickUpDelay(); // Paper - diff on change (in dropConsumer) + // Paper start - Call EntityDropItemEvent + return this.spawnAtLocation(level, itemEntity); +diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java +index 6b776ff621275e842c113000bd69528c96a598c3..0d493c8343057898166f94a4006a374a214ae7b2 100644 +--- a/net/minecraft/world/entity/LivingEntity.java ++++ b/net/minecraft/world/entity/LivingEntity.java +@@ -3961,11 +3961,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + return null; + } else { + double d = this.getEyeY() - 0.3F; +- // Paper start +- final ItemStack tmp = stack.copy(); +- stack.setCount(0); +- stack = tmp; +- // Paper end + ItemEntity itemEntity = new ItemEntity(this.level(), this.getX(), d, this.getZ(), stack); + itemEntity.setPickUpDelay(40); + if (includeThrower) { +diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java +index c1ca84cf0dbb4fd091cfab517721c87e0f9074a0..403afadbd2280325f1289e302a1ff409f8f0941c 100644 +--- a/net/minecraft/world/inventory/AbstractContainerMenu.java ++++ b/net/minecraft/world/inventory/AbstractContainerMenu.java +@@ -652,7 +652,11 @@ public abstract class AbstractContainerMenu { + } + + carried = slot2.safeTake(i1, Integer.MAX_VALUE, player); +- player.drop(carried, true); ++ // CraftBukkit start - SPIGOT-8010: break loop ++ if (player.drop(carried, true) == null) { ++ break; ++ } ++ // CraftBukkit end - SPIGOT-8010: break loop + player.handleCreativeModeItemDrop(carried); + } + } diff --git a/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch b/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch deleted file mode 100644 index 60321a2c..00000000 --- a/leaves-server/minecraft-patches/features/0134-temp-fix-quick-craft.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MC_XiaoHei -Date: Sat, 5 Jul 2025 11:31:44 +0800 -Subject: [PATCH] temp fix quick craft - -caused by PaperMC/Paper#11765 -should remove when PaperMC/Paper#11831 merged - -diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 6b776ff621275e842c113000bd69528c96a598c3..deec9de308c90aef7844623569e847c727644b74 100644 ---- a/net/minecraft/world/entity/LivingEntity.java -+++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3961,11 +3961,11 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin - return null; - } else { - double d = this.getEyeY() - 0.3F; -- // Paper start -- final ItemStack tmp = stack.copy(); -- stack.setCount(0); -- stack = tmp; -- // Paper end -+ // Paper start // Leaves start - wtf this for? it breaks quick craft -+ // final ItemStack tmp = stack.copy(); -+ // stack.setCount(0); -+ // stack = tmp; -+ // Paper end // Leaves end - ItemEntity itemEntity = new ItemEntity(this.level(), this.getX(), d, this.getZ(), stack); - itemEntity.setPickUpDelay(40); - if (includeThrower) { diff --git a/leaves-server/minecraft-patches/features/0135-Old-ender-dragon-part-can-use-end-portal.patch b/leaves-server/minecraft-patches/features/0135-Old-ender-dragon-part-can-use-end-portal.patch index b9ebd4a5..c03c8ddd 100644 --- a/leaves-server/minecraft-patches/features/0135-Old-ender-dragon-part-can-use-end-portal.patch +++ b/leaves-server/minecraft-patches/features/0135-Old-ender-dragon-part-can-use-end-portal.patch @@ -26,7 +26,7 @@ This patch is Powered by CrystalCarpetAddition(https://github.com/Crystal0404/Cr */ diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index bea4089920191b5e3231e9792a078747923d0c14..e89b6c6de030f1298f3d9919a8b066ed7467ce69 100644 +index 3b9bd49fa39e3b44a7cbf51072e7cf09b186f254..6b56178967872923be58983ce8b14102ec0c3e14 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -185,7 +185,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -38,7 +38,7 @@ index bea4089920191b5e3231e9792a078747923d0c14..e89b6c6de030f1298f3d9919a8b066ed public boolean collisionLoadChunks = false; // Paper public org.bukkit.craftbukkit.entity.CraftEntity getBukkitEntity() { -@@ -3961,7 +3961,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3958,7 +3958,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @Nullable public Entity teleport(TeleportTransition teleportTransition) { // Paper start - Fix item duplication and teleport issues @@ -47,7 +47,7 @@ index bea4089920191b5e3231e9792a078747923d0c14..e89b6c6de030f1298f3d9919a8b066ed LOGGER.warn("Illegal Entity Teleport {} to {}:{}", this, teleportTransition.newLevel(), teleportTransition.position(), new Throwable()); return null; } -@@ -4077,7 +4077,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4074,7 +4074,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess entityx.restoreFrom(this); this.removeAfterChangingDimensions(); entityx.teleportSetPosition(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); @@ -56,7 +56,7 @@ index bea4089920191b5e3231e9792a078747923d0c14..e89b6c6de030f1298f3d9919a8b066ed for (Entity entity2 : list) { entity2.startRiding(entityx, true); -@@ -4212,6 +4212,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4209,6 +4209,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean canTeleport(Level fromLevel, Level toLevel) { diff --git a/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch b/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch index 91bff4f1..84146675 100644 --- a/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch +++ b/leaves-server/minecraft-patches/features/0138-Lithium-Sleeping-Block-Entity.patch @@ -111,7 +111,7 @@ index 86cac164a2bf0e76528396e6aabbfd64cfc29559..da99b4bc7fe8460945070915073be141 int getContainerSize(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index e89b6c6de030f1298f3d9919a8b066ed7467ce69..22c6a11dd9ea70a242804b91c8fa89cdac2f6f1a 100644 +index 6b56178967872923be58983ce8b14102ec0c3e14..7a85d94f333b6e1def5926b5b7727c22da0a203f 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -309,7 +309,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -123,7 +123,7 @@ index e89b6c6de030f1298f3d9919a8b066ed7467ce69..22c6a11dd9ea70a242804b91c8fa89cd private final VecDeltaCodec packetPositionCodec = new VecDeltaCodec(); public boolean hasImpulse; @Nullable -@@ -5153,6 +5153,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -5150,6 +5150,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setBoundingBox(this.makeBoundingBox()); } // Paper end - Block invalid positions and bounding box @@ -294,10 +294,10 @@ index 7781ca07a0c8fe1140f341b695e66de95802ee2e..f190e8f244d011bdb7f04ccf0f0a35cb + // Leaves end - Lithium Sleeping Block Entity } diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java -index c1ca84cf0dbb4fd091cfab517721c87e0f9074a0..5f70277c3548a9cd423585d37497842267652620 100644 +index 403afadbd2280325f1289e302a1ff409f8f0941c..029b8fcc951875c7bc845c507e4f7a91cebc1156 100644 --- a/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -931,6 +931,7 @@ public abstract class AbstractContainerMenu { +@@ -935,6 +935,7 @@ public abstract class AbstractContainerMenu { } else { float f = 0.0F;