[SPIGOT-1789] inventory.firstEmpty() broken Created: 06/Mar/16 Updated: 06/Mar/16 Resolved: 06/Mar/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Major |
Reporter: | Tomas K | Assignee: | Unassigned |
Resolution: | Invalid | Votes: | 0 |
Labels: | 1.9, Spigot, bug, crash, error | ||
Environment: |
OS: Windows 10 Home Premium 64 bit |
Attachments: |
![]() |
Plugin: | mKitPVP |
Description |
Using inventory.firstEmpty in a while loop crashes the server. if (fillWithSoup) { while (inventory.firstEmpty() != 1) inventory.addItem(getSingleSoup()); player.updateInventory(); } ^That is the code that I was using when I noticed it. |
Comments |
Comment by Abs0rbed [ 06/Mar/16 ] |
Is that the exact code? Generally as I've used it, #firstEmpty() returns -1 when it can't find an empty slot |