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

@ -53,7 +53,7 @@ mod_name=Zontreck Library Mod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPLv3
# The mod version. See https://semver.org/
mod_version=1.10.011424.1952
mod_version=1.10.011524.0023
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

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;
}
}