Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public enum BedrockEnchantment {
BREACH,
LUNGE;

public static final int INVALID = 43;

private static final BedrockEnchantment[] VALUES = values();

public static final int INVALID = VALUES.length + 1;

private final String javaIdentifier;

BedrockEnchantment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,8 @@ private static void setupBasicItemInfo(CustomItemDefinition definition, DataComp
stackSize = 1;
}
}
// Bedrock's stack size can be at most 64
if (stackSize > 64) {
stackSize = 64;
}

itemProperties.putInt("max_stack_size", stackSize);
itemProperties.putInt("max_stack_size", Math.min(stackSize, Item.BEDROCK_MAX_STACK_SIZE));

// Ignore durability if the item's predicates requires that it be unbreakable
if (maxDamage > 0 && !isUnbreakableItem(definition)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ private static DataComponents checkComponents(CustomItemDefinition definition, I
if (equippable != null && stackSize > 1 && firstPass) {
GeyserImpl.getInstance().getLogger().warning("Bedrock doesn't support stackable equippable items! Custom item %s with stack size %s and equippable component for slot %s will not work as expected!"
.formatted(definition.bedrockIdentifier(), stackSize, equippable.slot()));
} else if (stackSize > 64 && firstPass) {
GeyserImpl.getInstance().getLogger().warning("Bedrock doesn't support stack sizes above 64! Custom item %s with stack size %s will be clamped to 64!"
.formatted(definition.bedrockIdentifier(), stackSize));
} else if (stackSize > Item.BEDROCK_MAX_STACK_SIZE && firstPass) {
GeyserImpl.getInstance().getLogger().warning("Bedrock doesn't support stack sizes above %s! Custom item %s with stack size %s will be clamped to %1$s!"
.formatted(Item.BEDROCK_MAX_STACK_SIZE, definition.bedrockIdentifier(), stackSize));
} else if (stackSize > 1 && maxDamage > 0) {
throw new InvalidItemComponentsException("Stack size must be 1 when max damage is above 0");
}
Expand Down
Loading