From f6461167b7f32b093a86b2c16585cdcad4bae0f2 Mon Sep 17 00:00:00 2001 From: TeamHR Date: Fri, 5 Apr 2024 03:08:55 +0530 Subject: [PATCH] [Fixed] Block stacking logic. --- .../listeners/BlockListeners.java | 2 +- .../stackable/block/BlockStackImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/listeners/BlockListeners.java b/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/listeners/BlockListeners.java index 7c78174..ee5141f 100644 --- a/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/listeners/BlockListeners.java +++ b/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/listeners/BlockListeners.java @@ -124,7 +124,7 @@ public class BlockListeners implements Listener { player.getWorld().dropItemNaturally(block.getLocation(), stack.getMaterial().parseItem()); } } - if (stack.getAmount() == 0) { + if (stack.getAmount() == 1) { //Remove stack stack.destroy(); return; diff --git a/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/stackable/block/BlockStackImpl.java b/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/stackable/block/BlockStackImpl.java index d6d62c5..c109238 100644 --- a/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/stackable/block/BlockStackImpl.java +++ b/UltimateStacker-Plugin/src/main/java/com.craftaro.ultimatestacker/stackable/block/BlockStackImpl.java @@ -23,7 +23,7 @@ public class BlockStackImpl implements BlockStack { // The id that identifies this stack in the database. private int id; - private int amount = 1; + private int amount = 2; private XMaterial material; private Location location; @@ -79,7 +79,7 @@ public class BlockStackImpl implements BlockStack { @Override public void setAmount(int amount) { - if (amount < 1) { + if (amount == 1) { destroy(); return; }