Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4b0c620
feat: start inventory v2
ArikSquad Jan 7, 2026
e2e56a4
feat: improve states
ArikSquad Jan 7, 2026
537dec1
feat: cleaner layout
ArikSquad Jan 7, 2026
bd203a8
feat: temporary DebugViewCommand
ArikSquad Jan 7, 2026
18a48cd
refactor: rename GuiLayout to ViewLayout and same for GuiSession
ArikSquad Jan 7, 2026
8a94c44
feat: shared & container views
ArikSquad Jan 8, 2026
8cdf479
feat: migrate GUIClaimReward
ArikSquad Jan 8, 2026
8c21405
feat: add support for String in title
ArikSquad Jan 8, 2026
4a55d57
feat: port GUIConsumeSoulflow and view changes
ArikSquad Jan 8, 2026
93e59d4
feat: remove persists
ArikSquad Jan 8, 2026
8a5e5f5
feat: skyblock menu
ArikSquad Jan 8, 2026
eaf203c
Merge remote-tracking branch 'origin/master' into feat/inventory-v2-b
ArikSquad Jan 8, 2026
e9027b1
Merge remote-tracking branch 'origin/master' into feat/inventory-v2-b
ArikSquad Jan 9, 2026
57309f6
feat: continue adding pagination, sbmenu, etc
ArikSquad Jan 9, 2026
432bf47
feat: clean things
ArikSquad Jan 10, 2026
68ba8d4
feat: don't reset mouse
ArikSquad Jan 10, 2026
e46203b
feat: navigator previous page name
ArikSquad Jan 10, 2026
37327af
Merge remote-tracking branch 'origin/master' into feat/inventory-v2-b
ArikSquad Jan 10, 2026
0b8b167
feat: port GUIClaimCake.java
ArikSquad Jan 10, 2026
f1bd5df
feat: ViewLayout#slots
ArikSquad Jan 10, 2026
67e2535
feat: most sbmenu views
ArikSquad Jan 10, 2026
f5d42f1
Merge remote-tracking branch 'origin/master' into feat/inventory-v2-b
ArikSquad Jan 10, 2026
1dc5d57
fix: GUIAuctionBrowser uses wrong click method
ArikSquad Jan 10, 2026
da66f15
feat: ShapedRecipe with optimized ingredient handling
ArikSquad Jan 11, 2026
7db50ae
feat: guicrafting stuff
ArikSquad Jan 11, 2026
c25d11a
Merge remote-tracking branch 'origin/master' into feat/inventory-v2-b
ArikSquad Jan 12, 2026
b7f5999
feat: continue sbmenu port
ArikSquad Jan 13, 2026
18d4992
fix: pass state instead of view
ArikSquad Jan 13, 2026
b2075ce
feat: recipes search actual state
ArikSquad Jan 13, 2026
9597fd3
feat: actually expose some views
ArikSquad Jan 13, 2026
6154b13
feat: storage views
ArikSquad Jan 13, 2026
6fe2fa9
Merge pull request #2 from ArikSquad/feat/inventory-v2-b
ArikSquad Jan 13, 2026
20f2973
refactor: parity with Hypixel page items
ArikSquad Jan 13, 2026
6531cd9
feat: port GUICreative
ArikSquad Jan 13, 2026
3b06667
Merge remote-tracking branch 'origin/master' into feat/inventory-v2
ArikSquad Jan 14, 2026
1267a61
feat: ShopView
ArikSquad Jan 14, 2026
9e1cf64
feat: soul well migration
ArikSquad Jan 14, 2026
479a2aa
Merge remote-tracking branch 'origin/master' into feat/inventory-v2
ArikSquad Jan 14, 2026
545cadc
Merge remote-tracking branch 'origin/master' into feat/inventory-v2
ArikSquad Jan 15, 2026
1f3aa94
chore: remove unused Pagination in favor of PaginationView
ArikSquad Jan 15, 2026
24cc6da
refactor: import instead
ArikSquad Jan 15, 2026
17b940c
feat: add eventNode to inventory's eventNode
ArikSquad Jan 17, 2026
8f09d5f
feat: move events out of ViewSession
ArikSquad Jan 17, 2026
0cb1271
feat: HypixelInventoryGUI as deprecated
ArikSquad Jan 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion commons/src/main/java/net/swofty/commons/StringUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ public static String getAsRomanNumeral(int num) {
}

