-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0214b3
commit b6a7dd7
Showing
11 changed files
with
126 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: publish | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
java: [ 21 ] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v2 | ||
- name: Setup JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'microsoft' | ||
- name: Make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: Build | ||
run: ./gradlew build | ||
- uses: BrycensRanch/read-properties-action@v1 | ||
id: props | ||
with: | ||
file: gradle.properties | ||
all: true | ||
|
||
- name: Publish | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
modrinth-id: ${{ steps.props.outputs.modrinth_id }} | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
|
||
files: | | ||
build/libs/${{ steps.props.outputs.archives_base_name }}-${{ github.event.release.tag_name }}.jar | ||
build/libs/${{ steps.props.outputs.archives_base_name }}-${{ github.event.release.tag_name }}-sources.jar | ||
version: ${{ github.event.release.tag_name }} | ||
|
||
version-type: beta | ||
loaders: | | ||
fabric | ||
game-versions: ${{ steps.props.outputs.minecraft_version_range }} | ||
game-version-filter: releases | ||
|
||
dependencies: | | ||
fabric-api | ||
java: | | ||
21 | ||
retry-attempts: 0 | ||
fail-mode: skip | ||
|
||
- name: Upload assets to GitHub | ||
uses: AButler/[email protected] | ||
with: | ||
files: "build/libs/*" | ||
repo-token: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ bin/ | |
# fabric | ||
|
||
run/ | ||
test/ | ||
testrun/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package testmod; | ||
|
||
import eu.pb4.placeholders.api.TextParserUtils; | ||
import net.fabricmc.api.ModInitializer; | ||
import pinkgoosik.entityhealthdisplay.api.HealthDisplayEvents; | ||
|
||
public class Main implements ModInitializer { | ||
|
||
@Override | ||
public void onInitialize() { | ||
HealthDisplayEvents.FORMAT_HEALTH_DISPLAY.register((entity, world) -> { | ||
String color = (entity.getMaxHealth() / 2) >= entity.getHealth() ? "<yellow>" : "<green>"; | ||
var text = TextParserUtils.formatText("<red>" + entity.getName().getString() + " " + color + String.format("%.1f", entity.getHealth()) + "<white>/<green>" + (int)entity.getMaxHealth() + "<red>❤"); | ||
return text; | ||
}); | ||
|
||
HealthDisplayEvents.SHOULD_DISPLAY_HEALTH.register((entity, world) -> { | ||
return true; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
"environment": "*", | ||
"entrypoints": { | ||
"main": [ | ||
"test.Main" | ||
"testmod.Main" | ||
] | ||
} | ||
} |