mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
Ignore spurious slot IDs sent by client, e.g. in enchanting tables
By: md_5 <git@md-5.net>
This commit is contained in:
parent
022955b377
commit
1c116bb13c
@ -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…
Reference in New Issue
Block a user