mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +01:00
[Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default.
By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
parent
6f4a370798
commit
abfdfbf0e2
1 changed files with 4 additions and 2 deletions
|
@ -49,9 +49,11 @@ public class CraftInventoryView extends InventoryView {
|
|||
|
||||
@Override
|
||||
public void setItem(int slot, ItemStack item) {
|
||||
net.minecraft.server.ItemStack stack = CraftItemStack.createNMSItemStack(item);
|
||||
if (slot != -999) {
|
||||
CraftItemStack stack = new CraftItemStack(item);
|
||||
container.getSlot(slot).set(stack.getHandle());
|
||||
container.getSlot(slot).set(stack);
|
||||
} else {
|
||||
player.getHandle().drop(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue