Rename TabGui#showTab to TabGui#setTab

This commit is contained in:
NichtStudioCode 2023-03-04 17:10:42 +01:00
parent ad42afe225
commit d437d5eef6
3 changed files with 3 additions and 3 deletions

@ -28,7 +28,7 @@ public abstract class AbstractTabGui extends AbstractGui implements TabGui {
applyStructure(structure); applyStructure(structure);
} }
public void showTab(int tab) { public void setTab(int tab) {
if (tab < 0 || tab >= tabAmount) if (tab < 0 || tab >= tabAmount)
throw new IllegalArgumentException("Tab out of bounds"); throw new IllegalArgumentException("Tab out of bounds");
if (!isTabAvailable(tab)) if (!isTabAvailable(tab))

@ -68,7 +68,7 @@ public interface TabGui extends Gui {
* *
* @param tab The index of the tab to show. * @param tab The index of the tab to show.
*/ */
void showTab(int tab); void setTab(int tab);
/** /**
* Checks if the given tab is available. * Checks if the given tab is available.

@ -20,7 +20,7 @@ public abstract class TabItem extends ControlItem<TabGui> {
@Override @Override
public void handleClick(@NotNull ClickType clickType, @NotNull Player player, @NotNull InventoryClickEvent event) { public void handleClick(@NotNull ClickType clickType, @NotNull Player player, @NotNull InventoryClickEvent event) {
if (clickType == ClickType.LEFT) getGui().showTab(tab); if (clickType == ClickType.LEFT) getGui().setTab(tab);
} }
} }