mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-24 01:07:32 +01:00
Added configuration for the stacking
This commit is contained in:
parent
8d7389b7e0
commit
c357141107
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user