Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-17 05:20:05 +01:00
Fixed firstEmpty() by making it search for the first null instead of Material.AIR.
Dieser Commit ist enthalten in:
Ursprung
4525d16842
Commit
e2480e1347
@ -173,7 +173,13 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int firstEmpty() {
|
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) {
|
public int firstPartial(int materialId) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren