Skip to content

Commit

Permalink
Release 0.3.5
Browse files Browse the repository at this point in the history
- [feat] Added ability to manually track items that may not be in your inventory
- [fix] Vendor interactions have been reworked to hopefully prevent players and mobs from appearing as vendors
- [fix] Right-click tracking now works correctly for NPC search and ingredient search
- [fix] Vertical scrolling on item list using mouse scroll no longer jumps quickly
- [fix] Added missing tracking highlighting in vendor and ingredient views
- [fix] Item count number alignment is now consistent
- [fix] Removed Airbrine
  • Loading branch information
blackjack26 committed Sep 11, 2024
1 parent 3386508 commit 2f2042f
Show file tree
Hide file tree
Showing 22 changed files with 1,255 additions and 960 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cloth_config_version=12.0.119
mod_menu_version=8.0.1

# Project Metadata
mod_version=0.3.4
mod_version=0.3.5
mod_name=Blockgame Journal
default_release_type=release
github_owner=blackjack26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class GeneralConfig implements ConfigData {
@ConfigEntry.Gui.Tooltip
public boolean showRecipeLock;

@ConfigEntry.Gui.Tooltip
public boolean enableManualTracking;

@ConfigEntry.Gui.Tooltip
@ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON)
public JournalMode.Type defaultMode;
Expand All @@ -29,6 +32,7 @@ public GeneralConfig() {
highlightMissingRecipes = true;
highlightOutdatedRecipes = true;
showRecipeLock = true;
enableManualTracking = false;
defaultMode = JournalMode.Type.ITEM_SEARCH;
defaultNpcSort = ItemListWidget.VendorSort.A_TO_Z;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
import dev.bnjc.blockgamejournal.client.BlockgameJournalClient;
import dev.bnjc.blockgamejournal.gamefeature.GameFeature;
import dev.bnjc.blockgamejournal.gamefeature.recipetracker.handlers.BackpackHandler;
import dev.bnjc.blockgamejournal.gamefeature.recipetracker.handlers.CraftingStationHandler;
import dev.bnjc.blockgamejournal.gamefeature.recipetracker.handlers.ProfileHandler;
import dev.bnjc.blockgamejournal.gamefeature.recipetracker.handlers.RecipePreviewHandler;
import dev.bnjc.blockgamejournal.gamefeature.recipetracker.handlers.vendor.VendorHandler;
import dev.bnjc.blockgamejournal.gui.screen.JournalScreen;
import dev.bnjc.blockgamejournal.journal.Journal;
import dev.bnjc.blockgamejournal.journal.npc.NPCEntry;
import dev.bnjc.blockgamejournal.listener.chat.ReceiveChatListener;
import dev.bnjc.blockgamejournal.listener.interaction.EntityAttackedListener;
import dev.bnjc.blockgamejournal.listener.interaction.ItemInteractListener;
import dev.bnjc.blockgamejournal.listener.renderer.PostRenderListener;
import dev.bnjc.blockgamejournal.storage.Storage;
Expand Down Expand Up @@ -72,21 +70,14 @@ public class RecipeTrackerGameFeature extends GameFeature {
private static final Pattern BALANCE_PATTERN = Pattern.compile("Balance: ([\\d,]+(?:\\.\\d+)?)\\$");

@Getter
private final RecipePreviewHandler recipePreviewHandler;

@Getter
private final CraftingStationHandler craftingStationHandler;
private final VendorHandler vendorHandler;

@Getter
private final ProfileHandler profileHandler;

@Getter
private final BackpackHandler backpackHandler;

@Getter
@Nullable
private Entity lastAttackedEntity = null;

@Getter
@Nullable
private Screen lastScreen = null;
Expand All @@ -96,8 +87,7 @@ public class RecipeTrackerGameFeature extends GameFeature {
private String lastRecipeName = null;

public RecipeTrackerGameFeature() {
this.recipePreviewHandler = new RecipePreviewHandler(this);
this.craftingStationHandler = new CraftingStationHandler(this);
this.vendorHandler = new VendorHandler();
this.profileHandler = new ProfileHandler(this);
this.backpackHandler = new BackpackHandler(this);
}
Expand All @@ -108,7 +98,6 @@ public void init(MinecraftClient minecraftClient, BlockgameJournalClient blockga

ClientPlayConnectionEvents.JOIN.register(this::handleJoin);
ClientPlayConnectionEvents.DISCONNECT.register(this::handleDisconnect);
EntityAttackedListener.EVENT.register(this::handleEntityAttacked);
ItemInteractListener.EVENT.register(this::handleItemInteract);
ClientCommandRegistrationCallback.EVENT.register(this::registerCommand);
ScreenEvents.AFTER_INIT.register(this::handleScreenInit);
Expand All @@ -121,8 +110,7 @@ public void init(MinecraftClient minecraftClient, BlockgameJournalClient blockga
}
});

this.craftingStationHandler.init();
this.recipePreviewHandler.init();
this.vendorHandler.init();
this.profileHandler.init();
this.backpackHandler.init();

Expand Down Expand Up @@ -256,13 +244,6 @@ else if (screen.getFocused() instanceof TextFieldWidget textFieldWidget) {
}
}

private ActionResult handleEntityAttacked(PlayerEntity playerEntity, Entity entity) {
lastAttackedEntity = entity;
craftingStationHandler.reset();

return ActionResult.PASS;
}

private ActionResult handleChatMessage(MinecraftClient client, String message) {
if (Journal.INSTANCE == null) {
return ActionResult.PASS;
Expand Down
Loading

0 comments on commit 2f2042f

Please sign in to comment.