Skip to content

1.21.11 add Favourite function.#10

Open
STK0Cervanthes wants to merge 15 commits intoGjum:mainfrom
ToBeDeveloped:1.21.11-Feat-Favourites-Cerv
Open

1.21.11 add Favourite function.#10
STK0Cervanthes wants to merge 15 commits intoGjum:mainfrom
ToBeDeveloped:1.21.11-Feat-Favourites-Cerv

Conversation

@STK0Cervanthes
Copy link
Contributor

This adds a "Favourite" button and "Star" buttons next to exchanges.

Every Exchange now has a "Star" button if that button is pressed that particular exchange is marked as "Favourite"

in the GUI you can differentiate between showing Everything or Showing exchanges you have Favourited.

Supports showing search results in game meaning if you have Show: Favourite selected and show search results in game only said favourites will be shown in game.

Favourites are persistend between sessions.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still correct? I believe the UUID and token may have been flipped in 1.21.11?


private void save() {
try {
Files.writeString(FAVORITES_FILE, gson.toJson(favoriteKeys));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we prevent a race condition here? If this is called from two threads, a corrupt file may be written.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often does this get printed?

@Gjum
Copy link
Owner

Gjum commented Feb 24, 2026

please rebase onto the main branch

public static @NotNull String keyOf(@NotNull Exchange exchange) {
return exchange.pos.server + "|" + exchange.pos.world + "|"
+ exchange.pos.x + "|" + exchange.pos.y + "|" + exchange.pos.z
+ "|" + exchange.index;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason why index is part of the favorite key? If some trades before a favorite are removed from a chest, is it no longer a favorite?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants