mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +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
ade2f5568b
commit
86b97ec79e
1 changed files with 5 additions and 0 deletions
|
@ -88,6 +88,9 @@ public abstract class InventoryView {
|
|||
|
||||
/**
|
||||
* Sets one item in this inventory view by its raw slot ID.
|
||||
* <p>
|
||||
* Note: If slot ID -999 is chosen, it may be expected that the item is
|
||||
* dropped on the ground. This is not required behaviour, however.
|
||||
* @param slot The ID as returned by InventoryClickEvent.getRawSlot()
|
||||
* @param item The new item to put in the slot, or null to clear it.
|
||||
*/
|
||||
|
@ -98,6 +101,8 @@ public abstract class InventoryView {
|
|||
} else {
|
||||
getBottomInventory().setItem(convertSlot(slot),item);
|
||||
}
|
||||
} else {
|
||||
getPlayer().getWorld().dropItemNaturally(getPlayer().getLocation(), item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue