Skip to content

Commit

Permalink
Merge pull request #164 from VazkiiMods/master
Browse files Browse the repository at this point in the history
1.21.1 backup
  • Loading branch information
Uraneptus authored Oct 23, 2024
2 parents 7796f9d + f544aad commit 16e4921
Show file tree
Hide file tree
Showing 19 changed files with 616 additions and 347 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Validate gradlew integrity
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -35,7 +35,7 @@ jobs:
run: |
MC=$(awk -F '=' '/mc_version/ { print $2; }' gradle.properties)
BUILD=$(awk -F '=' '/build_number/ { print $2; }' gradle.properties)
echo "forge=Forge/build/libs/Neat-${MC}-${BUILD}-FORGE.jar" >> "$GITHUB_OUTPUT"
echo "neoforge=NeoForge/build/libs/Neat-${MC}-${BUILD}-NEOFORGE.jar" >> "$GITHUB_OUTPUT"
echo "fabric=Fabric/build/libs/Neat-${MC}-${BUILD}-FABRIC.jar" >> "$GITHUB_OUTPUT"
- name: Sign jars
env:
Expand All @@ -44,18 +44,18 @@ jobs:
run: |
echo "${SIGNING_KEY}" | gpg --import -
gpg --local-user "Violet Moon Signing Key" --armor \
--detach-sign ${{ steps.calculate_artifact_names.outputs.forge }}
--detach-sign ${{ steps.calculate_artifact_names.outputs.neoforge }}
gpg --local-user "Violet Moon Signing Key" --armor \
--detach-sign ${{ steps.calculate_artifact_names.outputs.fabric }}
- name: Archive Forge Artifacts
uses: actions/upload-artifact@v2
- name: Archive NeoForge Artifacts
uses: actions/upload-artifact@v4
with:
name: Forge
name: NeoForge
path: |
${{ steps.calculate_artifact_names.outputs.forge }}
${{ steps.calculate_artifact_names.outputs.forge }}.asc
${{ steps.calculate_artifact_names.outputs.neoforge }}
${{ steps.calculate_artifact_names.outputs.neoforge }}.asc
- name: Archive Fabric Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Fabric
path: |
Expand All @@ -67,7 +67,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
GIT_REF: ${{ github.ref }}
FABRIC_JAR: ${{ steps.calculate_artifact_names.outputs.fabric }}
FORGE_JAR: ${{ steps.calculate_artifact_names.outputs.forge }}
NEOFORGE_JAR: ${{ steps.calculate_artifact_names.outputs.neoforge }}
CURSEFORGE_TOKEN: ${{ secrets.VAZKII_CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.VAZKII_MODRINTH_TOKEN }}
run: |
Expand Down
104 changes: 102 additions & 2 deletions Fabric/src/main/java/vazkii/neat/NeatFiberConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static void setup() {

private static class Client implements NeatConfig.ConfigAccess {
private final PropertyMirror<Integer> maxDistance = PropertyMirror.create(INTEGER);
private final PropertyMirror<Integer> maxDistanceWithoutLineOfSight = PropertyMirror.create(INTEGER);
private final PropertyMirror<Boolean> renderInF1 = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Double> heightAbove = PropertyMirror.create(DOUBLE);
private final PropertyMirror<Boolean> drawBackground = PropertyMirror.create(BOOLEAN);
Expand All @@ -66,28 +67,41 @@ private static class Client implements NeatConfig.ConfigAccess {
private final PropertyMirror<Boolean> showArmor = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> groupArmor = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> colorByType = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<String> textColor = PropertyMirror.create(STRING);
private final PropertyMirror<Integer> hpTextHeight = PropertyMirror.create(INTEGER);
private final PropertyMirror<Boolean> showMaxHP = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showCurrentHP = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showPercentage = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showOnPassive = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showOnHostile = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showOnPlayers = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showOnBosses = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showOnlyFocused = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showFullHealth = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> enableDebugInfo = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> showEntityName = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> disableNameTag = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Boolean> disableNameTagIfHealthbar = PropertyMirror.create(BOOLEAN);
private final PropertyMirror<Double> iconOffsetX = PropertyMirror.create(DOUBLE);
private final PropertyMirror<Double> iconOffsetY = PropertyMirror.create(DOUBLE);
private final PropertyMirror<String> decimalFormat = PropertyMirror.create(STRING);
private final PropertyMirror<List<String>> blacklist = PropertyMirror.create(ConfigTypes.makeList(STRING));

public ConfigTree configure(ConfigTreeBuilder builder) {
builder.beginValue("maxDistance", INTEGER, 24)
.withComment("Maximum distance in blocks at which health bars should render")
.finishValue(maxDistance::mirror)

.beginValue("maxDistanceWithoutLineOfSight", INTEGER, 8)
.withComment("Maximum distance in blocks at which health bars should render without line of sight")
.finishValue(maxDistanceWithoutLineOfSight::mirror)

.beginValue("renderInF1", BOOLEAN, false)
.withComment("Whether health bars should render when the HUD is disabled with F1")
.finishValue(renderInF1::mirror)

.beginValue("heightAbove", DOUBLE, 0.6)
.withComment("How far above the mob health bars should render")
.withComment("How far above the mob the health bars should render")
.finishValue(heightAbove::mirror)

.beginValue("drawBackground", BOOLEAN, true)
Expand Down Expand Up @@ -127,9 +141,13 @@ public ConfigTree configure(ConfigTreeBuilder builder) {
.finishValue(groupArmor::mirror)

.beginValue("colorByType", BOOLEAN, false)
.withComment("Color the bar differently depending on whether the entity is hostile or is a boss")
.withComment("Color health bar by mob type instead of health percentage")
.finishValue(colorByType::mirror)

.beginValue("textColor", STRING, "FFFFFF")
.withComment("Text color in hex code format")
.finishValue(textColor::mirror)

.beginValue("hpTextHeight", INTEGER, 14)
.withComment("Height of the text on the health bar")
.finishValue(hpTextHeight::mirror)
Expand All @@ -146,6 +164,14 @@ public ConfigTree configure(ConfigTreeBuilder builder) {
.withComment("Whether the percentage health of the mob should be shown")
.finishValue(showPercentage::mirror)

.beginValue("showOnPassive", BOOLEAN, true)
.withComment("Whether bars on passive mobs should be shown")
.finishValue(showOnPassive::mirror)

.beginValue("showOnHostile", BOOLEAN, true)
.withComment("Whether bars on hostile mobs should be shown (does not include bosses)")
.finishValue(showOnHostile::mirror)

.beginValue("showOnPlayers", BOOLEAN, true)
.withComment("Whether bars on players should be shown")
.finishValue(showOnPlayers::mirror)
Expand All @@ -166,6 +192,30 @@ public ConfigTree configure(ConfigTreeBuilder builder) {
.withComment("Show extra debug info on the bar when F3 is enabled")
.finishValue(enableDebugInfo::mirror)

.beginValue("showEntityName", BOOLEAN, true)
.withComment("Show entity name")
.finishValue(showEntityName::mirror)

.beginValue("disableNameTag", BOOLEAN, false)
.withComment("Disables the rendering of the vanilla name tag")
.finishValue(disableNameTag::mirror)

.beginValue("disableNameTagIfHealthbar", BOOLEAN, true)
.withComment("If this is enabled and the \"disableNameTag\" option is true, the vanilla nametag is only hidden if the mob has a Neat healthbar rendered")
.finishValue(disableNameTagIfHealthbar::mirror)

.beginValue("iconOffsetX", DOUBLE, 0.0)
.withComment("Offsets the healtbar icons on the x axis")
.finishValue(iconOffsetX::mirror)

.beginValue("iconOffsetY", DOUBLE, 0.0)
.withComment("Offsets the healtbar icons on the y axis")
.finishValue(iconOffsetY::mirror)

.beginValue("decimalFormat", STRING, "#.##")
.withComment("This value changes the decimal format of the HP. Only change this value if you are familiar with how the decimal format works!")
.finishValue(decimalFormat::mirror)

.beginValue("blacklist", ConfigTypes.makeList(STRING), NeatConfig.DEFAULT_DISABLED)
.withComment("Entity ID's that should not have bars rendered")
.finishValue(blacklist::mirror);
Expand All @@ -178,6 +228,11 @@ public int maxDistance() {
return maxDistance.getValue();
}

@Override
public int maxDistanceWithoutLineOfSight() {
return maxDistanceWithoutLineOfSight.getValue();
}

@Override
public boolean renderInF1() {
return renderInF1.getValue();
Expand Down Expand Up @@ -238,6 +293,11 @@ public boolean colorByType() {
return colorByType.getValue();
}

@Override
public String textColor() {
return textColor.getValue();
}

@Override
public int hpTextHeight() {
return hpTextHeight.getValue();
Expand All @@ -258,6 +318,16 @@ public boolean showPercentage() {
return showPercentage.getValue();
}

@Override
public boolean showOnPassive() {
return showOnPassive.getValue();
}

@Override
public boolean showOnHostile() {
return showOnHostile.getValue();
}

@Override
public boolean showOnPlayers() {
return showOnPlayers.getValue();
Expand All @@ -283,6 +353,36 @@ public boolean enableDebugInfo() {
return enableDebugInfo.getValue();
}

@Override
public boolean showEntityName() {
return showEntityName.getValue();
}

@Override
public boolean disableNameTag() {
return disableNameTag.getValue();
}

@Override
public boolean disableNameTagIfHealthbar() {
return disableNameTagIfHealthbar.getValue();
}

@Override
public double iconOffsetX() {
return iconOffsetX.getValue();
}

@Override
public double iconOffsetY() {
return iconOffsetY.getValue();
}

@Override
public String decimalFormat() {
return decimalFormat.getValue();
}

@Override
public List<String> blacklist() {
return blacklist.getValue();
Expand Down
8 changes: 7 additions & 1 deletion NeoForge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java-library'
id 'idea'
id 'net.neoforged.gradle.userdev'
id 'net.neoforged.gradle.userdev' version '7.0.165'
id 'eclipse'
}

Expand All @@ -27,6 +27,12 @@ runs {
}
}

repositories {
maven {
url "https://cursemaven.com"
}
}

dependencies {
implementation "net.neoforged:neoforge:${neoforge_version}"
implementation project(":Xplat")
Expand Down
Loading

0 comments on commit 16e4921

Please sign in to comment.