[Bleeding] Make InventoryView.setItem(-999, item) drop the item on the ground by default.
This commit is contained in:
parent
f528e62a84
commit
09eacb968d
@ -88,6 +88,9 @@ public abstract class InventoryView {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets one item in this inventory view by its raw slot ID.
|
* 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 slot The ID as returned by InventoryClickEvent.getRawSlot()
|
||||||
* @param item The new item to put in the slot, or null to clear it.
|
* @param item The new item to put in the slot, or null to clear it.
|
||||||
*/
|
*/
|
||||||
@ -98,6 +101,8 @@ public abstract class InventoryView {
|
|||||||
} else {
|
} else {
|
||||||
getBottomInventory().setItem(convertSlot(slot),item);
|
getBottomInventory().setItem(convertSlot(slot),item);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
getPlayer().getWorld().dropItemNaturally(getPlayer().getLocation(), item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user