We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug: Method ChestInventory.selectItemAtWithShift crashes every time you call it with slot >= 54.
Fix:
@Override public synchronized void selectItemAtWithShift(int slot) { delay(); ItemStack item = getItemAt(slot); int rangeStart, rangeEnd; if(item == null) return; if(slot < items.length) { rangeStart = items.length; rangeEnd = items.length + inventory.length; } else { rangeStart = 0; rangeEnd = items.length; } boolean slotFound = false; for(int i = rangeStart; i < rangeEnd; i++) { if((slot < items.length ? inventory[i - items.length] : items[i]) == null) { if(slot < items.length) { items[slot] = null; inventory[i - items.length] = item; } else { items[i] = item; inventory[slot - items.length] = null; } slotFound = true; break; } } if(!slotFound) return; bot.getEventBus().fire(new InventoryChangeEvent(this, slot, 0, (short) 0, item, true)); }
I tried making a PR but i failed. My GitHub skills are just terrible, so I'm posting this as an issue with proposed fix.
The text was updated successfully, but these errors were encountered:
The inventory system is rather poorly implemented and now outdated.
Sorry, something went wrong.
No branches or pull requests
Bug: Method ChestInventory.selectItemAtWithShift crashes every time you call it with slot >= 54.
Fix:
I tried making a PR but i failed. My GitHub skills are just terrible, so I'm posting this as an issue with proposed fix.
The text was updated successfully, but these errors were encountered: