Class TerminalButtonItemStackCraftingGridClear<T>
java.lang.Object
org.cyclops.integratedterminals.core.terminalstorage.button.TerminalButtonItemStackCraftingGridClear<T>
- All Implemented Interfaces:
ITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage>
public class TerminalButtonItemStackCraftingGridClear<T>
extends Object
implements ITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>,TerminalStorageTabIngredientComponentItemStackCraftingCommon,org.cyclops.cyclopscore.client.gui.component.button.ButtonImage>
A button for clearing the crafting grid.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearGrid(TerminalStorageTabIngredientComponentItemStackCraftingCommon commomTab, int channel, boolean toStorage) org.cyclops.cyclopscore.client.gui.component.button.ButtonImagecreateButton(int x, int y) Create a gui button for displaying this button.voidgetTooltip(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.TooltipFlag tooltipFlag, List<net.minecraft.network.chat.Component> lines) Get the tooltip of this sorter.intgetX(int guiLeft, int offset) Calculate the final X position for this button.intgetY(int guiTop, int offset) Calculate the final Y position for this button.booleanvoidonClick(TerminalStorageTabIngredientComponentClient<T, ?> clientTab, TerminalStorageTabIngredientComponentItemStackCraftingCommon commomTab, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage guiButton, int channel, int mouseButton) Callback for when the gui button has been clicked.voidReload the button's visual representation based on the container's state.
-
Constructor Details
-
TerminalButtonItemStackCraftingGridClear
public TerminalButtonItemStackCraftingGridClear()
-
-
Method Details
-
reloadFromState
public void reloadFromState()Description copied from interface:ITerminalButtonReload the button's visual representation based on the container's state.- Specified by:
reloadFromStatein interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage>
-
getX
public int getX(int guiLeft, int offset) Description copied from interface:ITerminalButtonCalculate the final X position for this button.- Specified by:
getXin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Parameters:
guiLeft- Gui left Xoffset- X offset.- Returns:
- The final X position.
-
getY
public int getY(int guiTop, int offset) Description copied from interface:ITerminalButtonCalculate the final Y position for this button.- Specified by:
getYin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Parameters:
guiTop- Gui top Yoffset- Y offset.- Returns:
- The final Y position.
-
isInLeftColumn
public boolean isInLeftColumn()- Specified by:
isInLeftColumnin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Returns:
- If the button should be placed in the left grid column.
-
createButton
public org.cyclops.cyclopscore.client.gui.component.button.ButtonImage createButton(int x, int y) Description copied from interface:ITerminalButtonCreate a gui button for displaying this button.- Specified by:
createButtonin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Parameters:
x- The button X position.y- The button Y position.- Returns:
- The gui button.
-
onClick
public void onClick(TerminalStorageTabIngredientComponentClient<T, ?> clientTab, TerminalStorageTabIngredientComponentItemStackCraftingCommon commomTab, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage guiButton, int channel, int mouseButton) Description copied from interface:ITerminalButtonCallback for when the gui button has been clicked.- Specified by:
onClickin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Parameters:
clientTab- The client tab in which the button was clicked.commomTab- The common tab in which the button was clicked.guiButton- The gui button.channel- The active channel.mouseButton- The mouse button that was used to click with.
-
getTranslationKey
- Specified by:
getTranslationKeyin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Returns:
- The unlocalized name
-
getTooltip
public void getTooltip(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.TooltipFlag tooltipFlag, List<net.minecraft.network.chat.Component> lines) Description copied from interface:ITerminalButtonGet the tooltip of this sorter.- Specified by:
getTooltipin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, TerminalStorageTabIngredientComponentItemStackCraftingCommon, org.cyclops.cyclopscore.client.gui.component.button.ButtonImage> - Parameters:
player- The player that is requesting the tooltip.tooltipFlag- The tooltip flag.lines- The tooltip lines.
-
clearGrid
public static void clearGrid(TerminalStorageTabIngredientComponentItemStackCraftingCommon commomTab, int channel, boolean toStorage)
-