diff --git a/gradle.properties b/gradle.properties index b86e2a0..384e40f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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.011524.0023 +mod_version=1.10.011524.0036 # 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 diff --git a/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java b/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java index ce6d5e8..45afc5a 100644 --- a/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java +++ b/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java @@ -11,6 +11,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.ItemStackHandler; +import java.time.Instant; import java.util.ArrayList; import java.util.List; @@ -155,8 +156,17 @@ public class ChestGUIButton return (int) Math.floor((position.x * 9) + position.y); } + private static long lastInvoked = 0; + /** + * Button was clicked! + */ public void clicked() { - callback.run(built, container, lore); + if(Instant.now().getEpochSecond() > (lastInvoked + 3)) + { + + lastInvoked = Instant.now().getEpochSecond(); + callback.run(built, container, lore); + } } }