diff --git a/com/Acrobot/ChestShop/Config/Property.java b/com/Acrobot/ChestShop/Config/Property.java index 9fef851..b06b34e 100644 --- a/com/Acrobot/ChestShop/Config/Property.java +++ b/com/Acrobot/ChestShop/Config/Property.java @@ -17,6 +17,7 @@ public enum Property { ALLOW_LEFT_CLICK_DESTROYING(true, "If true, if you left-click your own shop sign you won't open chest's inventory, but instead you will start destroying the sign.\n"), REMOVE_EMPTY_SHOPS(false, "If true, if the shop is empty, the sign is destroyed and put into the chest, so the shop isn't usable anymore.\n"), + REMOVE_EMPTY_CHESTS(false, "If true, if the REMOVE_EMPTY_SHOPS option is turned on, the chest is also destroyed."), ADMIN_SHOP_NAME("Admin Shop", "First line of your Admin Shop's sign should look like this"), SERVER_ECONOMY_ACCOUNT("", "The economy account which Admin Shops should use and to which all taxes will go"), diff --git a/com/Acrobot/ChestShop/Listeners/PostTransaction/EmptyShopDeleter.java b/com/Acrobot/ChestShop/Listeners/PostTransaction/EmptyShopDeleter.java index 953b612..66c0f5b 100644 --- a/com/Acrobot/ChestShop/Listeners/PostTransaction/EmptyShopDeleter.java +++ b/com/Acrobot/ChestShop/Listeners/PostTransaction/EmptyShopDeleter.java @@ -1,7 +1,6 @@ package com.Acrobot.ChestShop.Listeners.PostTransaction; import com.Acrobot.ChestShop.Config.Config; -import com.Acrobot.ChestShop.Config.Property; import com.Acrobot.ChestShop.Events.TransactionEvent; import com.Acrobot.ChestShop.Signs.ChestShopSign; import com.Acrobot.ChestShop.Utils.uBlock; @@ -12,6 +11,9 @@ import org.bukkit.event.Listener; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; +import static com.Acrobot.ChestShop.Config.Property.REMOVE_EMPTY_CHESTS; +import static com.Acrobot.ChestShop.Config.Property.REMOVE_EMPTY_SHOPS; + /** * @author Acrobot */ @@ -23,7 +25,7 @@ public class EmptyShopDeleter implements Listener { } if (shopShouldBeRemoved(event.getOwnerInventory())) { - if (!ChestShopSign.isAdminShop(event.getSign())) { + if (Config.getBoolean(REMOVE_EMPTY_CHESTS) && !ChestShopSign.isAdminShop(event.getSign())) { Chest connectedChest = uBlock.findConnectedChest(event.getSign()); connectedChest.getBlock().setType(Material.AIR); } @@ -34,7 +36,7 @@ public class EmptyShopDeleter implements Listener { } private static boolean shopShouldBeRemoved(Inventory inventory) { - return Config.getBoolean(Property.REMOVE_EMPTY_SHOPS) && isEmpty(inventory); + return Config.getBoolean(REMOVE_EMPTY_SHOPS) && isEmpty(inventory); } public static boolean isEmpty(Inventory inventory) { diff --git a/com/Acrobot/ChestShop/Signs/ChestShopSign.java b/com/Acrobot/ChestShop/Signs/ChestShopSign.java index 37e58b2..bdf35da 100644 --- a/com/Acrobot/ChestShop/Signs/ChestShopSign.java +++ b/com/Acrobot/ChestShop/Signs/ChestShopSign.java @@ -41,7 +41,6 @@ public class ChestShopSign { public static boolean isValid(String[] line) { return isValidPreparedSign(line) && (line[2].toUpperCase().contains("B") || line[2].toUpperCase().contains("S")) && !line[0].isEmpty(); - } public static boolean isValid(Block sign) { diff --git a/plugin.yml b/plugin.yml index 4078d9c..796e1ac 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,7 +2,7 @@ name: ChestShop main: com.Acrobot.ChestShop.ChestShop -version: 3.50t0003 +version: 3.50t0004 #for CButD dev-url: http://dev.bukkit.org/server-mods/chestshop/