Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/sf categories throws error when there are more than 54 categories #49

Open
ybw0014 opened this issue Apr 3, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ybw0014
Copy link
Contributor

ybw0014 commented Apr 3, 2023

Description (Required)

The command /sf categories will throw an error if there are more than 54 categories. This happens on servers with a lot of addons installed.

Steps to reproduce the Issue (Required)

Run /sf categories when there are more than 54 categories.

Expected behavior (Required)

Add pagination to avoid the error.

Server Log / Error Report

Forwarded from fork SlimefunGuguProject#10,
but i believe this will also happen due to the codes:

SCMenu menu = new SCMenu("&6Category Namespace Guide");
menu.setSize(54);
int slot = 0;
for (ItemGroup group : Slimefun.getRegistry().getAllItemGroups()) {
ItemStack catItem = group.getItem(p).clone();
ItemMeta catMeta = catItem.getItemMeta();
List<String> catLore = catMeta.getLore();
catLore.set(catLore.size() - 1, Utils.color(
"&6ID: " + group.getKey().getNamespace() + ":" + group.getKey().getKey())
); // Replaces the "Click to Open" line
catMeta.setLore(catLore);
catItem.setItemMeta(catMeta);
menu.replaceExistingItem(slot, catItem);
menu.addMenuClickHandler(slot, ChestMenuUtils.getEmptyClickHandler());
slot++;
}
menu.setPlayerInventoryClickable(false);
menu.setBackgroundNonClickable(true);
menu.open(p);

Config Files

N/A

Environment (Required)

  • Minecraft Version:
  • CS-CoreLib Version:
  • Slimefun Version:
  • Plugin Version:
@ybw0014 ybw0014 added the bug Something isn't working label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant