Skip to content

Commit

Permalink
HIG System + Naming Convention (#35)
Browse files Browse the repository at this point in the history
* Remove HIGPrefix module

* Add HIG System and Tab

* Naming convention

Use the same naming scheme, any module that is an improved version of meteor's should use the format "[module name] HIG"

* Teehee :3

* Okay Git

* Readd identifier method

* Correctly order modules

* Correct spacing
  • Loading branch information
machiecodes authored Aug 21, 2024
1 parent 3518410 commit 1e51939
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 147 deletions.
25 changes: 14 additions & 11 deletions src/main/java/me/redcarlos/higtools/HIGTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
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;
import meteordevelopment.meteorclient.commands.Commands;
import meteordevelopment.meteorclient.gui.tabs.Tabs;
import meteordevelopment.meteorclient.systems.Systems;
import meteordevelopment.meteorclient.systems.hud.Hud;
import meteordevelopment.meteorclient.systems.hud.HudGroup;
Expand All @@ -29,19 +31,20 @@ public class HIGTools extends MeteorAddon {
public static final HudGroup HUD;

static {
METADATA = FabricLoader.getInstance().getModContainer("higtools").orElseThrow(() -> new RuntimeException("HIGTools mod container not found!")).getMetadata();
VERSION = METADATA.getVersion().toString();
METADATA = FabricLoader.getInstance().getModContainer("higtools").orElseThrow().getMetadata();
VERSION = METADATA.getVersion().getFriendlyString();

MAIN = new Category("HIG Tools", Items.NETHERITE_PICKAXE.getDefaultStack());
BORERS = new Category(" Borers ", Items.NETHERITE_PICKAXE.getDefaultStack());
BORERS = new Category(" Borers ", Items.NETHERITE_PICKAXE.getDefaultStack());
HUD = new HudGroup("HIG Tools");
}

@Override
public void onInitialize() {
LogUtils.getLogger().info("Initializing HIGTools {}", HIGTools.VERSION);

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

// Commands
Commands.add(new Center());
Expand All @@ -57,16 +60,16 @@ public void onInitialize() {

modules.add(new AfkLogout());
modules.add(new AutoCenter());
modules.add(new AutoWalkHig());
modules.add(new AutoWalkHIG());
modules.add(new AxisViewer());
modules.add(new HIGPrefix());
modules.add(new DiscordRPC());
modules.add(new OffhandManager());
modules.add(new HighwayBuilderPlus());
modules.add(new HighwayBuilderHIG());
modules.add(new HighwayTools());
modules.add(new HotbarManager());
modules.add(new LiquidFillerHig());
modules.add(new ScaffoldPlus());
modules.add(new LiquidFillerHIG());
modules.add(new OffhandManager());
modules.add(new ScaffoldHIG());

// Borers
modules.add(new AxisBorer());
modules.add(new NegNegBorer());
Expand All @@ -87,6 +90,6 @@ public void onRegisterCategories() {
}

public static Identifier identifier(String path) {
return Identifier.of(HIGTools.MOD_ID, path);
return Identifier.of(MOD_ID, path);
}
}
25 changes: 25 additions & 0 deletions src/main/java/me/redcarlos/higtools/mixins/SystemsMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package me.redcarlos.higtools.mixins;

import me.redcarlos.higtools.system.HIGSystem;
import meteordevelopment.meteorclient.systems.System;
import meteordevelopment.meteorclient.systems.Systems;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(value = Systems.class, remap = false)
public abstract class SystemsMixin {
@Shadow
private static System<?> add(System<?> system) {
throw new AssertionError();
}

@Inject(method = "init", at = @At("HEAD"))
private static void injectSystem(CallbackInfo ci) {
System<?> higSystem = add(new HIGSystem());
higSystem.init();
higSystem.load();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public ToggleCommandMixin(String name, String description, String... aliases) {

@Unique
private final Class<? extends Module>[] otherModules = new Class[]{
HighwayTools.class,
AutoCenter.class,
AutoLog.class,
AutoWalkHig.class,
AutoWalkHIG.class,
FreeLook.class,
OffhandManager.class,
HighwayBuilderHIG.class,
HighwayTools.class,
HotbarManager.class,
LiquidFillerHig.class,
LiquidFillerHIG.class,
OffhandManager.class,
SafeWalk.class,
ScaffoldPlus.class,
HighwayBuilderPlus.class
ScaffoldHIG.class,
};

@Inject(method = "build", at = @At("HEAD"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
* Enhanced by RedCarlos26
*/

package me.redcarlos.higtools.modules.main;

import me.redcarlos.higtools.HIGTools;
Expand All @@ -21,7 +15,7 @@
import net.minecraft.client.option.KeyBinding;
import net.minecraft.item.Items;

public class AutoWalkHig extends Module {
public class AutoWalkHIG extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();

private final Setting<Boolean> pauseOnLag = sgGeneral.add(new BoolSetting.Builder()
Expand Down Expand Up @@ -65,7 +59,7 @@ public class AutoWalkHig extends Module {
private double originY;
private boolean sentLagMessage;

public AutoWalkHig() {
public AutoWalkHIG() {
super(HIGTools.MAIN, "auto-walk-HIG", "Automatically walks forward (optimized for highway digging).");
}

Expand Down
62 changes: 0 additions & 62 deletions src/main/java/me/redcarlos/higtools/modules/main/HIGPrefix.java

This file was deleted.

Loading

0 comments on commit 1e51939

Please sign in to comment.