mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
Fixed firstEmpty() by making it search for the first null instead of Material.AIR.
By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
parent
498de23ae2
commit
1486672b8a
1 changed files with 7 additions and 1 deletions
|
@ -173,7 +173,13 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
|
|||
}
|
||||
|
||||
public int firstEmpty() {
|
||||
return first(Material.AIR);
|
||||
ItemStack[] inventory = getContents();
|
||||
for (int i = 0; i < inventory.length; i++) {
|
||||
if (inventory[i] == null) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int firstPartial(int materialId) {
|
||||
|
|
Loading…
Reference in a new issue