From a4f66468ee9b2c0763fb7b381ba9b86a4c3e7436 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 14 Jan 2024 19:51:47 -0700 Subject: [PATCH] Adds the lore container to the callback --- .../dev/zontreck/libzontreck/chestgui/ChestGUIButton.java | 5 ++++- .../libzontreck/chestgui/IChestGUIButtonCallback.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java b/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java index 613a666..ce6d5e8 100644 --- a/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java +++ b/src/main/java/dev/zontreck/libzontreck/chestgui/ChestGUIButton.java @@ -29,6 +29,7 @@ public class ChestGUIButton private Vector2i position; private ItemStack built; private ItemStackHandler container; + private LoreContainer lore; /** * Sets the name of the ChestGUI Button (Item Name) @@ -89,6 +90,7 @@ public class ChestGUIButton ret = ret.setHoverName(ChatHelpers.macro(name)); built=ret; + lore=cont; return ret; } @@ -100,6 +102,7 @@ public class ChestGUIButton st.setStackInSlot(0, stack); built=stack; + lore = new LoreContainer(built); return st; } @@ -154,6 +157,6 @@ public class ChestGUIButton public void clicked() { - callback.run(built, container); + callback.run(built, container, lore); } } diff --git a/src/main/java/dev/zontreck/libzontreck/chestgui/IChestGUIButtonCallback.java b/src/main/java/dev/zontreck/libzontreck/chestgui/IChestGUIButtonCallback.java index a92753a..54baa6f 100644 --- a/src/main/java/dev/zontreck/libzontreck/chestgui/IChestGUIButtonCallback.java +++ b/src/main/java/dev/zontreck/libzontreck/chestgui/IChestGUIButtonCallback.java @@ -1,5 +1,6 @@ package dev.zontreck.libzontreck.chestgui; +import dev.zontreck.libzontreck.lore.LoreContainer; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.ItemStackHandler; @@ -13,6 +14,7 @@ public interface IChestGUIButtonCallback * A callback function that when invoked will pass the ChestGUI ItemStack * @param stack A temporary itemstack that is used for the ChestGUI * @param container The container object for manipulating other items when this is invoked + * @param lore The lore's container instance */ - void run(ItemStack stack, ItemStackHandler container); + void run(ItemStack stack, ItemStackHandler container, LoreContainer lore); }