mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Remove 'geyser' from parameters when executing a command under Spigot, Bungeecord, Sponge, Velocity (#1266)
* Remove 'geyser' from parameters when executing a command under Spigot, Bungeecode, Sponge, Velocity Fixes https://github.com/bundabrg/GeyserReversion/issues/8 * Fix case when there are no sub commands Co-authored-by: bundabrg <bundabrg@grieve.com.au>
This commit is contained in:
parent
3650321576
commit
650c02ef66
4 changed files with 10 additions and 8 deletions
|
@ -64,10 +64,10 @@ public class GeyserBungeeCommandExecutor extends Command implements TabExecutor
|
|||
sender.sendMessage(TextComponent.fromLegacyText(ChatColor.RED + message));
|
||||
return;
|
||||
}
|
||||
getCommand(args[0]).execute(new BungeeCommandSender(sender), args);
|
||||
getCommand(args[0]).execute(new BungeeCommandSender(sender), args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
||||
}
|
||||
} else {
|
||||
getCommand("help").execute(new BungeeCommandSender(sender), args);
|
||||
getCommand("help").execute(new BungeeCommandSender(sender), new String[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ public class GeyserSpigotCommandExecutor implements TabExecutor {
|
|||
sender.sendMessage(ChatColor.RED + message);
|
||||
return true;
|
||||
}
|
||||
getCommand(args[0]).execute(new SpigotCommandSender(sender), args);
|
||||
getCommand(args[0]).execute(new SpigotCommandSender(sender), args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
getCommand("help").execute(new SpigotCommandSender(sender), args);
|
||||
getCommand("help").execute(new SpigotCommandSender(sender), new String[0]);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -59,10 +59,10 @@ public class GeyserSpongeCommandExecutor implements CommandCallable {
|
|||
source.sendMessage(Text.of(ChatColor.RED + LanguageUtils.getLocaleStringLog("geyser.bootstrap.command.permission_fail")));
|
||||
return CommandResult.success();
|
||||
}
|
||||
getCommand(args[0]).execute(new SpongeCommandSender(source), args);
|
||||
getCommand(args[0]).execute(new SpongeCommandSender(source), args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
||||
}
|
||||
} else {
|
||||
getCommand("help").execute(new SpongeCommandSender(source), args);
|
||||
getCommand("help").execute(new SpongeCommandSender(source), new String[0]);
|
||||
}
|
||||
return CommandResult.success();
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ import org.geysermc.connector.GeyserConnector;
|
|||
import org.geysermc.connector.command.GeyserCommand;
|
||||
import org.geysermc.connector.utils.LanguageUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class GeyserVelocityCommandExecutor implements Command {
|
||||
|
||||
|
@ -51,10 +53,10 @@ public class GeyserVelocityCommandExecutor implements Command {
|
|||
source.sendMessage(TextComponent.of(ChatColor.RED + LanguageUtils.getLocaleStringLog("geyser.bootstrap.command.permission_fail")));
|
||||
return;
|
||||
}
|
||||
getCommand(args[0]).execute(new VelocityCommandSender(source), args);
|
||||
getCommand(args[0]).execute(new VelocityCommandSender(source), args.length > 1 ? Arrays.copyOfRange(args, 1, args.length) : new String[0]);
|
||||
}
|
||||
} else {
|
||||
getCommand("help").execute(new VelocityCommandSender(source), args);
|
||||
getCommand("help").execute(new VelocityCommandSender(source), new String[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue