mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-13 19:01:55 +01:00
Fixed thread crash when clicking in a non interactive inventory slot (-1)
This commit is contained in:
parent
e1a886aa3a
commit
bf10f0d3f7
@ -301,8 +301,8 @@ public class PlayerInventory implements InventoryModifier, InventoryClickHandler
|
|||||||
|
|
||||||
// Refresh slot
|
// Refresh slot
|
||||||
update();
|
update();
|
||||||
//problem with ghost item when clicking on a slot which has a different internal id
|
// FIXME: replace update() to refreshSlot, currently not possible because our inventory click handling is not exactly the same as what the client expects
|
||||||
//refreshSlot(slot);
|
//refreshSlot((short) slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setItemStackInternal(int slot, ItemStack itemStack) {
|
protected void setItemStackInternal(int slot, ItemStack itemStack) {
|
||||||
|
@ -32,6 +32,11 @@ public class WindowListener {
|
|||||||
|
|
||||||
boolean successful = false;
|
boolean successful = false;
|
||||||
|
|
||||||
|
// prevent click in a non interactive slot (why does it exist?)
|
||||||
|
if (slot == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 0:
|
case 0:
|
||||||
switch (button) {
|
switch (button) {
|
||||||
|
Loading…
Reference in New Issue
Block a user