Interface ITerminalButton<C extends ITerminalStorageTabClient,O extends ITerminalStorageTabCommon,B extends net.minecraft.client.gui.components.Button>
- All Known Implementing Classes:
TerminalButtonFilterCrafting,TerminalButtonItemStackCraftingGridAutoRefill,TerminalButtonItemStackCraftingGridBalance,TerminalButtonItemStackCraftingGridClear,TerminalButtonSort
public interface ITerminalButton<C extends ITerminalStorageTabClient,O extends ITerminalStorageTabCommon,B extends net.minecraft.client.gui.components.Button>
-
Method Summary
Modifier and TypeMethodDescriptioncreateButton(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.default intgetX(int guiLeft, int offset) Calculate the final X position for this button.default intgetY(int guiTop, int offset) Calculate the final Y position for this button.default booleanvoidCallback for when the gui button has been clicked.voidReload the button's visual representation based on the container's state.
-
Method Details
-
reloadFromState
void reloadFromState()Reload the button's visual representation based on the container's state. -
getX
default int getX(int guiLeft, int offset) Calculate the final X position for this button.- Parameters:
guiLeft- Gui left Xoffset- X offset.- Returns:
- The final X position.
-
getY
default int getY(int guiTop, int offset) Calculate the final Y position for this button.- Parameters:
guiTop- Gui top Yoffset- Y offset.- Returns:
- The final Y position.
-
isInLeftColumn
default boolean isInLeftColumn()- Returns:
- If the button should be placed in the left grid column.
-
createButton
Create a gui button for displaying this button.- Parameters:
x- The button X position.y- The button Y position.- Returns:
- The gui button.
-
onClick
Callback for when the gui button has been clicked.- Parameters:
clientTab- The client tab in which the button was clicked.commonTab- 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
String getTranslationKey()- Returns:
- The unlocalized name
-
getTooltip
void getTooltip(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.- Parameters:
player- The player that is requesting the tooltip.tooltipFlag- The tooltip flag.lines- The tooltip lines.
-