mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-09-27 04:52:43 +02:00
7a4d28b113
The official BungeeCord fork hit us with a surprise incompatibility recently. Yikes.
58 lines
1.7 KiB
Java
58 lines
1.7 KiB
Java
package net.ME1312.SubServers.Bungee.Library.Compatibility.Galaxi;
|
|
|
|
import net.ME1312.Galaxi.Library.Util;
|
|
import net.md_5.bungee.api.plugin.Command;
|
|
|
|
/**
|
|
* Galaxi Command Compatibility Class
|
|
*/
|
|
public class GalaxiCommand {
|
|
|
|
/**
|
|
* Group similar Commands
|
|
*
|
|
* @param commands Command Classes
|
|
*/
|
|
@SafeVarargs
|
|
public static void group(Class<? extends Command>... commands) {
|
|
Util.isException(() -> Util.reflect(GalaxiCommandWrapper.class.getDeclaredConstructor(Class[].class), (Object) commands));
|
|
}
|
|
|
|
/**
|
|
* Set the Description of a Command
|
|
*
|
|
* @param command Command
|
|
* @param value Value
|
|
* @return The Command
|
|
*/
|
|
public static Command description(Command command, String value) {
|
|
Util.isException(() -> Util.reflect(Class.forName("net.ME1312.Galaxi.Plugin.Command.Command").getMethod("description", String.class), command, value));
|
|
return command;
|
|
}
|
|
|
|
/**
|
|
* Set the Help Page for a Command
|
|
*
|
|
* @param command Command
|
|
* @param lines Help Page Lines
|
|
* @return The Command
|
|
*/
|
|
public static Command help(Command command, String... lines) {
|
|
Util.isException(() -> Util.reflect(Class.forName("net.ME1312.Galaxi.Plugin.Command.Command").getMethod("help", String[].class), command, (Object) lines));
|
|
return command;
|
|
}
|
|
|
|
/**
|
|
* Set the Usage of a Command
|
|
*
|
|
* @param command Command
|
|
* @param args Argument Placeholders
|
|
* @return The Command
|
|
*/
|
|
public static Command usage(Command command, String... args) {
|
|
Util.isException(() -> Util.reflect(Class.forName("net.ME1312.Galaxi.Plugin.Command.Command").getMethod("usage", String[].class), command, (Object) args));
|
|
return command;
|
|
}
|
|
|
|
}
|