Added configuration for the stacking

This commit is contained in:
Acrobot 2013-02-07 14:17:23 +01:00
parent 8d7389b7e0
commit c357141107
2 changed files with 12 additions and 2 deletions

View File

@ -97,6 +97,9 @@ public class Properties {
public static byte NEWLINE_RECORD_TIME_TO_LIV; ///////////////////////////////////////////////////
@ConfigurationComment("Do you want to stack all items up to 64 item stacks?")
public static boolean STACK_TO_64 = false;
@ConfigurationComment("Do you want to use built-in protection against chest destruction?")
public static boolean USE_BUILT_IN_PROTECTION = true;

View File

@ -1,6 +1,7 @@
package com.Acrobot.ChestShop.Listeners.PostTransaction;
import com.Acrobot.Breeze.Utils.InventoryUtil;
import com.Acrobot.ChestShop.Configuration.Properties;
import com.Acrobot.ChestShop.Events.TransactionEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -45,8 +46,14 @@ public class ItemManager implements Listener {
}
private static void addItems(Inventory inventory, ItemStack[] items) {
for (ItemStack item : items) {
InventoryUtil.add(item, inventory);
if (Properties.STACK_TO_64) {
for (ItemStack item : items) {
InventoryUtil.add(item, inventory, 64);
}
} else {
for (ItemStack item : items) {
InventoryUtil.add(item, inventory);
}
}
}
}