Skip to content

Commit

Permalink
Merge branch 'beta' into mob-detection-migration/ashfang
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt
#	src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt
#	src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
  • Loading branch information
ItsEmpa committed Oct 13, 2024
2 parents 86bb14e + 015352c commit 73bd357
Show file tree
Hide file tree
Showing 460 changed files with 7,108 additions and 2,898 deletions.
13 changes: 13 additions & 0 deletions .github/actions/setup-normal-workspace/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Setup Java, Gradle and check out the source code'

runs:
using: composite
steps:
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: gradle
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
37 changes: 37 additions & 0 deletions .github/scripts/process_detekt_sarif.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# This script processes the Detekt SARIF file and outputs results in a format
# suitable for annotation in CI/CD systems.

SARIF_FILE="$1"

# Check if SARIF file exists
if [ ! -f "$SARIF_FILE" ]; then
echo "SARIF file not found: $SARIF_FILE"
exit 1
fi

# Define jq command to parse SARIF file
read -r -d '' jq_command <<'EOF'
.runs[].results[] |
{
"full_path": .locations[].physicalLocation.artifactLocation.uri | sub("file://$(pwd)/"; ""),
"file_name": (.locations[].physicalLocation.artifactLocation.uri | split("/") | last),
"l": .locations[].physicalLocation,
"level": .level,
"message": .message.text,
"ruleId": .ruleId
} |
(
"::" + (.level) +
" file=" + (.full_path) +
",line=" + (.l.region.startLine|tostring) +
",title=" + (.ruleId) +
",col=" + (.l.region.startColumn|tostring) +
",endColumn=" + (.l.region.endColumn|tostring) +
"::" + (.message.text)
)
EOF

