diff --git a/src/main/java/dev/espi/protectionstones/ListenerClass.java b/src/main/java/dev/espi/protectionstones/ListenerClass.java index 783de998..a0b70842 100644 --- a/src/main/java/dev/espi/protectionstones/ListenerClass.java +++ b/src/main/java/dev/espi/protectionstones/ListenerClass.java @@ -176,14 +176,18 @@ private boolean playerBreakProtection(Player p, PSRegion r) { // return protection stone if no drop option is off if (blockOptions != null && !blockOptions.noDrop) { - if (!p.getInventory().addItem(blockOptions.createItem()).isEmpty()) { - // method will return not empty if item couldn't be added - if (ProtectionStones.getInstance().getConfigOptions().dropItemWhenInventoryFull) { - PSL.msg(p, PSL.NO_ROOM_DROPPING_ON_FLOOR.msg()); - p.getWorld().dropItem(r.getProtectBlock().getLocation(), blockOptions.createItem()); - } else { - PSL.msg(p, PSL.NO_ROOM_IN_INVENTORY.msg()); - return false; + if(blockOptions.dropAsItem){ + p.getWorld().dropItem(r.getProtectBlock().getLocation(), blockOptions.createItem()); + }else { + if (!p.getInventory().addItem(blockOptions.createItem()).isEmpty()) { + // method will return not empty if item couldn't be added + if (ProtectionStones.getInstance().getConfigOptions().dropItemWhenInventoryFull) { + PSL.msg(p, PSL.NO_ROOM_DROPPING_ON_FLOOR.msg()); + p.getWorld().dropItem(r.getProtectBlock().getLocation(), blockOptions.createItem()); + } else { + PSL.msg(p, PSL.NO_ROOM_IN_INVENTORY.msg()); + return false; + } } } } diff --git a/src/main/java/dev/espi/protectionstones/PSProtectBlock.java b/src/main/java/dev/espi/protectionstones/PSProtectBlock.java index fb2e214a..464d22b9 100644 --- a/src/main/java/dev/espi/protectionstones/PSProtectBlock.java +++ b/src/main/java/dev/espi/protectionstones/PSProtectBlock.java @@ -133,6 +133,8 @@ public class PSProtectBlock { public boolean autoMerge; @Path("behaviour.no_drop") public boolean noDrop; + @Path("behaviour.drop_as_item") + public boolean dropAsItem; @Path("behaviour.prevent_piston_push") public boolean preventPistonPush; @Path("behaviour.prevent_explode") diff --git a/src/main/resources/block1.toml b/src/main/resources/block1.toml index 112b524a..732b0a7c 100644 --- a/src/main/resources/block1.toml +++ b/src/main/resources/block1.toml @@ -216,6 +216,8 @@ placing_bypasses_wg_passthrough = true # Disable returning the block when removed/unclaimed? no_drop = false + # Determines whether the block should drop as an item. Default: false. false = instantly added to the inventory. + drop_as_item = false # Prevents piston pushing of the block. Recommended to keep as true. prevent_piston_push = true