mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
Ignore spurious slot IDs sent by client, e.g. in enchanting tables
This commit is contained in:
parent
5d2a10c5c5
commit
15c9b1eb5a
1 changed files with 3 additions and 1 deletions
|
@ -210,7 +210,9 @@ public abstract class InventoryView {
|
|||
* @return corresponding inventory, or null
|
||||
*/
|
||||
public final Inventory getInventory(int rawSlot) {
|
||||
if (rawSlot == OUTSIDE) {
|
||||
// Slot may be -1 if not properly detected due to client bug
|
||||
// e.g. dropping an item into part of the enchantment list section of an enchanting table
|
||||
if (rawSlot == OUTSIDE || rawSlot == -1) {
|
||||
return null;
|
||||
}
|
||||
Preconditions.checkArgument(rawSlot >= 0, "Negative, non outside slot %s", rawSlot);
|
||||
|
|
Loading…
Add table
Reference in a new issue