public static String getTextFromComponent(Component component) {
if (component == null)
throw new IllegalArgumentException("Component cannot be null");
if (!(component instanceof TextComponent))
throw new IllegalArgumentException("Component must be a TextComponent");
throw new IllegalArgumentException("Component must be a TextComponent, but got: " + component.getClass().getSimpleName());
return PlainTextComponentSerializer.plainText().serialize(component);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package net.swofty.type.deepcaverns.gui;

import net.swofty.commons.skyblock.item.ItemType;
import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI;
import net.swofty.type.skyblockgeneric.gui.ShopView;
import net.swofty.type.skyblockgeneric.item.SkyBlockItem;
import net.swofty.type.skyblockgeneric.shop.type.CoinShopPrice;

public class GUIShopWalter extends SkyBlockShopGUI {
public class GUIShopWalter extends ShopView {
public GUIShopWalter() {
super("Walter", 1, SINGLE_SLOT);
super("Walter", SINGLE_SLOT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void onClick(NPCInteractEvent event) {
if (isInDialogue(player)) return;

setDialogue(player, "none").thenRun(() -> {
MathUtility.delay(() -> new GUIShopWalter().open(player), 20);
MathUtility.delay(() -> player.openView(new GUIShopWalter()), 20);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public enum CommissionMilestone {
TIER_1(1, 5, 100_000, 20, true, false, false, false, false, false),
Expand Down Expand Up @@ -58,7 +61,7 @@ public static CommissionMilestone getNextMilestone(int totalCompleted) {
}

public String[] getRewardDescriptions() {
java.util.List<String> rewards = new java.util.ArrayList<>();
List<String> rewards = new ArrayList<>();

if (unlocksEmissaries) {
rewards.add("§7- §aEmissaries");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package net.swofty.type.dwarvenmines.gui;

import net.swofty.commons.skyblock.item.ItemType;
import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI;
import net.swofty.type.skyblockgeneric.gui.ShopView;
import net.swofty.type.skyblockgeneric.item.SkyBlockItem;
import net.swofty.type.skyblockgeneric.shop.type.CoinShopPrice;

public class GUIShopLumina extends SkyBlockShopGUI {
public class GUIShopLumina extends ShopView {
public GUIShopLumina() {
super("Lumina", 1, DEFAULT);
super("Lumina", DEFAULT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public boolean looking(HypixelPlayer player) {
public void onClick(NPCInteractEvent event) {
SkyBlockPlayer player = (SkyBlockPlayer) event.getPlayer();

new GUIShopLumina().open(player);
player.openView(new GUIShopLumina());
}
}
1 change: 1 addition & 0 deletions type.generic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies {
}
implementation("dev.hollowcube:polar:1.15.0")
implementation("org.yaml:snakeyaml:2.2")
implementation("it.unimi.dsi:fastutil:8.5.18")
}

tasks.test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ private void onAchievementUnlocked(AchievementDefinition def, AchievementData.Ac
tierText = " " + toRoman(progress.getCurrentTier());
}

// TODO: make this actually clickable to open the achievements menu
Component tierHover = Component.text(def.getName() + tierText, NamedTextColor.GREEN).appendNewline()
.append(Component.text(def.getDescription(), NamedTextColor.GRAY))
.appendNewline().appendNewline()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package net.swofty.type.generic.command.commands;

import net.minestom.server.command.builder.arguments.ArgumentLiteral;
import net.swofty.type.generic.command.CommandParameters;
import net.swofty.type.generic.command.HypixelCommand;
import net.swofty.type.generic.gui.v2.test.*;
import net.swofty.type.generic.user.HypixelPlayer;
import net.swofty.type.generic.user.categories.Rank;

import java.util.List;
import java.util.stream.IntStream;

@CommandParameters(aliases = "debugview", usage = "/debugview", description = "opens a debug view", permission = Rank.STAFF, allowsConsole = false)
public class DebugViewCommand extends HypixelCommand {
@Override
public void registerUsage(MinestomCommand command) {
command.setDefaultExecutor((commandSender, commands) -> {
HypixelPlayer player = (HypixelPlayer) commandSender; // safe cast
player.openView(new TestStateView());
});

command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
player.openView(new TestContainerView());
}), new ArgumentLiteral("container"));

command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
player.openView(new TestMixedView());
}), new ArgumentLiteral("mixedView"));

// sharedView
command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
TestSharedContainerView.open(player, "a", "a");
}), new ArgumentLiteral("sharedView"));

// sharedState
command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
TestSharedStateView.openNew(player, "b");
}), new ArgumentLiteral("sharedState"));

// joinSharedState
command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
TestSharedStateView.join(player, "b");
}), new ArgumentLiteral("joinSharedState"));

// noState
command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
player.openView(new TestNoStateView());
}), new ArgumentLiteral("noState"));

