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();
}
}
Aggregations