Attempt to fix multiple clicks being triggered in chestgui
This commit is contained in:
parent
5372fd2129
commit
d773f34376
2 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue