Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
Fixed removeItem implementation
Dieser Commit ist enthalten in:
Ursprung
7ea93a1105
Commit
d048167d16
@ -234,18 +234,19 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
|
|||||||
if (first == -1) {
|
if (first == -1) {
|
||||||
item.setAmount( toDelete );
|
item.setAmount( toDelete );
|
||||||
leftover.put(i, item);
|
leftover.put(i, item);
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
ItemStack itemStack = getItem(first);
|
CraftItemStack itemStack = getItem(first);
|
||||||
int amount = itemStack.getAmount();
|
int amount = itemStack.getAmount();
|
||||||
|
|
||||||
if (amount <= toDelete) {
|
if (amount <= toDelete) {
|
||||||
toDelete -= amount;
|
toDelete -= amount;
|
||||||
// clear the slot, all used up
|
// clear the slot, all used up
|
||||||
clear( i );
|
clear( first );
|
||||||
} else {
|
} else {
|
||||||
// split the stack and store
|
// split the stack and store
|
||||||
itemStack.setAmount( amount - toDelete );
|
itemStack.setAmount( amount - toDelete );
|
||||||
setItem( i, itemStack );
|
setItem( first, itemStack );
|
||||||
toDelete = 0;
|
toDelete = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren