[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
CPU: AMD Athlon X4 760K
RAM: 8gb DDR3 1600 mhz


Attachments: PNG File Thread Dump.png    
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

Generated at Tue Apr 08 02:45:48 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.