From 57b4f3b7c75e080f2dd648adf7c141e6fd04220f Mon Sep 17 00:00:00 2001 From: MC_XiaoHei Date: Thu, 3 Jul 2025 14:38:37 +0800 Subject: [PATCH] 0010/0132 --- ...5-Configurable-trading-with-the-void.patch | 4 +- ...nowball-and-egg-can-knockback-player.patch | 0 .../features}/0007-Leaves-Fakeplayer.patch | 128 +++++++++--------- ...hears-in-dispenser-can-unlimited-use.patch | 4 +- .../0009-Redstone-Shears-Wrench.patch | 0 ...Add-isShrink-to-EntityResurrectEvent.patch | 4 +- 6 files changed, 70 insertions(+), 70 deletions(-) rename leaves-server/{unapplied => minecraft-patches/features}/0005-Configurable-trading-with-the-void.patch (93%) rename leaves-server/{unapplied => minecraft-patches/features}/0006-Make-snowball-and-egg-can-knockback-player.patch (100%) rename leaves-server/{unapplied => minecraft-patches/features}/0007-Leaves-Fakeplayer.patch (81%) rename leaves-server/{unapplied => minecraft-patches/features}/0008-Make-shears-in-dispenser-can-unlimited-use.patch (85%) rename leaves-server/{unapplied => minecraft-patches/features}/0009-Redstone-Shears-Wrench.patch (100%) rename leaves-server/{unapplied => minecraft-patches/features}/0010-Add-isShrink-to-EntityResurrectEvent.patch (89%) diff --git a/leaves-server/unapplied/0005-Configurable-trading-with-the-void.patch b/leaves-server/minecraft-patches/features/0005-Configurable-trading-with-the-void.patch similarity index 93% rename from leaves-server/unapplied/0005-Configurable-trading-with-the-void.patch rename to leaves-server/minecraft-patches/features/0005-Configurable-trading-with-the-void.patch index 61ab739e..9c386a18 100644 --- a/leaves-server/unapplied/0005-Configurable-trading-with-the-void.patch +++ b/leaves-server/minecraft-patches/features/0005-Configurable-trading-with-the-void.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable trading with the void diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index bfbfbaa9660d21071c420b60b10be0a02a1bc87e..4797e001122097f55f33729b3b20f79d75b20fb2 100644 +index dda8d38ef61672cc714d9e5a475f9b0412ed5ff9..364d5e28646ea341034921622354c7b19644b343 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -2674,7 +2674,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -2727,7 +2727,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe // Spigot start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start - Fix merchant inventory not closing on entity removal diff --git a/leaves-server/unapplied/0006-Make-snowball-and-egg-can-knockback-player.patch b/leaves-server/minecraft-patches/features/0006-Make-snowball-and-egg-can-knockback-player.patch similarity index 100% rename from leaves-server/unapplied/0006-Make-snowball-and-egg-can-knockback-player.patch rename to leaves-server/minecraft-patches/features/0006-Make-snowball-and-egg-can-knockback-player.patch diff --git a/leaves-server/unapplied/0007-Leaves-Fakeplayer.patch b/leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch similarity index 81% rename from leaves-server/unapplied/0007-Leaves-Fakeplayer.patch rename to leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch index bd5cfbb1..eaece094 100644 --- a/leaves-server/unapplied/0007-Leaves-Fakeplayer.patch +++ b/leaves-server/minecraft-patches/features/0007-Leaves-Fakeplayer.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Fakeplayer diff --git a/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java b/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java -index 4b2ae046413146b11912e7aa4a9a3d643de6afd1..c5733fe17b4dd5dfe4bce461a305a13a188b2f77 100644 +index a82d84283632342bd30bc3449983431ba43583e0..f59526f6bfa1b4af5b474f0b438513c96afb491c 100644 --- a/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java +++ b/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java @@ -39,6 +39,7 @@ public abstract class SimpleCriterionTrigger> set = (Set) advancements.criterionData.get(this); // Paper - fix PlayerAdvancements leak if (set != null && !set.isEmpty()) { diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java -index 4ed9611994c5c8da01fede690197527c5b3a5731..364ddf9f25ef3cb97ba788c469fee9dd495b84a7 100644 +index 8bab2c26e10e8495fd39be470bcb02917fe56f40..c9840dfa4067973aafed7e7c7305182dfabe0a48 100644 --- a/net/minecraft/network/Connection.java +++ b/net/minecraft/network/Connection.java @@ -96,7 +96,7 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -30,19 +30,19 @@ index 4ed9611994c5c8da01fede690197527c5b3a5731..364ddf9f25ef3cb97ba788c469fee9dd private DisconnectionDetails disconnectionDetails; private boolean encrypted; diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index d48581353661799e5e031a512227d5e651fa2996..b0881eaf3484560740d2d53b3957cf3f4d829360 100644 +index 95f5d078019ebd4fde9bf65748d866b51cfeabc6..05966b2600bead23ab2ec19c95a3797eda7f3ef8 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -303,6 +303,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation + private org.leavesmc.leaves.bot.BotList botList; // Leaves - fakeplayer + public static S spin(Function threadFunction) { + ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system AtomicReference atomicReference = new AtomicReference<>(); - Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> atomicReference.get().runServer(), "Server thread"); -@@ -738,6 +740,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> optional = PoiTypes.forState(oldState); -@@ -2616,6 +2624,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -2661,6 +2669,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe // ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server; moved down below valid=true if (entity instanceof ServerPlayer serverPlayer) { ServerLevel.this.players.add(serverPlayer); @@ -172,10 +172,10 @@ index 4797e001122097f55f33729b3b20f79d75b20fb2..9c32960a14916f3b032c6ae323d6efc9 + ServerLevel.this.realPlayers.add(serverPlayer); + } + // Leaves end - skip - ServerLevel.this.updateSleepingPlayerList(); - } - -@@ -2686,6 +2699,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + if (serverPlayer.isReceivingWaypoints()) { + ServerLevel.this.getWaypointManager().addPlayer(serverPlayer); + } +@@ -2739,6 +2752,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe ServerLevel.this.getChunkSource().removeEntity(entity); if (entity instanceof ServerPlayer serverPlayer) { ServerLevel.this.players.remove(serverPlayer); @@ -184,59 +184,59 @@ index 4797e001122097f55f33729b3b20f79d75b20fb2..9c32960a14916f3b032c6ae323d6efc9 + ServerLevel.this.realPlayers.remove(serverPlayer); + } + // Leaves end - skip + ServerLevel.this.getWaypointManager().removePlayer(serverPlayer); ServerLevel.this.updateSleepingPlayerList(); } - diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 443bfb06951f0ffe6af8724b53e150cd0907e68d..01687ea3acf449c49cbc615887a7dbdd3a693613 100644 +index 4f054851848297bd0337b874370759259dcd7ad6..6626a175376df9b549ed7eaf13d0ed21d4fc8153 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -208,7 +208,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -219,7 +219,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private static final boolean DEFAULT_SPAWN_EXTRA_PARTICLES_ON_FALL = false; public ServerGamePacketListenerImpl connection; - public final MinecraftServer server; + private final MinecraftServer server; - public final ServerPlayerGameMode gameMode; + public ServerPlayerGameMode gameMode; // Leaves - not final private final PlayerAdvancements advancements; private final ServerStatsCounter stats; private float lastRecordedHealthAndAbsorption = Float.MIN_VALUE; -@@ -1413,6 +1413,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1443,6 +1443,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc this.lastSentHealth = -1.0F; this.lastSentFood = -1; - + this.teleportSpectators(teleportTransition, serverLevel); + // Leaves start - bot support + if (org.leavesmc.leaves.LeavesConfig.modify.fakeplayer.enable) { + this.server.getBotList().bots.forEach(bot -> bot.sendFakeDataIfNeed(this, true)); // Leaves - render bot + } + // Leaves end - bot support - // CraftBukkit start org.bukkit.event.player.PlayerChangedWorldEvent changeEvent = new org.bukkit.event.player.PlayerChangedWorldEvent(this.getBukkitEntity(), serverLevel.getWorld()); + this.level().getCraftServer().getPluginManager().callEvent(changeEvent); diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 722b4eb1eabe167233f75bd50bbf47e369670eaa..0cf30681a9e3d68f3abe1d87b9fd4220083685a9 100644 +index 91f505c9d84aba773d237664c2aaaf9750cadadf..580ab889bce7d0dff64e5e1ae92a646ac96e3168 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -339,6 +339,19 @@ public abstract class PlayerList { - org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); - // Leaves end - protocol core +@@ -337,6 +337,19 @@ public abstract class PlayerList { -+ // Leaves start - bot support -+ if (org.leavesmc.leaves.LeavesConfig.modify.fakeplayer.enable) { -+ org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName()); -+ if (bot != null) { -+ this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false); + org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); + ++ // Leaves start - bot support ++ if (org.leavesmc.leaves.LeavesConfig.modify.fakeplayer.enable) { ++ org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName()); ++ if (bot != null) { ++ this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false); ++ } ++ this.server.getBotList().bots.forEach(bot1 -> { ++ bot1.sendPlayerInfo(player); ++ bot1.sendFakeDataIfNeed(player, true); ++ }); // Leaves - render bot + } -+ this.server.getBotList().bots.forEach(bot1 -> { -+ bot1.sendPlayerInfo(player); -+ bot1.sendFakeDataIfNeed(player, true); -+ }); // Leaves - render bot -+ } -+ // Leaves end - bot support ++ // Leaves end - bot support + - final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); + final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage(); - if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure -@@ -870,6 +883,12 @@ public abstract class PlayerList { + if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure +@@ -829,6 +842,12 @@ public abstract class PlayerList { } // Paper end - Add PlayerPostRespawnEvent @@ -249,7 +249,7 @@ index 722b4eb1eabe167233f75bd50bbf47e369670eaa..0cf30681a9e3d68f3abe1d87b9fd4220 // CraftBukkit end return serverPlayer; -@@ -974,11 +993,16 @@ public abstract class PlayerList { +@@ -933,11 +952,16 @@ public abstract class PlayerList { } public String[] getPlayerNamesArray() { @@ -267,7 +267,7 @@ index 722b4eb1eabe167233f75bd50bbf47e369670eaa..0cf30681a9e3d68f3abe1d87b9fd4220 return strings; } -@@ -1064,7 +1088,14 @@ public abstract class PlayerList { +@@ -1040,7 +1064,14 @@ public abstract class PlayerList { @Nullable public ServerPlayer getPlayerByName(String username) { @@ -283,7 +283,7 @@ index 722b4eb1eabe167233f75bd50bbf47e369670eaa..0cf30681a9e3d68f3abe1d87b9fd4220 } public void broadcast(@Nullable Player except, double x, double y, double z, double radius, ResourceKey dimension, Packet packet) { -@@ -1380,7 +1411,13 @@ public abstract class PlayerList { +@@ -1356,7 +1387,13 @@ public abstract class PlayerList { @Nullable public ServerPlayer getPlayer(UUID playerUUID) { @@ -299,10 +299,10 @@ index 722b4eb1eabe167233f75bd50bbf47e369670eaa..0cf30681a9e3d68f3abe1d87b9fd4220 public boolean canBypassPlayerLimit(GameProfile profile) { diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index f8d45c1076852a0553c3dd7c5512f76a6891e2cb..1f50aca05ff1adf8f2e16cab2fac757a7094e1b8 100644 +index 910bec7cbb2ef140ab16d99f93859326b5475a25..089b50dbae2ae351d81deb041663f8885e3bfae1 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -1454,7 +1454,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1487,7 +1487,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // Paper start - optimise collisions @@ -312,10 +312,10 @@ index f8d45c1076852a0553c3dd7c5512f76a6891e2cb..1f50aca05ff1adf8f2e16cab2fac757a final boolean yZero = movement.y == 0.0; final boolean zZero = movement.z == 0.0; diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index 2046c4d3ad5ea3254ad6bc83e6437e5c237c92b6..2fe76bc1c26423ed5e39453ac1b27a2cc66b1f2e 100644 +index 20687b632f2cc3f25c8f04e34cc1f6f1d0abf741..0b958bda5e3b9b203ab4e7f233ca459a69288522 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -196,7 +196,7 @@ public abstract class Player extends LivingEntity { +@@ -205,7 +205,7 @@ public abstract class Player extends LivingEntity { private int lastLevelUpTime; public GameProfile gameProfile; private boolean reducedDebugInfo; @@ -324,7 +324,7 @@ index 2046c4d3ad5ea3254ad6bc83e6437e5c237c92b6..2fe76bc1c26423ed5e39453ac1b27a2c private final ItemCooldowns cooldowns = this.createItemCooldowns(); private Optional lastDeathLocation = Optional.empty(); @Nullable -@@ -362,6 +362,12 @@ public abstract class Player extends LivingEntity { +@@ -372,6 +372,12 @@ public abstract class Player extends LivingEntity { } } @@ -337,7 +337,7 @@ index 2046c4d3ad5ea3254ad6bc83e6437e5c237c92b6..2fe76bc1c26423ed5e39453ac1b27a2c @Override protected float getMaxHeadRotationRelativeToBody() { return this.isBlocking() ? 15.0F : super.getMaxHeadRotationRelativeToBody(); -@@ -664,7 +670,7 @@ public abstract class Player extends LivingEntity { +@@ -674,7 +680,7 @@ public abstract class Player extends LivingEntity { } } @@ -346,7 +346,7 @@ index 2046c4d3ad5ea3254ad6bc83e6437e5c237c92b6..2fe76bc1c26423ed5e39453ac1b27a2c entity.playerTouch(this); } -@@ -1287,7 +1293,7 @@ public abstract class Player extends LivingEntity { +@@ -1299,7 +1305,7 @@ public abstract class Player extends LivingEntity { this.sweepAttack(); } @@ -356,10 +356,10 @@ index 2046c4d3ad5ea3254ad6bc83e6437e5c237c92b6..2fe76bc1c26423ed5e39453ac1b27a2c boolean cancelled = false; org.bukkit.entity.Player player = (org.bukkit.entity.Player) target.getBukkitEntity(); diff --git a/net/minecraft/world/entity/projectile/FishingHook.java b/net/minecraft/world/entity/projectile/FishingHook.java -index ca5cd9354d53c6c05bd7ba50c6e1dbd1ed548f67..f82f37d498f99ce38f72a63d051721c6dab9f2ca 100644 +index 5f3abbe943be394e9cb987945a238208940b5015..8c139d572bd3c44b8e2b6205e28ab09f82c9abfe 100644 --- a/net/minecraft/world/entity/projectile/FishingHook.java +++ b/net/minecraft/world/entity/projectile/FishingHook.java -@@ -55,7 +55,7 @@ public class FishingHook extends Projectile { +@@ -58,7 +58,7 @@ public class FishingHook extends Projectile { public static final EntityDataAccessor DATA_HOOKED_ENTITY = SynchedEntityData.defineId(FishingHook.class, EntityDataSerializers.INT); private static final EntityDataAccessor DATA_BITING = SynchedEntityData.defineId(FishingHook.class, EntityDataSerializers.BOOLEAN); private int life; @@ -369,7 +369,7 @@ index ca5cd9354d53c6c05bd7ba50c6e1dbd1ed548f67..f82f37d498f99ce38f72a63d051721c6 public int timeUntilHooked; public float fishAngle; diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java -index 813417a09b4acc7d57e80a53d970767e230d75b1..2a4763c951ddc78c9d8a39e661e59bbffc5cf109 100644 +index f4548edae77eb86e54ba499acbb20613fd60d7bd..042d227fcfd31037fd7b64ba5872bb2e7f59d6c5 100644 --- a/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -376,6 +376,7 @@ public abstract class AbstractContainerMenu { @@ -404,10 +404,10 @@ index 813417a09b4acc7d57e80a53d970767e230d75b1..2a4763c951ddc78c9d8a39e661e59bbf FeatureFlagSet featureFlagSet = player.level().enabledFeatures(); return carriedItem.isItemEnabled(featureFlagSet) && carriedItem.overrideStackedOnOther(slot, action, player) diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -index 1669b76800756000a2f620610b3c8c8b6c48dd4a..8449545bd5278f5558567dd6b7c1522f63045f22 100644 +index f1ce4cff1c03a0037ade2c8ef989cf327c973a7e..0976aef81b950a062152094501372d00c20bb2b7 100644 --- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java +++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -@@ -136,7 +136,7 @@ public class PistonMovingBlockEntity extends BlockEntity { +@@ -135,7 +135,7 @@ public class PistonMovingBlockEntity extends BlockEntity { break; } @@ -446,10 +446,10 @@ index bef794c3f58c41d910aa0bcc63fbdeea7225fddf..a601da588e6973cc5b87d3e3eeba49b5 } diff --git a/net/minecraft/world/level/storage/PlayerDataStorage.java b/net/minecraft/world/level/storage/PlayerDataStorage.java -index ab9282c04c1996b037567d07f95e2b150bcfcd38..91f2e0abd1e6d5ad1613b8f750a900bfc39b2f9e 100644 +index fe44d8d17d2622b3d6021c11579af85ef96737bb..0aae211dc2048f8cd14213c2a868394d1ed16070 100644 --- a/net/minecraft/world/level/storage/PlayerDataStorage.java +++ b/net/minecraft/world/level/storage/PlayerDataStorage.java -@@ -18,7 +18,7 @@ import net.minecraft.util.datafix.DataFixTypes; +@@ -19,7 +19,7 @@ import net.minecraft.util.datafix.DataFixTypes; import net.minecraft.world.entity.player.Player; import org.slf4j.Logger; diff --git a/leaves-server/unapplied/0008-Make-shears-in-dispenser-can-unlimited-use.patch b/leaves-server/minecraft-patches/features/0008-Make-shears-in-dispenser-can-unlimited-use.patch similarity index 85% rename from leaves-server/unapplied/0008-Make-shears-in-dispenser-can-unlimited-use.patch rename to leaves-server/minecraft-patches/features/0008-Make-shears-in-dispenser-can-unlimited-use.patch index 571124f7..b4cf29a7 100644 --- a/leaves-server/unapplied/0008-Make-shears-in-dispenser-can-unlimited-use.patch +++ b/leaves-server/minecraft-patches/features/0008-Make-shears-in-dispenser-can-unlimited-use.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Make shears in dispenser can unlimited use diff --git a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -index c1bd6d91cf9828ccc7275efe0f5c959c0f457c13..310e4bd5bd0c447adc70cff6d414f88be1966d04 100644 +index b4a9be09452a889c228612a466b8925cb3768102..38442a054bbe87db8dcfab20147d19b2c758d225 100644 --- a/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java +++ b/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java @@ -45,7 +45,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { BlockPos blockPos = blockSource.pos().relative(blockSource.state().getValue(DispenserBlock.FACING)); - this.setSuccess(tryShearBeehive(serverLevel, blockPos) || tryShearLivingEntity(serverLevel, blockPos, item, bukkitBlock, craftItem)); // CraftBukkit + this.setSuccess(tryShearBeehive(serverLevel, blockPos) || tryShearEntity(serverLevel, blockPos, item, bukkitBlock, craftItem)); // CraftBukkit if (this.isSuccess()) { - item.hurtAndBreak(1, serverLevel, null, item1 -> {}); + item.hurtAndBreak(1, serverLevel, null, item1 -> { if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.shearsInDispenserCanZeroAmount) item.grow(1); }); // Leaves - Make shears in dispenser can unlimited use diff --git a/leaves-server/unapplied/0009-Redstone-Shears-Wrench.patch b/leaves-server/minecraft-patches/features/0009-Redstone-Shears-Wrench.patch similarity index 100% rename from leaves-server/unapplied/0009-Redstone-Shears-Wrench.patch rename to leaves-server/minecraft-patches/features/0009-Redstone-Shears-Wrench.patch diff --git a/leaves-server/unapplied/0010-Add-isShrink-to-EntityResurrectEvent.patch b/leaves-server/minecraft-patches/features/0010-Add-isShrink-to-EntityResurrectEvent.patch similarity index 89% rename from leaves-server/unapplied/0010-Add-isShrink-to-EntityResurrectEvent.patch rename to leaves-server/minecraft-patches/features/0010-Add-isShrink-to-EntityResurrectEvent.patch index 50e14445..150b5c91 100644 --- a/leaves-server/unapplied/0010-Add-isShrink-to-EntityResurrectEvent.patch +++ b/leaves-server/minecraft-patches/features/0010-Add-isShrink-to-EntityResurrectEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add isShrink to EntityResurrectEvent diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 3e8f4f3c3d43c6875108295187023c48eece2788..5fc4d97ef421a37158b01864b035385bb7bf5f5f 100644 +index 1ba342a1a60951f828034d3ed535b577b3990bf6..7a7971ec03fcdf72ecaa1e934d5ab3c62113c251 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -1701,14 +1701,14 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1733,14 +1733,14 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin } final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;