Skip to content

Conversation

@Hugo-CASTELL
Copy link
Owner

Closes #7
Closes #8

@Hugo-CASTELL Hugo-CASTELL added the enhancement New feature or request label Mar 28, 2025
@Hugo-CASTELL Hugo-CASTELL requested a review from Copilot March 28, 2025 09:51
@Hugo-CASTELL Hugo-CASTELL self-assigned this Mar 28, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the mod’s version to v1.4.0 by closing issues #7 and #8 while refactoring keybindings, configuration management, and exception-based control flows. Key changes include the introduction of utility classes for keybindings and default configurations, refactoring to use the Singleton pattern instead of static variables, and updating rendering and tracking methods to throw exceptions on error.

Reviewed Changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/client/java/dev/quickinfos/utils/KeyUtils.java Adds methods to register keybindings for toggling and showing the menu.
src/client/java/dev/quickinfos/utils/DefaultConfigUtils.java Provides default key code values for configuration.
src/client/java/dev/quickinfos/trackers/* Updates Tracker interface and implementations to throw exceptions rather than returning silent defaults.
src/client/java/dev/quickinfos/screen/QuickInfosScreen.java Migrates UI elements to use the Singleton pattern and adjusts layout dimensions.
src/client/java/dev/quickinfos/infos/* Converts render methods in Info classes to throw exceptions on errors and updates behavior accordingly.
src/client/java/dev/quickinfos/config/* Enhances configuration saving/restoration by including additional parameters.
src/client/java/dev/quickinfos/Singleton.java Replaces StaticVariables with Singleton, centralizing configuration and instance management.
src/client/java/dev/quickinfos/QuickInfosClient.java Adjusts tick event handling and screen rendering to utilize the new exception flow and Singleton data.
Files not reviewed (1)
  • gradle.properties: Language not supported
Comments suppressed due to low confidence (2)

src/client/java/dev/quickinfos/trackers/DeathCoordinatesTracker.java:19

  • Throwing an exception from shouldTrigger when client.player is null diverges from the typical boolean return pattern; consider whether a graceful false return might be more appropriate or ensure that all tracker implementations are updated accordingly.
if (client.player == null) throw new CannotCheckTriggerConditionTrackerException(this);

src/client/java/dev/quickinfos/screen/QuickInfosScreen.java:84

  • [nitpick] The adjustment of the y coordinate from 80 to 100 changes the layout of the info list; please confirm that this new offset is intentional for UI consistency.
int y = 100;

Comment on lines +139 to 147
String[] rawLines;
try {
rawLines = Singleton.ORDERED_INFOS.stream().map(info -> info.isOn() ? info.render(client) : "").toArray(String[]::new);
}
catch (CannotRenderInfoException e){
// Abort if one info cannot be rendered as they all depend on client
return;
}

Copy link

Copilot AI Mar 28, 2025

Choose a reason for hiding this comment

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

Catching a CannotRenderInfoException for the entire stream mapping causes all info rendering to abort if one fails; consider handling exceptions on a per-info basis to allow partial rendering.

Copilot uses AI. Check for mistakes.
@Hugo-CASTELL Hugo-CASTELL merged commit 63e76c8 into main Mar 28, 2025
2 checks passed
@Hugo-CASTELL Hugo-CASTELL deleted the dev branch March 28, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Button to Access the Menu Add the targeted block coordinates

2 participants