Issue Description
The SlotItem record uses short for the itemSlot parameter, which is unusual and error-prone for inventory slot positions. Slots are naturally integers (0-53), and using short provides no benefit while potentially causing confusion.
Location
- SlotItem.java line 29
- Menu.java lines 86, 159, 339, 388
Issues with using short:
- Unnecessary casting when working with array indices
- Confusing API - users expect int for positions
- No performance benefit for modern JVMs
- Can cause signed/unsigned confusion
Suggested Fix
Change itemSlot type from short to int:
public record SlotItem(
@Nullable Component itemName,
int itemSlot, // Changed from short
@Nullable Material material,
int quantity,
// ... rest of parameters
Impact
Better API design and less confusion for users. The change would be breaking but worth it for API clarity.
Issue Description
The SlotItem record uses
shortfor the itemSlot parameter, which is unusual and error-prone for inventory slot positions. Slots are naturally integers (0-53), and using short provides no benefit while potentially causing confusion.Location
Issues with using short:
Suggested Fix
Change itemSlot type from
shorttoint:Impact
Better API design and less confusion for users. The change would be breaking but worth it for API clarity.