Index 54 out of bounds for length 54
Is there an existing issue for this?
- [X] I have searched the existing issues
🐛 Describe the bug
Tenho este erro ao preencher o inventário inteiro (tem que preencher todo o inventário).
public class UnlockInventory extends View {
private final Configuration inventory;
private final ItemStack decoration = new ItemBuilder(Material.STAINED_GLASS_PANE)
.setDisplayName("§0§l")
.build();
public UnlockInventory(Configuration inventory) {
this.inventory = inventory;
}
@Override
public void onFirstRender(@NotNull RenderContext render) {
for (int i = 0; i < 54; i++) {
render.slot(i, decoration);
}
}
@Override
public void onInit(ViewConfigBuilder config) {
config
.title("Unlock")
.size(54)
.cancelOnClick()
.cancelOnDrag()
.cancelOnDrop()
.cancelOnPickup()
.build();
}
}
Erro:
✔️ Expected behavior
No response
👣 Steps to Reproduce
No response
💻 Platform
- [X] Bukkit
- [ ] Sponge
- [ ] Other
⭐ Server Version
1.8.9
📚 Library Version
latest
✍️ Additional context
No response
@goncalodelima Natan is not active in this repo... Can u pls open a PR with steps to reproduce in the example plugin
I recoment using layouts instad.
going through the same issuing, trying to list items from slot [0-4] in hopper type inventory, it throws that exception on opening, fixed using availableSlot but that removes the ability of having the slot in config, might change it to layout.
@DevNatan