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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ExamplePlugin extends JavaPlugin {
.items(
new SlotItem(
Component.text("Diamond Sword"),
(short) 13, // Center slot
13, // Center slot
Material.DIAMOND_SWORD,
1
)
Expand All @@ -72,15 +72,15 @@ Menu complexMenu = Menu.newBuilder()
.size(54)
.title(Component.text("Complex Menu"))
.items(
new SlotItem(Component.text("Shop"), (short) 10, Material.CHEST, 1),
new SlotItem(Component.text("Settings"), (short) 13, Material.REDSTONE, 1),
new SlotItem(Component.text("Info"), (short) 16, Material.BOOK, 1)
new SlotItem(Component.text("Shop"), 10, Material.CHEST, 1),
new SlotItem(Component.text("Settings"), 13, Material.REDSTONE, 1),
new SlotItem(Component.text("Info"), 16, Material.BOOK, 1)
)
.build();

// Modify menu after creation
complexMenu.addItems(
new SlotItem(Component.text("New Item"), (short) 22, Material.EMERALD, 1)
new SlotItem(Component.text("New Item"), 22, Material.EMERALD, 1)
);

// Get item at specific slot (useful for click events)
Expand Down Expand Up @@ -124,7 +124,7 @@ Represents an item in a menu slot.

**Parameters:**
- `Component itemName` - Display name of the item
- `short itemSlot` - Slot position (0-53 for chest inventories)
- `int itemSlot` - Slot position (0-53 for chest inventories)
- `Material material` - Minecraft material type
- `int quantity` - Stack size (1-64)

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/me/touchie771/minecraftGUI/api/SlotItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public record SlotItem(
@Nullable Component itemName,
short itemSlot,
int itemSlot,
@Nullable Material material,
int quantity,
@Nullable List<Component> lore,
Expand All @@ -43,7 +43,7 @@ public record SlotItem(
* @param material The material
* @param quantity The quantity
*/
public SlotItem(@NotNull Component itemName, short itemSlot, @NotNull Material material, int quantity) {
public SlotItem(@NotNull Component itemName, int itemSlot, @NotNull Material material, int quantity) {
this(itemName, itemSlot, material, quantity, null, null, null, null, null);
}
}