-
-
Notifications
You must be signed in to change notification settings - Fork 59
Improve public API docs #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: multiversion/dev
Are you sure you want to change the base?
Improve public API docs #706
Conversation
86ba14e to
8e0e979
Compare
8e0e979 to
f6b51ed
Compare
| // You can change "compileOnly" to "implementation" for testing in-game. | ||
| compileOnly("dev.isxander:controlify:${project.controlify_version}") { | ||
| // Only need Controlify API, ignore the transitive dependencies (e.g, QuiltMC parsers) | ||
| transitive = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to remove the QuiltMC Parser as a transitive dependency, rather than using this workaround?
This is more convenient, because it means users don't have to add YACL as a runtime only.
Without transitive = false (isTransitive in KTS) workaround, Quilt MC parsers will be added to consumers as compileOnly, and they have to add the QuiltMC Maven Repository to prevent build failure (e.g., dependency not found in the following sources).
| CUSTOM(MyMod.rl("textures/item/custom.png")),; | ||
|
|
||
| private final @NotNull ResourceLocation id; | ||
|
|
||
| MyRadialIcons(@NotNull ResourceLocation id) { | ||
| this.id = id; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResourceLocation was renamed to Identifier in 1.21.11+, so should we use that instead?
| // 2. Provide explicit Controlify support. | ||
| .keyEmulation(MyModKeyMappings.ACTION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 2 means no key emulation, and therefore, only addKeyCorrelation should be used.
I will improve this part soon.
| // For consistency with the current Controlify radial icons, | ||
| // this code is equivalent to: | ||
| // https://github.com/isXander/Controlify/blob/f5c94c57d5e0d4954e413624a0d7ead937b6e8ab/src/main/java/dev/isxander/controlify/bindings/RadialIcons.java#L106-L112 | ||
| RadialIcons.registerIcon(location, (graphics, x, y, tickDelta) -> { | ||
| var pose = CGuiPose.ofPush(graphics); | ||
| pose.translate(x, y); | ||
| pose.scale(0.5f, 0.5f); | ||
| Blit.tex(graphics, location, 0, 0, 0, 0, 32, 32, 32, 32); | ||
| pose.pop(); | ||
| }); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be worth considering making a public API that provides this functionality.
Updates the documentation and Javadocs to make it more user-friendly and simplify integration with Controlify by:
dev.isxander.controlify.api.entrypoint.ControlifyEntrypointto make it easier for NeoForge users to create in their IDE or terminal.onControlifyInitandonControlifyPreInitto resolve common confusion.Related Issues