Skip to content

refactor!: complete rewrite of DoubleJump plugin#61

Merged
imDMK merged 2 commits intomainfrom
refactor/rewrite-plugin
Mar 28, 2026
Merged

refactor!: complete rewrite of DoubleJump plugin#61
imDMK merged 2 commits intomainfrom
refactor/rewrite-plugin

Conversation

@imDMK
Copy link
Copy Markdown
Owner

@imDMK imDMK commented Mar 28, 2026

  • rewrote entire codebase from scratch
  • redesigned config system and serializers
  • improved architecture and separation of concerns
  • cleaned up services and dependency injection
  • removed legacy and inconsistent implementations

BREAKING CHANGE: plugin structure, config format and internal APIs have been changed

@imDMK
Copy link
Copy Markdown
Owner Author

imDMK commented Mar 28, 2026

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the DoubleJump plugin into a multi-module architecture, updating the project to Java 21 and Gradle 9. It introduces a component-based system using dependency injection and updates core features like jump restrictions, cooldowns, and visual effects. Feedback focuses on correcting metadata in the build scripts that appear to be copied from another project, improving dependency version stability, and making hardcoded values like the ping threshold configurable.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request performs a major architectural overhaul, splitting the project into core and plugin modules while introducing dependency injection and updated library integrations. The refactoring improves modularity but requires critical adjustments to dependency relocation in the build process to prevent classpath conflicts. Further feedback addresses incomplete item matching logic regarding flags and durability, the renaming of a misleading time conversion constant, and the optimization of dependency scopes. Additionally, a risk was identified in the configuration service where automatic field binding could lead to unintentional DI container overwrites.

Comment on lines +42 to +55
for (Field field : config.getClass().getFields()) {
try {
Object value = field.get(config);
if (value != null) {
resources.on(field.getType())
.assignInstance(value);
}
} catch (IllegalAccessException exception) {
throw new IllegalStateException(
"Failed to read config field: " + field.getName(),
exception
);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This loop binds all public fields of a configuration class to the DI container. This can be risky, as it might lead to unintentional overwriting of bindings if two different configuration classes have public fields of the same type. For example, if both ConfigA and ConfigB have a public field public String someValue, the one processed last will overwrite the binding for String. It would be safer to use named bindings or qualifiers if your DI framework supports it, or to be very careful about the types of public fields in your configuration classes.

@imDMK imDMK merged commit 15af408 into main Mar 28, 2026
1 check passed
@imDMK imDMK deleted the refactor/rewrite-plugin branch March 29, 2026 09:28
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.

1 participant