Adds the lore container to the callback
This commit is contained in:
parent
2e0dce868b
commit
a4f66468ee
2 changed files with 7 additions and 2 deletions
|
@ -29,6 +29,7 @@ public class ChestGUIButton
|
||||||
private Vector2i position;
|
private Vector2i position;
|
||||||
private ItemStack built;
|
private ItemStack built;
|
||||||
private ItemStackHandler container;
|
private ItemStackHandler container;
|
||||||
|
private LoreContainer lore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the name of the ChestGUI Button (Item Name)
|
* Sets the name of the ChestGUI Button (Item Name)
|
||||||
|
@ -89,6 +90,7 @@ public class ChestGUIButton
|
||||||
|
|
||||||
ret = ret.setHoverName(ChatHelpers.macro(name));
|
ret = ret.setHoverName(ChatHelpers.macro(name));
|
||||||
built=ret;
|
built=ret;
|
||||||
|
lore=cont;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -100,6 +102,7 @@ public class ChestGUIButton
|
||||||
st.setStackInSlot(0, stack);
|
st.setStackInSlot(0, stack);
|
||||||
|
|
||||||
built=stack;
|
built=stack;
|
||||||
|
lore = new LoreContainer(built);
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,6 +157,6 @@ public class ChestGUIButton
|
||||||
|
|
||||||
public void clicked()
|
public void clicked()
|
||||||
{
|
{
|
||||||
callback.run(built, container);
|
callback.run(built, container, lore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package dev.zontreck.libzontreck.chestgui;
|
package dev.zontreck.libzontreck.chestgui;
|
||||||
|
|
||||||
|
import dev.zontreck.libzontreck.lore.LoreContainer;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraftforge.items.ItemStackHandler;
|
import net.minecraftforge.items.ItemStackHandler;
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ public interface IChestGUIButtonCallback
|
||||||
* A callback function that when invoked will pass the ChestGUI ItemStack
|
* A callback function that when invoked will pass the ChestGUI ItemStack
|
||||||
* @param stack A temporary itemstack that is used for the ChestGUI
|
* @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 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);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue