Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-17 05:20:05 +01:00
[Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default.
Dieser Commit ist enthalten in:
Ursprung
83265005f6
Commit
66e067f373
@ -49,9 +49,11 @@ public class CraftInventoryView extends InventoryView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setItem(int slot, ItemStack item) {
|
public void setItem(int slot, ItemStack item) {
|
||||||
|
net.minecraft.server.ItemStack stack = CraftItemStack.createNMSItemStack(item);
|
||||||
if (slot != -999) {
|
if (slot != -999) {
|
||||||
CraftItemStack stack = new CraftItemStack(item);
|
container.getSlot(slot).set(stack);
|
||||||
container.getSlot(slot).set(stack.getHandle());
|
} else {
|
||||||
|
player.getHandle().drop(stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren