Skip to content

Commit 89b2ecc

Browse files
authored
Merge pull request #6 from dsnsgithub/dev/settings
BetterHUD v2.0.0: Add Individual Mod Settings main branch is on 1.21.6-1.21.10 1.21 branch for 1.21-1.21.5
2 parents 7d22386 + 2fef573 commit 89b2ecc

18 files changed

Lines changed: 972 additions & 608 deletions

.github/workflows/build.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,22 @@ on: [pull_request, push]
88

99
jobs:
1010
build:
11-
strategy:
12-
matrix:
13-
# Use these Java versions
14-
java: [
15-
21, # Current Java LTS
16-
]
17-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1812
steps:
1913
- name: checkout repository
2014
uses: actions/checkout@v4
2115
- name: validate gradle wrapper
22-
uses: gradle/wrapper-validation-action@v2
23-
- name: setup jdk ${{ matrix.java }}
16+
uses: gradle/actions/wrapper-validation@v4
17+
- name: setup jdk
2418
uses: actions/setup-java@v4
2519
with:
26-
java-version: ${{ matrix.java }}
20+
java-version: '21'
2721
distribution: 'microsoft'
2822
- name: make gradle wrapper executable
2923
run: chmod +x ./gradlew
3024
- name: build
3125
run: ./gradlew build
3226
- name: capture build artifacts
33-
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
3427
uses: actions/upload-artifact@v4
3528
with:
3629
name: Artifacts

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ loader_version=0.17.3
1010
loom_version=1.11-SNAPSHOT
1111

1212
# Mod Properties
13-
mod_version=1.1.1
13+
mod_version=2.0.0
1414
maven_group=dsns.betterhud
1515
archives_base_name=betterhud
1616

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
11
package dsns.betterhud;
22

3+
import dsns.betterhud.mods.*;
4+
import dsns.betterhud.util.BaseMod;
5+
import java.util.ArrayList;
6+
import java.util.Arrays;
37
import net.fabricmc.api.ClientModInitializer;
48
import net.fabricmc.api.EnvType;
59
import net.fabricmc.api.Environment;
610
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
711
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
812
import net.minecraft.util.Identifier;
9-
1013
import org.slf4j.Logger;
1114
import org.slf4j.LoggerFactory;
1215

1316
@Environment(EnvType.CLIENT)
1417
public class BetterHUD implements ClientModInitializer {
15-
// This logger is used to write text to the console and the log file.
16-
// It is considered best practice to use your mod id as the logger's name.
17-
// That way, it's clear which mod wrote info, warnings, and errors.
18-
public static final Logger LOGGER = LoggerFactory.getLogger("betterhud");
1918

20-
@Override
21-
public void onInitializeClient() {
22-
Config.configure();
19+
// This logger is used to write text to the console and the log file.
20+
// It is considered best practice to use your mod id as the logger's name.
21+
// That way, it's clear which mod wrote info, warnings, and errors.
22+
public static final Logger LOGGER = LoggerFactory.getLogger("betterhud");
23+
24+
public static ArrayList<BaseMod> mods = new ArrayList<>(
25+
Arrays.asList(
26+
new FPS(),
27+
new Ping(),
28+
new Momentum(),
29+
new Coordinates(),
30+
new Biome(),
31+
new Facing(),
32+
new Time()
33+
)
34+
);
35+
36+
@Override
37+
public void onInitializeClient() {
38+
Config.configure();
39+
40+
BetterHUDGUI betterHUDGUI = new BetterHUDGUI();
2341

24-
BetterHUDGUI betterHUDGUI = new BetterHUDGUI();
25-
HudElementRegistry.addLast(Identifier.of("betterhud", "hud"), betterHUDGUI::onHudRender);
26-
ClientTickEvents.START_CLIENT_TICK.register(betterHUDGUI);
27-
}
28-
}
42+
HudElementRegistry.addLast(
43+
Identifier.of("betterhud", "hud"),
44+
betterHUDGUI::onHudRender
45+
);
46+
ClientTickEvents.START_CLIENT_TICK.register(betterHUDGUI);
47+
}
48+
}

0 commit comments

Comments
 (0)