mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-11 13:11:50 +01:00
Max stack size is now capped at 99
This commit is contained in:
parent
3d13d6db0e
commit
6e0491d978
@ -25,7 +25,7 @@ public class ItemStats {
|
||||
NAME = new DisplayName(),
|
||||
LORE = new Lore(),
|
||||
NBT_TAGS = new NBTTags(),
|
||||
STACK_SIZE = new StackSize(),
|
||||
MAX_STACK_SIZE = new MaxStackSize(),
|
||||
LORE_FORMAT = new LoreFormat(),
|
||||
TOOLTIP = new TooltipStat(),
|
||||
|
||||
|
@ -17,16 +17,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@VersionDependant(version = {1, 20, 5})
|
||||
public class StackSize extends DoubleStat implements GemStoneStat {
|
||||
public StackSize() {
|
||||
super("STACK_SIZE", Material.CHEST, "Max Stack Size", new String[]{"Maximum amount of items which", "can be stacked together (1.20.5+)."}, new String[]{"all"});
|
||||
public class MaxStackSize extends DoubleStat implements GemStoneStat {
|
||||
public MaxStackSize() {
|
||||
super("MAX_STACK_SIZE", Material.CHEST, "Max Stack Size", new String[]{"Maximum amount of items which", "can be stacked together (1.20.5+).", "Maximum value is 99."}, new String[]{"all"});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull DoubleData data) {
|
||||
|
||||
// Edit meta
|
||||
item.getMeta().setMaxStackSize((int) data.getValue());
|
||||
item.getMeta().setMaxStackSize((int) Math.max(1, Math.min(99, data.getValue())));
|
||||
|
||||
// Apply Custom Model Data
|
||||
item.addItemTag(getAppliedNBT(data));
|
Loading…
Reference in New Issue
Block a user