From 007142891bab4b3594055f4bfd9d292e59f737a1 Mon Sep 17 00:00:00 2001 From: zhangyuheng Date: Sun, 6 Oct 2024 23:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E6=8E=89=E8=90=BD?= =?UTF-8?q?=E7=89=A9=E7=9A=84=E4=BC=98=E5=8C=96=EF=BC=8C=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=90=83=E5=88=B0=E7=B2=BE=E5=87=86=E9=87=87=E9=9B=86buff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/cn/lunadeer/liteworldedit/Jobs/Remove.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 80d4897..9937380 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.lunadeer LiteWorldEdit - 2.4.3.9 + 2.5.0.1 jar LiteWorldEdit diff --git a/src/main/java/cn/lunadeer/liteworldedit/Jobs/Remove.java b/src/main/java/cn/lunadeer/liteworldedit/Jobs/Remove.java index 00da5b1..ae3ed06 100644 --- a/src/main/java/cn/lunadeer/liteworldedit/Jobs/Remove.java +++ b/src/main/java/cn/lunadeer/liteworldedit/Jobs/Remove.java @@ -8,6 +8,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; +import java.util.Collection; import java.util.HashMap; public class Remove extends Job { @@ -45,10 +46,12 @@ public class Remove extends Job { BlockBreakEvent event = new BlockBreakEvent(raw_block, _creator); Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { - Material block_type = raw_block.getType(); + Collection drops = raw_block.getDrops(pickaxe, _creator); raw_block.setType(Material.AIR); if (LiteWorldEdit.instance.getConfigMgr().isDropItems()) { - raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), new ItemStack(block_type)); + for (ItemStack drop : drops) { + raw_block.getWorld().dropItemNaturally(raw_block.getLocation(), drop); + } } // 损坏镐 if (!_creator.isOp() && _creator.getGameMode() != GameMode.CREATIVE) {