Class TerminalButtonSort<T>
java.lang.Object
org.cyclops.integratedterminals.core.terminalstorage.button.TerminalButtonSort<T>
- All Implemented Interfaces:
ITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, ITerminalStorageTabCommon, ButtonSort>
public class TerminalButtonSort<T>
extends Object
implements ITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>,ITerminalStorageTabCommon,ButtonSort>
A button for sorting based on a given
IIngredientInstanceSorter.-
Constructor Summary
ConstructorsConstructorDescriptionTerminalButtonSort(IIngredientInstanceSorter<T> instanceSorter, TerminalStorageState state, ITerminalStorageTabClient<?> clientTab) -
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.voidonClick(TerminalStorageTabIngredientComponentClient<T, ?> clientTab, ITerminalStorageTabCommon commonTab, ButtonSort 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.protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integratedterminals.api.terminalstorage.ITerminalButton
getX, getY, isInLeftColumn
-
Constructor Details
-
TerminalButtonSort
public TerminalButtonSort(IIngredientInstanceSorter<T> instanceSorter, TerminalStorageState state, ITerminalStorageTabClient<?> clientTab)
-
-
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,?>, ITerminalStorageTabCommon, ButtonSort>
-
createButton
Description copied from interface:ITerminalButtonCreate a gui button for displaying this button.- Specified by:
createButtonin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, ITerminalStorageTabCommon, ButtonSort> - Parameters:
x- The button X position.y- The button Y position.- Returns:
- The gui button.
-
onClick
public void onClick(TerminalStorageTabIngredientComponentClient<T, ?> clientTab, ITerminalStorageTabCommon commonTab, ButtonSort guiButton, int channel, int mouseButton) Description copied from interface:ITerminalButtonCallback for when the gui button has been clicked.- Specified by:
onClickin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, ITerminalStorageTabCommon, ButtonSort> - 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.
-
updateSorter
protected void updateSorter() -
getTranslationKey
- Specified by:
getTranslationKeyin interfaceITerminalButton<TerminalStorageTabIngredientComponentClient<T,?>, ITerminalStorageTabCommon, ButtonSort> - 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,?>, ITerminalStorageTabCommon, ButtonSort> - Parameters:
player- The player that is requesting the tooltip.tooltipFlag- The tooltip flag.lines- The tooltip lines.
-
getEffectiveSorter
- Returns:
- The comparator that should be used for sorting, this can change depending on the state of this button.
-