Attempt to fix multiple clicks being triggered in chestgui

This commit is contained in:
zontreck 2024-01-15 00:24:08 -07:00
parent 5372fd2129
commit d773f34376
2 changed files with 5 additions and 3 deletions

View file

@ -16,13 +16,13 @@ public class ChestGUIReadOnlyStackHandler extends ItemStackHandler
private ChestGUI gui;
private Player player;
private long lastClickTime;
private int lastClickStack;
private int lastClickStack=-1;
public boolean validClick(int slot)
{
if(lastClickStack != slot)return true;
else{
if(Instant.now().getEpochSecond() > (lastClickTime + 1))
if(Instant.now().getEpochSecond() > (lastClickTime + 3))
{
return true;
}
@ -100,4 +100,6 @@ public class ChestGUIReadOnlyStackHandler extends ItemStackHandler
return ItemStack.EMPTY;
}
}