Skip to content

Commit

Permalink
Small Fixes (#36)
Browse files Browse the repository at this point in the history
* Refactor icon.png

Should be located in the base assets folder, unless we wanted a smaller res version to specifically go in a chat folder

* Cleanup text presets

* Make Welcome Hud a preset

* Systems comment

Cuz everything else is so ig this should be as well

* Use MOD_ID when retrieving metadata

* fabric.mod.json updates

Fix icon path that got scuffed in last update, remove duplicate links

* Readd position presets

And make note of the differences from Meteor so they aren't removed in the future

* Typo
  • Loading branch information
machiecodes authored Aug 22, 2024
1 parent 1e51939 commit 02c4963
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 60 deletions.
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);
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",
"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

0 comments on commit 02c4963

Please sign in to comment.