Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small Fixes #36

Merged
merged 8 commits into from
Aug 22, 2024
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
7 changes: 3 additions & 4 deletions src/main/java/me/redcarlos/higtools/HIGTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import me.redcarlos.higtools.commands.Coordinates;
import me.redcarlos.higtools.modules.highwayborers.*;
import me.redcarlos.higtools.modules.hud.TextPresets;
import me.redcarlos.higtools.modules.hud.WelcomeHudHig;
import me.redcarlos.higtools.modules.main.*;
import me.redcarlos.higtools.system.HIGTab;
import meteordevelopment.meteorclient.addons.MeteorAddon;
Expand All @@ -31,7 +30,7 @@ public class HIGTools extends MeteorAddon {
public static final HudGroup HUD;

static {
METADATA = FabricLoader.getInstance().getModContainer("higtools").orElseThrow().getMetadata();
METADATA = FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow().getMetadata();
VERSION = METADATA.getVersion().getFriendlyString();

MAIN = new Category("HIG Tools", Items.NETHERITE_PICKAXE.getDefaultStack());
Expand All @@ -43,7 +42,8 @@ public class HIGTools extends MeteorAddon {
public void onInitialize() {
LogUtils.getLogger().info("Initializing HIGTools {}", HIGTools.VERSION);

BetterChat.registerCustomHead("[HIGTools]", identifier("chat/icon.png"));
// Systems
BetterChat.registerCustomHead("[HIG Tools]", identifier("icon.png"));
Tabs.add(new HIGTab());

// Commands
Expand All @@ -53,7 +53,6 @@ public void onInitialize() {
// Hud
Hud hud = Systems.get(Hud.class);
hud.register(TextPresets.INFO);
hud.register(WelcomeHudHig.INFO);

// Modules
Modules modules = Modules.get();
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/me/redcarlos/higtools/modules/hud/TextPresets.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ private static TextHud create() {
}

static {
addPreset("Player-Coords", "XYZ: #1{roundToString(player.pos.x, 1)}, {floor(player.pos.y)}, {roundToString(player.pos.z, 1)}", 0);
addPreset("Opposite-Coords", "{player.opposite_dimension != \"End\" ? player.opposite_dimension + \":\" : \"\"} #1{player.opposite_dimension != \"End\" ? \"\" + floor(player.opposite_dim_pos.x) + \", \" + floor(player.opposite_dim_pos.z) : \"\"}", 0);
machiecodes marked this conversation as resolved.
Show resolved Hide resolved
addPreset("KM/H-Speed", "Speed: #1{roundToString(player.speed*3.6, 1)} km/h", 0);
// These use a different and more accurate rounding method than Meteor's, do not remove
addPreset("Player Coords", "XYZ: #1{roundToString(player.pos.x, 1)}, {floor(player.pos.y)}, {roundToString(player.pos.z, 1)}");
addPreset("Opposite Coords", "{player.opposite_dimension != \"End\" ? player.opposite_dimension + \":\" : \"\"} #1{player.opposite_dimension != \"End\" ? \"\" + floor(player.opposite_dim_pos.x) + \", \" + floor(player.opposite_dim_pos.z) : \"\"}");

addPreset("Welcome Hud", "Welcome to HIG Tools, #1{meteor.is_module_active(\"name-protect\") ? meteor.get_module_setting(\"name-protect\", \"name\") : player._toString}");
addPreset("KM/H Speed", "Speed: #1{roundToString(player.speed * 3.6, 1)} km/h");
}

private static HudElementInfo<TextHud>.Preset addPreset(String title, String text, int updateDelay) {
return INFO.addPreset(title, textHud -> {
private static void addPreset(String title, String text) {
INFO.addPreset(title, textHud -> {
if (text != null) textHud.text.set(text);
if (updateDelay != -1) textHud.updateDelay.set(updateDelay);
textHud.updateDelay.set(0);
});
}
}
48 changes: 0 additions & 48 deletions src/main/java/me/redcarlos/higtools/modules/hud/WelcomeHudHig.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
"Ethius"
],
"contact": {
"homepage": "https://discord.gg/a4jkKGJNdJ",
RedCarlos26 marked this conversation as resolved.
Show resolved Hide resolved
"issues": "https://github.com/RedCarlos26/HIGTools/issues",
"sources": "https://github.com/RedCarlos26/HIGTools",
"discord": "https://discord.gg/a4jkKGJNdJ"
},
"license": "GPL-3.0",
"icon": "assets/higtools/chat/icon.png",
"icon": "assets/higtools/icon.png",
"environment": "client",
"entrypoints": {
"meteor": [
Expand Down
Loading