mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-06-26 14:24:45 +02: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; ///////////////////////////////////////////////////
|
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?")
|
@ConfigurationComment("Do you want to use built-in protection against chest destruction?")
|
||||||
public static boolean USE_BUILT_IN_PROTECTION = true;
|
public static boolean USE_BUILT_IN_PROTECTION = true;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.Acrobot.ChestShop.Listeners.PostTransaction;
|
package com.Acrobot.ChestShop.Listeners.PostTransaction;
|
||||||
|
|
||||||
import com.Acrobot.Breeze.Utils.InventoryUtil;
|
import com.Acrobot.Breeze.Utils.InventoryUtil;
|
||||||
|
import com.Acrobot.ChestShop.Configuration.Properties;
|
||||||
import com.Acrobot.ChestShop.Events.TransactionEvent;
|
import com.Acrobot.ChestShop.Events.TransactionEvent;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
@ -45,8 +46,14 @@ public class ItemManager implements Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addItems(Inventory inventory, ItemStack[] items) {
|
private static void addItems(Inventory inventory, ItemStack[] items) {
|
||||||
for (ItemStack item : items) {
|
if (Properties.STACK_TO_64) {
|
||||||
InventoryUtil.add(item, inventory);
|
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