# Run jq command to format the output
jq -r "$jq_command" < "$SARIF_FILE"
64 changes: 64 additions & 0 deletions .github/workflows/assign-relevant-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "Assign relevant labels"
on:
pull_request_target:
types: [ opened, edited ]
jobs:
assign-label:
if: github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: read
steps:
- name: label
env:
TITLE: ${{ github.event.pull_request.title }}
LABEL_FIX: Bug Fix
LABEL_BACKEND: Backend
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN}}
script: |
const labelsToAdd = [];
const labelsToRemove = [];
const title = process.env.TITLE.split(":")[0].toUpperCase();
if(title.includes("FIX")){
labelsToAdd.push(process.env.LABEL_FIX);
} else {
labelsToRemove.push(process.env.LABEL_FIX);
}
if(title.includes("BACKEND")){
labelsToAdd.push(process.env.LABEL_BACKEND);
} else {
labelsToRemove.push(process.env.LABEL_BACKEND);
}
for (const label of labelsToAdd) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label]
});
}
const {data} = await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
for (const label of labelsToRemove) {
const filtered = data.filter(l => l.name == label);
if(filtered.length == 1){
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: label
});
}
}
47 changes: 27 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,50 @@ jobs:
runs-on: ubuntu-latest
name: "Build and test"
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/setup-normal-workspace
- name: Build with Gradle
run: ./gradlew assemble -x test --stacktrace
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload development build
with:
name: "Development Build"
path: build/libs/*.jar
- name: Test with Gradle
run: ./gradlew test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: "Upload test report"
if: ${{ !cancelled() }}
with:
name: "Test Results"
path: versions/1.8.9/build/reports/tests/test/
#detekt:
# name: Run detekt
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - uses: ./.github/actions/setup-normal-workspace
# # detektMain is a LOT slower than detekt, but it does type analysis
# - name: Run detekt main (w/typing analysis)
# run: |
# ./gradlew detektMain --stacktrace
# - name: Annotate detekt failures
# if: ${{ !cancelled() }}
# run: |
# chmod +x .github/scripts/process_detekt_sarif.sh
# ./.github/scripts/process_detekt_sarif.sh versions/1.8.9/build/reports/detekt/main.sarif


preprocess:
runs-on: ubuntu-latest
name: "Build multi version"
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/setup-normal-workspace
- name: Enable preprocessor
run: |
mkdir -p .gradle
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/check-style.yaml.disabled

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/generate-constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Generate Repo Patterns using Gradle
run: |
./gradlew generateRepoPatterns --stacktrace
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload generated repo regexes
with:
name: Repo Regexes
Expand All @@ -45,7 +45,7 @@ jobs:
with:
repository: ${{ env.data_repo }}
branch: main
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Upload generated repo regexes
with:
name: Repo Regexes
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/label-bug-fix.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "PR Changelog Verification"

on:
pull_request_target:
types: [ opened, edited ]

jobs:
verify-changelog:
if: github.event.pull_request.state == 'open' && '511310721' == github.repository_id
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: ./.github/actions/setup-normal-workspace

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run ChangeLog verification
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
./gradlew checkPrDescription -PprTitle="${PR_TITLE}" -PprBody="${PR_BODY}"
- name: Add label if changelog verification fails
if: failure()
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'Wrong Title/Changelog'

- name: Remove label if changelog verification passes
if: success()
uses: actions-ecosystem/action-remove-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'Wrong Title/Changelog'

- name: Add comment to PR if changelog verification fails
if: failure()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const test = fs.readFileSync('versions/1.8.9/build/changelog_errors.txt', 'utf8');
const commentBody = `${test}`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
})
4 changes: 4 additions & 0 deletions .idea/dictionaries/default_user.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ We use [IntelliJ](https://www.jetbrains.com/idea/) as an example.

- Download IntelliJ from the [JetBrains Website](https://www.jetbrains.com/idea/download/).
- Use the Community Edition. (Scroll down a bit.)
- When you encounter any bug with IntelliJ, please make sure to use the version `2024.1.6`, not `2024.2.x` or above.

### Cloning the project

Expand All @@ -30,6 +31,7 @@ We use [IntelliJ](https://www.jetbrains.com/idea/) as an example.

### Setting up IntelliJ


Once your project is imported into IntelliJ from the previous step, all dependencies like Minecraft, NEU, and so on should be automatically
downloaded. If not, you might need to link the Gradle project in the Gradle tab (little elephant) on the right.

Expand Down Expand Up @@ -97,6 +99,13 @@ format like "- #821" to illustrate the dependency.
- 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).
- **My build is failing due to `detekt`, what do I do?**
- `detekt` is our code quality tool. It checks for code smells and style issues.
- If you have a build failure stating `Analysis failed with ... weighted issues.`, you can check `versions/[target version]/build/reports/detekt/` for a comprehensive list of issues.
- **There are valid reasons to deviate from the norm**
- If you have such a case, either use `@Supress("rule_name")`, or re-build the `baseline.xml` file, using `./gradlew detektBaselineMain`.
After running detektBaselineMain, you should find a file called `baseline-main.xml` in the `version/1.8.9` folder, rename the file to
`baseline.xml` replacing the old one. You also should copy the new contents of this file to the [main baseline file](detekt/baseline.xml)
- 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).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SkyHanni is a Forge mod for Minecraft 1.8.9 that adds many useful features to [H
* **Helpful GUIs:** View important information at a glance.
* **Extra Chat Messages:** Receive reminders and tips at the right moment.
* **Object Highlighters:** Focus on important items in inventories or highlight mobs in the world.
* **Highly Customizeable Displays:** Personalise your Scoreboard, Tab List or chat format.
* **Highly Customizable Displays:** Personalise your Scoreboard, Tab List or chat format.
* [And **much** more!](docs/FEATURES.md)

SkyHanni is especially useful when doing farming, slayers, Bingo, Diana, fishing, Rift or mining.
Expand All @@ -35,7 +35,7 @@ SkyHanni is especially useful when doing farming, slayers, Bingo, Diana, fishing
Give feedback or just chat with others on our community Discord!

* **Bug Reports:** Use the `#bug-reports` channel when you find broken features (please check out `#faq` and `#known-bugs`).
* **Quick Help** Ask in `#support` for questions and problems with the the mod or Minecraft in general.
* **Quick Help** Ask in `#support` for questions and problems with the mod or Minecraft in general.
* **Feature Suggestions:** Feel fre to tell your ideas in `#suggestions` channel for new features and improvements to the mod. (Don't copy from existing mods or break Hypixel rules).
* **General Chat:** Chat with other SkyHanni users in `#skyblock-general` channel about the game.

Expand Down
Loading

0 comments on commit 73bd357

Please sign in to comment.