mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 19:55:17 +01:00
Fixed unaccurate logic in PanelBuilder#nextSlot()
This commit is contained in:
parent
e7649f19d4
commit
d7b2c70b78
@ -71,10 +71,13 @@ public class PanelBuilder {
|
||||
|
||||
/**
|
||||
* Get the next free slot number
|
||||
* @return next slot number
|
||||
* @return next slot number, or -1 in case none has been found.
|
||||
*/
|
||||
public int nextSlot() {
|
||||
return items.isEmpty() ? 0 : items.lastKey() + 1;
|
||||
for (int i = 0 ; i < (size == 0 ? 54 : size) ; i++) {
|
||||
if (!slotOccupied(i)) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user