mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Add constant in ItemStack for VanillaStackingRule
This commit is contained in:
parent
7d55d6db87
commit
8e849ad947
@ -31,6 +31,8 @@ public final class ItemStack implements TagReadable, HoverEventSource<HoverEvent
|
||||
*/
|
||||
public static final @NotNull ItemStack AIR = ItemStack.of(Material.AIR);
|
||||
|
||||
public static final @NotNull VanillaStackingRule DEFAULT_STACKING_RULE = new VanillaStackingRule();
|
||||
|
||||
private final StackingRule stackingRule;
|
||||
|
||||
private final Material material;
|
||||
@ -43,7 +45,7 @@ public final class ItemStack implements TagReadable, HoverEventSource<HoverEvent
|
||||
this.material = material;
|
||||
this.amount = amount;
|
||||
this.meta = meta;
|
||||
this.stackingRule = Objects.requireNonNullElseGet(stackingRule, VanillaStackingRule::new);
|
||||
this.stackingRule = Objects.requireNonNullElse(stackingRule, DEFAULT_STACKING_RULE);
|
||||
}
|
||||
|
||||
@Contract(value = "_ -> new", pure = true)
|
||||
|
Loading…
Reference in New Issue
Block a user