Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@ on: [pull_request, push]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
21, # Current Java LTS
]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.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: gradle/actions/wrapper-validation@v4
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-version: '21'
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
uses: actions/upload-artifact@v4
with:
name: Artifacts
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.17.3
loom_version=1.11-SNAPSHOT

# Mod Properties
mod_version=1.1.1
mod_version=2.0.0
maven_group=dsns.betterhud
archives_base_name=betterhud

Expand Down
46 changes: 33 additions & 13 deletions src/main/java/dsns/betterhud/BetterHUD.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
package dsns.betterhud;

import dsns.betterhud.mods.*;
import dsns.betterhud.util.BaseMod;
import java.util.ArrayList;
import java.util.Arrays;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.util.Identifier;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

@Override
public void onInitializeClient() {
Config.configure();
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("betterhud");

public static ArrayList<BaseMod> mods = new ArrayList<>(
Arrays.asList(
new FPS(),
new Ping(),
new Momentum(),
new Coordinates(),
new Biome(),
new Facing(),
new Time()
)
);

@Override
public void onInitializeClient() {
Config.configure();

BetterHUDGUI betterHUDGUI = new BetterHUDGUI();

BetterHUDGUI betterHUDGUI = new BetterHUDGUI();
HudElementRegistry.addLast(Identifier.of("betterhud", "hud"), betterHUDGUI::onHudRender);
ClientTickEvents.START_CLIENT_TICK.register(betterHUDGUI);
}
}
HudElementRegistry.addLast(
Identifier.of("betterhud", "hud"),
betterHUDGUI::onHudRender
);
ClientTickEvents.START_CLIENT_TICK.register(betterHUDGUI);
}
}
Loading