Skip to content

Commit

Permalink
v3.5.0.1
Browse files Browse the repository at this point in the history
-Fix addPagedItem methods in PagedKamiMenu requiring slot (which has no meaning)

Took 3 minutes
  • Loading branch information
Jake-Moore committed Aug 30, 2024
1 parent 279de1a commit 7f13c5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.util.*

@Suppress("PropertyName")
var VERSION = "3.5.0.0"
var VERSION = "3.5.0.1"

plugins { // needed for the subprojects section to work
id("java")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void openPaged(@NotNull Player player) {
for (int i = 1; i < 45; i++) {
String id = "Item" + i;
IBuilder builder = new ItemBuilder(XMaterial.STONE).setName("&fItem &7#" + i);
paged.addPagedItem(builder, i).setMenuClick((p, c) ->
paged.addPagedItem(builder).setMenuClick((p, c) ->
p.sendMessage(StringUtil.t("&7Paged Item Click (&f" + c.name() + "&7) on &f" + id))
);
}
Expand All @@ -73,7 +73,7 @@ private void openPaged2(@NotNull Player player) {
for (int i = 1; i < 45; i++) {
String id = "Item" + i;
IBuilder builder = new ItemBuilder(XMaterial.STONE).setName("&fItem &7#" + i);
paged.addPagedItem(builder, i).setMenuClick((p, c) ->
paged.addPagedItem(builder).setMenuClick((p, c) ->
p.sendMessage(StringUtil.t("&7Paged Item Click (&f" + c.name() + "&7) on &f" + id))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,37 +96,21 @@ public void setNextIconSlot(@NotNull ItemSlot slot) {
// Item Management //
// ------------------------------------------------------------ //
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull IBuilder builder, int slot) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(slot), builder));
public @NotNull MenuItem addPagedItem(@NotNull IBuilder builder) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(-1), builder));
}
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull IBuilder builder, @NotNull ItemSlot slot) {
return this.addPagedItem(new MenuItem(true, slot, builder));
}
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull ItemStack stack, int slot) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(slot), new ItemBuilder(stack)));
}
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull ItemStack stack, @NotNull ItemSlot slot) {
return this.addPagedItem(new MenuItem(true, slot, new ItemBuilder(stack)));
public @NotNull MenuItem addPagedItem(@NotNull ItemStack stack) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(-1), new ItemBuilder(stack)));
}

@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull String id, @NotNull IBuilder builder, int slot) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(slot), builder).setId(id));
}
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull String id, @NotNull ItemStack stack, int slot) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(slot), new ItemBuilder(stack)).setId(id));
}
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull String id, @NotNull IBuilder builder, @NotNull ItemSlot slot) {
return this.addPagedItem(new MenuItem(true, slot, builder).setId(id));
public @NotNull MenuItem addPagedItem(@NotNull String id, @NotNull IBuilder builder) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(-1), builder).setId(id));
}
@CheckReturnValue
public @NotNull MenuItem addPagedItem(@NotNull String id, @NotNull ItemStack stack, @NotNull ItemSlot slot) {
return this.addPagedItem(new MenuItem(true, slot, new ItemBuilder(stack)).setId(id));
public @NotNull MenuItem addPagedItem(@NotNull String id, @NotNull ItemStack stack) {
return this.addPagedItem(new MenuItem(true, new StaticItemSlot(-1), new ItemBuilder(stack)).setId(id));
}

@CheckReturnValue
Expand Down

0 comments on commit 7f13c5a

Please sign in to comment.