Skip to content

Contribute

Kevin edited this page Jul 4, 2024 · 8 revisions

We welcome contributions from anyone for any feature related to Hypixel Skyblock. Please feel free to ask any question you may have.

Code Style

For code style, try to follow the Fabric Development Guidelines. We will enforce TitleCase for classes, SCREAMING_SNAKE_CASE for static final fields except for specific exceptions, and camelCase for methods and all other fields.

Code Cleanup

Please run a code and import cleanup before submitting a pr. On intellij, code cleanup is Command/Control + Option + L and import cleanup is Control + Option + O.

Note

Until a decision is reached on an editor config, please keep existing files that use spaces in spaces and files that use tabs in tabs. You can convert between spaces and tabs after code cleanup via Edit -> Convert Indents.

You can configure code cleanup in Settings -> Editor -> Code Style -> Java. To prevent your lines from being wrapped, change Wrapping and Braces -> Hard wrap at to 1000. To keep empty methods in one line, you can also turn on Wrapping and Braces -> Keep when reformatting -> Simple blocks in one line, Simple methods in one line, Simple lambdas in one line, and Simple classes in one line.

Documentation

We require Javadocs and comments for your classes and methods, except for getters/settings, boilerplate, or other simple methods. Also, try to include implementation details and document legal and illegal values for parameters and return values (nullability annotations, for instance). For examples of well-documented classes, see TooltipAdder, DungeonManager, ItemUtils, and RenderHelper.

Annotations

Appropriate annotations are also welcome, such as @org.jetbrains.annotations.Nullable, @Language("RegExp"), or @Translatable.

Mixin

Prefer fabric events over any mixins. Prefer mixin extras over invasive mixins such as redirects.

Config

Remember to add configuration to your feature! Since Skyblocker 1.15, we use YACL as your config library. You need to add config fields to SkyblockerConfig and add an entry to the respective category, such as DungeonsCategory. You will also need to add the English localization to en_us.json. Additionally, we try to keep the config and category files (config class, category class) in the same order to minimize confusion. The English localisation file (at least the config section) is sorted alphabetically.

Testing

Please test your features thoroughly before submitting a PR. Screenshots or showcases would additionally accelerate the review process of your PR and are strongly suggested. Please note clearly in the PR if it has not been tested.

Unit tests are also strongly encouraged. Note that you can create unit tests for methods containing Minecraft classes. See ItemUtilsTest for an example.


Thank you for contributing to Skyblocker and hope you have fun!

Clone this wiki locally