Search in sources :

Example 1 with LocateCommand

use of anticope.rejects.commands.LocateCommand in project meteor-rejects by AntiCope.

the class CommandsMixin method onAdd.

@Inject(method = "add", at = @At("HEAD"), remap = false, cancellable = true)
private void onAdd(Command cmd, CallbackInfo ci) {
    if (cmd instanceof meteordevelopment.meteorclient.systems.commands.commands.LocateCommand) {
        Command command = new LocateCommand();
        commands.removeIf(command1 -> command1.getName().equals(command.getName()));
        commandInstances.values().removeIf(command1 -> command1.getName().equals(command.getName()));
        command.registerTo(DISPATCHER);
        commands.add(command);
        commandInstances.put(command.getClass(), command);
        ci.cancel();
    }
}
Also used : LocateCommand(anticope.rejects.commands.LocateCommand) LocateCommand(anticope.rejects.commands.LocateCommand) Command(meteordevelopment.meteorclient.systems.commands.Command) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

LocateCommand (anticope.rejects.commands.LocateCommand)1 Command (meteordevelopment.meteorclient.systems.commands.Command)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1