// paginated
command.addSyntax(((sender, context) -> {
HypixelPlayer player = (HypixelPlayer) sender; // safe cast
List<Integer> oneTo100 = IntStream.rangeClosed(1, 100).boxed().toList();
player.openView(new TestPaginatedView(), new TestPaginatedView.State(oneTo100, 1, ""));
}), new ArgumentLiteral("paginated"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public enum ToggleType {
HAS_SPOKEN_TO_TIA(false),
HAS_SPOKEN_TO_LIFT_OPERATOR(false),
HAS_SPOKEN_TO_LAZY_MINER(false),
HAS_SPOKEN_TO_BAKER(false),
HAS_SPOKEN_TO_RUSTY(false),
HAS_SPOKEN_TO_RUSTY_ABOUT_PICKAXE(false),
HAS_SPOKEN_TO_RUSTY_ABOUT_ABIPHONE(false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum EventNodes {
PLAYER_DATA(EventNode.type("player-data", EventFilter.PLAYER).setPriority(1)),
ITEM(EventNode.type("item-listener", EventFilter.PLAYER)),
PING(EventNode.type("ping-listener", EventFilter.ALL)),
INVENTORY(EventNode.type("inventory-listener", EventFilter.INVENTORY)),
ALL(EventNode.all("all-listener")),
// Player nodes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.ConcurrentHashMap;

@Getter
@Deprecated
public abstract class HypixelInventoryGUI {
public static final Map<UUID, HypixelInventoryGUI> GUI_MAP = new ConcurrentHashMap<>();
public static final ItemStack.Builder FILLER_ITEM = ItemStack.builder(Material.BLACK_STAINED_GLASS_PANE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Objects;

@Deprecated
public abstract class HypixelPaginatedGUI<T> extends HypixelInventoryGUI {

protected PaginationList<T> latestPaged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.swofty.type.generic.user.HypixelPlayer;

@Deprecated
public interface RefreshingGUI {
/**
* If the GUI implements this method, this is the method that should be using in setting all the items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.function.Consumer;

@Deprecated
public abstract class SharedInventory extends HypixelInventoryGUI {

private static final Map<String, SharedInventoryContext> SHARED_CONTEXTS = new ConcurrentHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
package net.swofty.type.generic.gui.v2;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import net.minestom.server.component.DataComponents;
import net.minestom.server.item.ItemStack;
import net.minestom.server.item.Material;
import net.minestom.server.item.component.TooltipDisplay;
import net.swofty.type.generic.gui.v2.context.ViewContext;

import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;

public final class Components {

public static final ItemStack.Builder FILLER = ItemStack.builder(Material.BLACK_STAINED_GLASS_PANE)
.set(DataComponents.CUSTOM_NAME, Component.text(" "))
.set(DataComponents.TOOLTIP_DISPLAY, new TooltipDisplay(true, Set.of()));
public static final ItemStack.Builder CLOSE_BUTTON = ItemStack.builder(Material.BARRIER)
.set(DataComponents.CUSTOM_NAME, Component.text("§cClose"));

public static final ItemStack.Builder BACK_BUTTON = ItemStack.builder(Material.ARROW)
.set(DataComponents.CUSTOM_NAME, Component.text("§aGo Back"));

public static <S> void fill(ViewLayout<S> layout) {
layout.filler(FILLER);
}

public static <S> void close(ViewLayout<S> layout, int slot) {
layout.slot(slot, (s, c) -> CLOSE_BUTTON, (click, ctx) -> ctx.player().closeInventory());
}

public static <S> boolean back(ViewLayout<S> layout, int slot, ViewContext context) {
ViewNavigator navigator = ViewNavigator.get(context.player());
if (!navigator.hasStack()) {
return false;
}
Optional<ViewNavigator.NavigationEntry<Object>> prev = context.navigator().peekPrevious();
Component prevTitle = prev
.map(entry -> entry.view().configuration().getTitleFunction().apply(entry.state(), context))
.orElse(Component.text("§r§7previous page"));
layout.slot(slot, (s, c) -> BACK_BUTTON.lore(
Component.text("§7To ").append(prevTitle)
.color(NamedTextColor.GRAY).decorationIfAbsent(TextDecoration.ITALIC, TextDecoration.State.FALSE)
), (_, ctx) -> {
ViewNavigator.get(ctx.player()).pop();
});
return true;
}

public static <S> boolean back(ViewLayout<S> layout, int slot, ViewContext context, ItemStack.Builder customButton) {
ViewNavigator navigator = ViewNavigator.get(context.player());
if (!navigator.hasStack()) {
return false;
}
layout.slot(slot, (s, c) -> customButton, (click, ctx) -> {
ViewNavigator.get(ctx.player()).pop();
});
return true;
}

public static <S> void backAlways(ViewLayout<S> layout, int slot) {
layout.slot(slot, (s, c) -> BACK_BUTTON, (click, ctx) -> {
ViewNavigator navigator = ViewNavigator.get(ctx.player());
if (!navigator.pop()) {
ctx.player().closeInventory();
}
});
}

public static <S> void backOrClose(ViewLayout<S> layout, int slot, ViewContext context) {
ViewNavigator navigator = ViewNavigator.get(context.player());
if (navigator.hasStack()) {
layout.slot(slot, (s, c) -> BACK_BUTTON, (click, ctx) -> {
ViewNavigator.get(ctx.player()).pop();
});
} else {
layout.slot(slot, (s, c) -> CLOSE_BUTTON, (click, ctx) -> ctx.player().closeInventory());
}
}

public static <S> void back(ViewLayout<S> layout, int slot, View<?> target, Object targetState) {
layout.slot(slot, (s, c) -> BACK_BUTTON, (click, ctx) -> open(ctx, target, targetState));
}

@SuppressWarnings("unchecked")
public static <T> void open(ViewContext ctx, View<T> view, Object state) {
ViewNavigator.get(ctx.player()).push(view, (T) state);
}

public static <S> void editableSlot(ViewLayout<S> layout, int slot, Function<S, ItemStack> itemGetter, SlotChangeHandler<S> onChange) {
layout.editable(slot, (s, c) -> itemGetter.apply(s).builder(), onChange);
}

public static <S> void editableSlotFromMap(ViewLayout<S> layout, int slot, Function<S, Map<Integer, ItemStack>> mapGetter, SlotChangeHandler<S> onChange) {
layout.editable(slot, (s, c) -> mapGetter.apply(s).getOrDefault(slot, ItemStack.AIR).builder(), onChange);
}

public static <S> void editableGrid(ViewLayout<S> layout, List<Integer> slots, Function<S, List<ItemStack>> itemsGetter, SlotChangeHandler<S> onChange) {
for (int i = 0; i < slots.size(); i++) {
int slot = slots.get(i);
int index = i;
layout.editable(slot, (s, c) -> {
List<ItemStack> items = itemsGetter.apply(s);
return index < items.size() ? items.get(index).builder() : ItemStack.AIR.builder();
}, onChange);
}
}

public static <S> void editableGridFromMap(ViewLayout<S> layout, Collection<Integer> slots, Function<S, Map<Integer, ItemStack>> mapGetter, SlotChangeHandler<S> onChange) {
for (int slot : slots) {
layout.editable(slot, (s, c) -> mapGetter.apply(s).getOrDefault(slot, ItemStack.AIR).builder(), onChange);
}
}

public static <S> void containerGrid(ViewLayout<S> layout, int startSlot, int endSlot, SlotChangeHandler<S> onChange) {
layout.editableGrid(startSlot, endSlot, onChange);
}

public static <S> void sharedContainerGrid(ViewLayout<S> layout, int startSlot, int endSlot) {
List<Integer> slots = Layouts.rectangle(startSlot, endSlot);
layout.editableSlots(slots);
}

public static <S> void prevPage(ViewLayout<S> layout, int slot, Function<S, Integer> currentPageGetter, BiFunction<S, Integer, S> pageUpdater) {
layout.slot(slot, (s, c) -> {
int page = currentPageGetter.apply(s);
if (page > 0) {
return ItemStack.builder(Material.ARROW).set(DataComponents.CUSTOM_NAME, Component.text("§ePrevious Page"));
}
return FILLER;
}, (click, ctx) -> {
int page = currentPageGetter.apply(click.state());
if (page > 0) {
ctx.session(Object.class).updateUnchecked(state -> pageUpdater.apply((S) state, page - 1));
}
});
}

public static <S> void nextPage(ViewLayout<S> layout, int slot, Function<S, Integer> currentPageGetter, Function<S, Integer> totalPagesGetter, BiFunction<S, Integer, S> pageUpdater) {
layout.slot(slot, (s, c) -> {
int page = currentPageGetter.apply(s);
int total = totalPagesGetter.apply(s);
if (page < total - 1) {
return ItemStack.builder(Material.ARROW).set(DataComponents.CUSTOM_NAME, Component.text("§eNext Page"));
}
return FILLER;
}, (click, ctx) -> {
int page = currentPageGetter.apply(click.state());
int total = totalPagesGetter.apply(click.state());
if (page < total - 1) {
ctx.session(Object.class).updateUnchecked(state -> pageUpdater.apply((S) state, page + 1));
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package net.swofty.type.generic.gui.v2;

public record DefaultState() {}
Loading