Reduce chance of quick move task while disabling

Closes #2226
This commit is contained in:
KennyTV 2020-12-08 12:42:13 +01:00
parent d75420a35b
commit 7858b998ca
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -51,10 +51,8 @@ public class BukkitInventoryQuickMoveProvider extends InventoryQuickMoveProvider
return false;
}
if (windowId == 0) {
/**
* windowId is always 0 for player inventory.
* This has almost definitely something to do with the offhand slot.
*/
// windowId is always 0 for player inventory.
// This has almost definitely something to do with the offhand slot.
if (slotId >= 36 && slotId <= 44) {
int protocolId = ProtocolRegistry.SERVER_PROTOCOL;
// this seems to be working just fine.
@ -73,7 +71,7 @@ public class BukkitInventoryQuickMoveProvider extends InventoryQuickMoveProvider
}
// http://wiki.vg/index.php?title=Protocol&oldid=13223#Click_Window
updateTask.addItem(windowId, slotId, actionId);
if (!registered) {
if (!registered && Via.getPlatform().isPluginEnabled()) {
Via.getPlatform().runSync(updateTask, 5L);
}
return true;