use of mathax.client.systems.enemies.Enemies in project Client by MatHax.
the class Systems method init.
public static void init() {
System<?> config = add(new Config());
config.init();
config.load();
add(new Modules());
add(new Commands());
add(new Friends());
add(new Enemies());
add(new Macros());
add(new Accounts());
add(new Waypoints());
add(new Profiles());
add(new Proxies());
add(new HUD());
MatHax.EVENT_BUS.subscribe(Systems.class);
}
use of mathax.client.systems.enemies.Enemies in project Client by MatHax.
the class EnemiesCommand method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("add").then(argument("enemy", EnemyArgumentType.enemy()).executes(context -> {
Enemy enemy = EnemyArgumentType.getEnemy(context, "enemy");
if (Enemies.get().add(enemy)) {
if (enemy.name.equals(mc.getSession().getUsername()))
return SINGLE_SUCCESS;
if (Config.get().chatFeedback.get())
info("Added (highlight)%s(default) to enemies.", enemy.name);
if (Config.get().toastFeedback.get())
mc.getToastManager().add(new ToastSystem(Items.REDSTONE_BLOCK, Enemies.get().color.getPacked(), "Enemies " + Formatting.GRAY + "[" + Formatting.WHITE + enemy.name + Formatting.GRAY + "]", null, Formatting.GRAY + "Added to enemies.", Config.get().toastDuration.get()));
} else {
if (enemy.name.equals(mc.getSession().getUsername()))
return SINGLE_SUCCESS;
if (Config.get().chatFeedback.get())
error("(highlight)%s(default) is already your enemy.", enemy.name);
if (Config.get().toastFeedback.get())
mc.getToastManager().add(new ToastSystem(Items.REDSTONE_BLOCK, Enemies.get().color.getPacked(), "Enemies " + Formatting.GRAY + "[" + Formatting.WHITE + enemy.name + Formatting.GRAY + "]", null, Formatting.RED + "Already your enemy.", Config.get().toastDuration.get()));
}
return SINGLE_SUCCESS;
})));
builder.then(literal("remove").then(argument("enemy", EnemyArgumentType.enemy()).executes(context -> {
Enemy enemy = EnemyArgumentType.getEnemy(context, "enemy");
if (Enemies.get().remove(enemy)) {
if (enemy.name.equals(mc.getSession().getUsername()))
return SINGLE_SUCCESS;
if (Config.get().chatFeedback.get())
info("Removed (highlight)%s(default) from enemies.", enemy.name);
if (Config.get().toastFeedback.get())
mc.getToastManager().add(new ToastSystem(Items.REDSTONE_BLOCK, Enemies.get().color.getPacked(), "Enemies " + Formatting.GRAY + "[" + Formatting.WHITE + enemy.name + Formatting.GRAY + "]", null, Formatting.GRAY + "Removed from enemies.", Config.get().toastDuration.get()));
} else {
if (enemy.name.equals(mc.getSession().getUsername()))
return SINGLE_SUCCESS;
if (Config.get().chatFeedback.get())
error("(highlight)%s(default) is not your enemy.", enemy.name);
if (Config.get().toastFeedback.get())
mc.getToastManager().add(new ToastSystem(Items.REDSTONE_BLOCK, Enemies.get().color.getPacked(), "Enemies " + Formatting.GRAY + "[" + Formatting.WHITE + enemy.name + Formatting.GRAY + "]", null, Formatting.RED + "Not your enemy.", Config.get().toastDuration.get()));
}
return SINGLE_SUCCESS;
})));
builder.then(literal("list").executes(context -> {
info("--- Enemies ((highlight)%s(default)) ---", Enemies.get().count());
Enemies.get().forEach(enemy -> info("(highlight)" + enemy.name));
return SINGLE_SUCCESS;
}));
}
Aggregations