diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-15 13:53:48 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-15 13:58:24 +0200 |
commit | 1167a3367ad6a8c7b4fb0c8582025430dc85370f (patch) | |
tree | f3c7996f45ad83e3a057eb49eaeb2fcdd94fdf30 /CONTRIBUTING.md | |
parent | d8b354d956be41a886ccb1d0d348274c6474f686 (diff) | |
download | skyhanni-1167a3367ad6a8c7b4fb0c8582025430dc85370f.tar.gz skyhanni-1167a3367ad6a8c7b4fb0c8582025430dc85370f.tar.bz2 skyhanni-1167a3367ad6a8c7b4fb0c8582025430dc85370f.zip |
changed CONTRIBUTING.md
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4d5bf3c5..6a857fbdb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,18 +3,18 @@ This is a technical guide that helps Kotlin and Java developers understand how SkyHanni works, and provides the first steps for new Forge developers to take. -# Set up the development environment +## Development Environment Setup When making changes to the code, it is recommended to use an IDE for live debugging and testing. This tutorial explains how to set up the development environment for SkyHanni. We use [IntelliJ](https://www.jetbrains.com/idea/) as an example. -## Download IntelliJ +### Download IntelliJ - Download IntelliJ from the [JetBrains Website](https://www.jetbrains.com/idea/download/). - Use the Community Edition. (Scroll down a bit.) -## Cloning the project +### Cloning the project - Create an account on GitHub - Go to https://github.com/hannibal002/SkyHanni @@ -28,22 +28,53 @@ We use [IntelliJ](https://www.jetbrains.com/idea/) as an example. - Select `SkyHanni` from the list. - Open the project. -## Setting up IntelliJ +### Setting up IntelliJ -SkyHanni's Gradle configuration is very similar to the one used in **NotEnoughUpdates**; just follow this guide: -https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/master/CONTRIBUTING.md +SkyHanni's Gradle configuration is very similar to the one used in **NotEnoughUpdates**, just +follow [their guide](https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/master/CONTRIBUTING.md). ## Creating a Pull Request -(An explanation how to use intellij and branches will follow here soon) +_An explanation how to use intellij and branches will follow here soon_ Please use a prefix for the name of the PR (E.g. Feature, Fix, Backend, Change). You can write in the description of the pr the wording for the changelog as well (optional). -# Software Used in SkyHanni +## Coding Styles and Conventions -## Core +- Follow the [Hypixel Rules](https://hypixel.net/rules). +- Use the coding conventions for [Kotlin](https://kotlinlang.org/docs/coding-conventions.html) + and [Java](https://www.oracle.com/java/technologies/javase/codeconventions-contents.html). +- Do not copy features from other mods. Exceptions: + - Mods that are paid to use. + - Mods that have reached their end of life. (Rip SBA, Dulkir and Soopy) + - The mod has, according to Hypixel rules, illegal features ("cheat mod/client"). + - If you can improve the existing feature in a meaningful way. +- All new classes should be written in Kotlin, with a few exceptions: + - Config files in `at.hannibal2.skyhanni.config.features` + - Mixin classes in `at.hannibal2.skyhanni.mixins.transformers` + - Java classes that represent JSON data objects in `at.hannibal2.skyhanni.utils.jsonobjects` +- Please use the existing event system, or expand on it. Do not use Forge events. + - (We inject the calls with Mixin) +- Please use existing utils methods. +- We try to avoid calling the NEU code too often. + - (We plan to remove NEU as a dependency in the future.) +- We try not to use Forge-specific methods if possible. + - (We plan to switch to Fabric and Minecraft 1.20 in the future.) +- Please try to avoid using `System.currentTimeMillis()`. Use our own class `SimpleTimeMark` instead. + - See [this commit](https://github.com/hannibal002/SkyHanni/commit/3d748cb79f3a1afa7f1a9b7d0561e5d7bb284a9b) + as an example. +- Try to avoid using kotlin's `!!` (catch if not null) feature. + - Replace it with `?:` (ff null return this). + - This will most likely not be possible to avoid when working with obects from java. +- Don't forget to add `@FeatureToggle` to new standalone features (not options to that feature) in the config. +- Do not use `e.printStackTrace()`, use `CopyErrorCommand.logError(e, "explanation for users")` instead. +- Do not use `MinecraftForge.EVENT_BUS.post(event)`, use `event.postAndCatch()` instead. + +## Software Used in SkyHanni + +### Basics SkyHanni is a Forge mod for Minecraft 1.8.9, written in [Kotlin](https://kotlinlang.org/) and [Java](https://www.java.com/en/). @@ -54,7 +85,7 @@ written in [Kotlin DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.htm This start script will automatically download all required libraries. -## NotEnoughUpdates +### NotEnoughUpdates SkyHanni requires NEU. We use NEU to get auction house and bazaar price data for items and to read @@ -63,7 +94,7 @@ and recipes. For more information, see https://github.com/NotEnoughUpdates/NotEnoughUpdates -## Config +### Config SkyHanni stores the config (settings and user data) as a json object in a single text file. For rendering the /sh config (categories, toggles, search, etc.), @@ -71,7 +102,7 @@ SkyHanni uses **MoulConfig**, the same config system as NotEnoughUpdates. For more information, see https://github.com/NotEnoughUpdates/MoulConfig -## Elite Farmers API +### Elite Farmers API SkyHanni utilizes the [Elite API](https://api.elitebot.dev/) (view the [public site here](https://elitebot.dev)) for some farming features. @@ -79,23 +110,23 @@ some farming features. This includes features relating to Farming Weight, as well as syncing jacob contests amongst players for conviencience. All data sent is anonymonized and opt-in. -## Mixin +### Mixin A system to inject code into the original Minecraft code. This library is not part of SkyHanni itself; it comes preinstalled with Forge. For more information, see https://github.com/SpongePowered/Mixin. -## Repo +### Repo SkyHanni uses a repo system to easily change static variables without the need for a mod update. The repo is located at https://github.com/hannibal002/SkyHanni-REPO. -A copy of all files in the repo is stored for every SkyHanni user under `.minecraft\config\skyhanni\repo`. +A copy of all json files is stored on the computer under `.minecraft\config\skyhanni\repo`. On every game start, the copy gets updated (if outdated and if not manually disabled). When working with the repo, it is recommended to disable the manual repo update to prevent overriding your local changes accidentally. -## DiscordIPC +### Discord IPC DiscordIPC is a service that SkyHanni uses to send information from SkyBlock to Discord in Rich Presence. <br> Specifically, we use [TirelessTraveler's Fork](https://github.com/ILikePlayingGames/DiscordIPC) of a fork of a fork of @@ -103,44 +134,13 @@ the [original](https://github.com/jagrosh/DiscordIPC). For info on usage, look at [DiscordRPCManager.kt](https://github.com/hannibal002/SkyHanni/blob/beta/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt) -## Auto Updater +### Auto Updater We use the [auto update library](https://repo.nea.moe/#/releases/moe/nea/libautoupdate) from nea. -# Coding Styles and Conventions - -- Follow the [Hypixel Rules](https://hypixel.net/rules). -- Use the coding conventions for [Kotlin](https://kotlinlang.org/docs/coding-conventions.html) - and [Java](https://www.oracle.com/java/technologies/javase/codeconventions-contents.html). -- Do not copy features from other mods. Exceptions: - - Mods that are paid to use. - - Mods that have reached their end of life. (Rip SBA, Dulkir and Soopy) - - The mod has, according to Hypixel rules, illegal features ("cheat mod/client"). - - If you can improve the existing feature in a meaningful way. -- All new classes should be written in Kotlin, with a few exceptions: - - Config files in `at.hannibal2.skyhanni.config.features` - - Mixin classes in `at.hannibal2.skyhanni.mixins.transformers` - - Java classes that represent JSON data objects in `at.hannibal2.skyhanni.utils.jsonobjects` -- Please use the existing event system, or expand on it. Do not use Forge events. - - (We inject the calls with Mixin) -- Please use existing utils methods. -- We try to avoid calling the NEU code too often. - - (We plan to remove NEU as a dependency in the future.) -- We try not to use Forge-specific methods if possible. - - (We plan to switch to Fabric and Minecraft 1.20 in the future.) -- Please try to avoid using `System.currentTimeMillis()`. Use our own class `SimpleTimeMark` instead. - - See [this commit](https://github.com/hannibal002/SkyHanni/commit/3d748cb79f3a1afa7f1a9b7d0561e5d7bb284a9b) - as an example. -- Try to avoid using kotlin's `!!` (catch if not null) feature. - - Replace it with `?:` (ff null return this). - - This will most likely not be possible to avoid when working with obects from java. -- Don't forget to add `@FeatureToggle` to new standalone features (not options to that feature) in the config. -- Do not use `e.printStackTrace()`, use `CopyErrorCommand.logError(e, "explanation for users")` instead. -- Do not use `MinecraftForge.EVENT_BUS.post(event)`, use `event.postAndCatch()` instead. - -# Additional Useful Developement Tools +## Additional Useful Developement Tools -## DevAuth +### DevAuth [DevAuth](https://github.com/DJtheRedstoner/DevAuth) is a tool that allows logging in to a Minecraft account while debugging in IntelliJ. This is very useful for coding live on Hypixel without the need to compile a jar, put it into the @@ -167,7 +167,7 @@ type = "microsoft" - Click on the link in the console and verify with a Mojang account. - The verification process will reappear every few days (after the session token expires). -## Hot Swap +### Hot Swap Hot Swap allows reloading edited code while debugging, removing the need to restart the whole game every time. |