diff options
| author | Cal <cwolfson58@gmail.com> | 2024-10-30 11:54:17 +1100 |
|---|---|---|
| committer | Cal <cwolfson58@gmail.com> | 2024-10-30 11:54:17 +1100 |
| commit | 09494f6e0a48e619c486b073189e24288400d689 (patch) | |
| tree | 055af622ed4dc4cdedcb3ecb14c3662194378210 | |
| parent | 2dc24ced9d10a0fda4df70c90471499abd66595b (diff) | |
| parent | 3f4bdbab85ba6b54a54b99b23e176d52910c8d66 (diff) | |
| download | SkyHanni-09494f6e0a48e619c486b073189e24288400d689.tar.gz SkyHanni-09494f6e0a48e619c486b073189e24288400d689.tar.bz2 SkyHanni-09494f6e0a48e619c486b073189e24288400d689.zip | |
Merge branch 'refs/heads/beta' into fork/nea89o/formattedtextcompat
# Conflicts:
# build.gradle.kts
83 files changed, 905 insertions, 549 deletions
diff --git a/.github/workflows/detekt.yml b/.github/workflows/detekt.yml index f4251d798..a258661f1 100644 --- a/.github/workflows/detekt.yml +++ b/.github/workflows/detekt.yml @@ -29,6 +29,7 @@ jobs: run: | ./gradlew detektMain --stacktrace - name: Check if SARIF file exists + if: always() id: check_sarif run: | if [ -f "versions/1.8.9/build/reports/detekt/main.sarif" ]; then @@ -42,7 +43,7 @@ jobs: chmod +x .github/scripts/process_detekt_sarif.sh ./.github/scripts/process_detekt_sarif.sh versions/1.8.9/build/reports/detekt/main.sarif | tee detekt_output.txt - name: Upload detekt output as artifact - if: ${{ steps.check_sarif.outputs.exists == 'true' }} + if: ${{ !cancelled() && steps.check_sarif.outputs.exists == 'true' }} uses: actions/upload-artifact@v4 with: name: detekt-output diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index a28577b77..4cf997e2c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -43,6 +43,7 @@ jobs: labels: 'Wrong Title/Changelog' - name: Check if this is the latest workflow run + if: failure() id: check_latest run: | PR_LATEST_SHA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8229a00d5..a30f9178b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,7 +85,7 @@ out [their guide](https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/mast If you are not very familiar with git, you might want to try this out: https://learngitbranching.js.org/. -Proposed changes are better off being in their own branch, you can do this by doing the following from within IntelliJ with the SkyHanni project already open. +Proposed changes are better off being in their own branch as this makes development easier for both you and the maintainers of this repository, you can do this by following the instructions from within the IntelliJ window with the SkyHanni project already open. - Click the beta dropdown at the top of IntelliJ - Click new branch - Give the branch a name relating to the changes you plan to make @@ -153,6 +153,37 @@ for more information and usages. - When updating a config option variable, use the `ConfigUpdaterMigrator.ConfigFixEvent` with event.move() when moving a value, and event.transform() when updating a value. [For Example](https://github.com/hannibal002/SkyHanni/blob/e88f416c48f9659f89b7047d7629cd9a1d1535bc/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt#L276). - Use American English spelling conventions (e.g., "color" not "colour"). +## Additional Useful Development Tools + +### 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. + +- The library is already downloaded by Gradle. +- SkyHanni will automatically set up DevAuth. +- Start Minecraft inside IntelliJ normally. + - Click on the link in the console and verify with a Microsoft account. + - The verification process will reappear every few days (after the session token expires). + +### Hot Swap + +Hot Swap allows reloading edited code while debugging, removing the need to restart the whole game every time. + +We use [dcevm](https://dcevm.github.io/) and the IntelliJ +Plugin [HotSwap Agent](https://plugins.jetbrains.com/plugin/9552-hotswapagent) to quickly reload code changes. + +Follow [this](https://forums.Minecraftforge.net/topic/82228-1152-3110-intellij-and-gradlew-forge-hotswap-and-dcevm-tutorial/) +tutorial. + +### [Live Plugin](https://plugins.jetbrains.com/plugin/7282-liveplugin) + +Allows project specific plugins to run. Eg: Regex Intention + +### [Live Templates Sharing](https://plugins.jetbrains.com/plugin/25007-live-templates-sharing) + +Imports our custom live templates automatically. Live Templates allow for quicker code writing. + ## Software Used in SkyHanni ### Basics @@ -218,29 +249,6 @@ For info on usage, look at [DiscordRPCManager.kt](https://github.com/hannibal002 We use the [auto update library](https://github.com/nea89o/libautoupdate) from nea89. -## Additional Useful Development Tools - -### 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. - -- The library is already downloaded by Gradle. -- SkyHanni will automatically set up DevAuth. -- Start Minecraft inside IntelliJ normally. - - Click on the link in the console and verify with a Microsoft account. - - The verification process will reappear every few days (after the session token expires). - -### Hot Swap - -Hot Swap allows reloading edited code while debugging, removing the need to restart the whole game every time. - -We use [dcevm](https://dcevm.github.io/) and the IntelliJ -Plugin [HotSwap Agent](https://plugins.jetbrains.com/plugin/9552-hotswapagent) to quickly reload code changes. - -Follow [this](https://forums.Minecraftforge.net/topic/82228-1152-3110-intellij-and-gradlew-forge-hotswap-and-dcevm-tutorial/) -tutorial. - ## 1.21 / Modern version development You might have noticed that while the SkyHanni source code is found in `src/`, the actual tasks for compiling, building and running the mod diff --git a/build.gradle.kts b/build.gradle.kts index d833b509e..6b2aeff5f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,8 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import skyhannibuildsystem.ChangelogVerification import skyhannibuildsystem.DownloadBackupRepo +import java.io.Serializable +import java.nio.file.Path import java.util.zip.ZipFile import java.util.zip.ZipOutputStream import kotlin.io.path.moveTo @@ -439,18 +441,13 @@ tasks.withType<DetektCreateBaselineTask>().configureEach { outputs.cacheIf { false } // Custom rules won't work if cached } -abstract class ShotApplicationJarProcessor @Inject constructor(val shots: Shots) : MinecraftJarProcessor<MinecraftJarProcessor.Spec> { - private class EnsureCompile(shots: Shots) : ShotApplicationJarProcessor(shots) +abstract class ShotApplicationJarProcessor @Inject constructor(private val shots: Shots) : + MinecraftJarProcessor<MinecraftJarProcessor.Spec>, + Serializable { - override fun buildSpec(context: SpecContext?): MinecraftJarProcessor.Spec? { - return object : MinecraftJarProcessor.Spec {} - } + override fun buildSpec(context: SpecContext?): MinecraftJarProcessor.Spec? = ShotSpec(shots) - override fun processJar( - source: java.nio.file.Path, - spec: MinecraftJarProcessor.Spec, - context: ProcessorContext? - ) { + override fun processJar(source: Path, spec: MinecraftJarProcessor.Spec?, context: ProcessorContext?) { val dest = source.resolveSibling(source.fileName.toString() + "-temp-shot") ZipFile(source.toFile()).use { input -> ZipOutputStream(dest.outputStream()).use { output -> @@ -460,7 +457,7 @@ abstract class ShotApplicationJarProcessor @Inject constructor(val shots: Shots) dest.moveTo(source, overwrite = true) } - override fun getName(): String { - return "Shots" - } + override fun getName(): String = "Shots" + + private data class ShotSpec(val shots: Shots) : MinecraftJarProcessor.Spec, Serializable } diff --git a/detekt/baseline.xml b/detekt/baseline.xml index 6665e0399..fb620c666 100644 --- a/detekt/baseline.xml +++ b/ |
