Max stack size is now capped at 99

This commit is contained in:
Jules 2024-06-20 19:21:47 -07:00
parent 3d13d6db0e
commit 6e0491d978
2 changed files with 5 additions and 5 deletions

View File

@ -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(),

View File

@ -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));