added subcommands
This commit is contained in:
@@ -11,15 +11,48 @@ import org.bukkit.persistence.PersistentDataType;
|
|||||||
public class PvpCommand {
|
public class PvpCommand {
|
||||||
public static void createPvpCommand() {
|
public static void createPvpCommand() {
|
||||||
//Create PVP-Command with Command-API
|
//Create PVP-Command with Command-API
|
||||||
new CommandAPICommand("pvp").
|
new CommandAPICommand("pvp")
|
||||||
withSubcommand(new CommandAPICommand("toggle").
|
.withSubcommand(new CommandAPICommand("toggle")
|
||||||
executesPlayer((sender, args)->{
|
.executesPlayer((sender, args)->{pvpToggle(sender, args);})
|
||||||
pvpToggle(sender, args);
|
.withPermission("pvp.toggle")
|
||||||
}).
|
.withUsage("/pvp toggle")
|
||||||
withPermission("pvp.toggle").
|
.withHelp("PvP damage für sich an/auschalten.", "Du kannst damit an/ausschalten, ob du geschlagen werden kannst."))
|
||||||
withUsage("/pvp toggle").
|
.withSubcommand(new CommandAPICommand("ultra")
|
||||||
withHelp("PvP damage für sich an/auschalten.", "Du kannst damit an/ausschalten, ob du geschlagen werden kannst.")).
|
.executesPlayer((sender, args)->{pvpUltra(sender, args);})
|
||||||
register();
|
.withPermission("pvp.ultra")
|
||||||
|
.withUsage("/pvp ultra")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Du kannst damit an/ausschalten, ob du geschlagen werden kannst und andere schlagen kannst."))
|
||||||
|
.withSubcommand(new CommandAPICommand("trust")
|
||||||
|
.executesPlayer((sender, args)->{pvpTrust(sender, args, 1);})
|
||||||
|
.withPermission("pvp.trust")
|
||||||
|
.withUsage("/pvp trust")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Damit kannst du dir die Trust-List anzeigen. Alle die in der Trustliste sind können dich immer schlagen.")
|
||||||
|
.withSubcommand(new CommandAPICommand("add")
|
||||||
|
.executesPlayer((sender, args)->{pvpTrust(sender, args, 2);})
|
||||||
|
.withPermission("pvp.trust")
|
||||||
|
.withUsage("/pvp trust add <Player>")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Du kannst damit Spieler zu deiner Trust-Liste hinzufügen."))
|
||||||
|
.withSubcommand(new CommandAPICommand("remove")
|
||||||
|
.executesPlayer((sender, args)->{pvpTrust(sender, args, 3);})
|
||||||
|
.withPermission("pvp.trust")
|
||||||
|
.withUsage("/pvp trust remove <Player>")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Du kannst damit Spieler aus deiner Trust-Liste entfernen.")))
|
||||||
|
.withSubcommand(new CommandAPICommand("misstrust")
|
||||||
|
.executesPlayer((sender, args)->{pvpMisstrust(sender, args, 1);})
|
||||||
|
.withPermission("pvp.misstrust")
|
||||||
|
.withUsage("/pvp misstrust <Player>")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Damit kannst du dir die Misstrust-List anzeigen. Alle die in der Misstrustliste sind können dich nur zurückschlagen.")
|
||||||
|
.withSubcommand(new CommandAPICommand("add")
|
||||||
|
.executesPlayer((sender, args)->{pvpMisstrust(sender, args, 2);})
|
||||||
|
.withPermission("pvp.misstrust")
|
||||||
|
.withUsage("/pvp misstrust add <Player>")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Du kannst damit Spieler zu deiner Misstrust-Liste hinzufügen."))
|
||||||
|
.withSubcommand(new CommandAPICommand("remove")
|
||||||
|
.executesPlayer((sender, args)->{pvpMisstrust(sender, args, 3);})
|
||||||
|
.withPermission("pvp.misstrust")
|
||||||
|
.withUsage("/pvp misstrust remove <Player>")
|
||||||
|
.withHelp("Command noch nicht verfügbar", "Du kannst damit Spieler aus deiner Misstrust-Liste entfernen.")))
|
||||||
|
.register();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void pvpToggle(Player sender, CommandArguments args) {
|
public static void pvpToggle(Player sender, CommandArguments args) {
|
||||||
@@ -36,13 +69,30 @@ public class PvpCommand {
|
|||||||
|
|
||||||
public static void pvpUltra(Player sender, CommandArguments args) {
|
public static void pvpUltra(Player sender, CommandArguments args) {
|
||||||
//PvP Ultra Command
|
//PvP Ultra Command
|
||||||
|
sender.sendMessage("Command noch nicht verfügbar");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void pvpTrust(Player sender, CommandArguments args) {
|
public static void pvpTrust(Player sender, CommandArguments args, Int action) {
|
||||||
//PvP Trust Command
|
//PvP Trust Command
|
||||||
|
if (action == 1) {
|
||||||
|
//anzeigen
|
||||||
|
} else if (action == 2) {
|
||||||
|
//hinzufügen
|
||||||
|
} else if (action == 3) {
|
||||||
|
//entfernen
|
||||||
|
}
|
||||||
|
sender.sendMessage("Command noch nicht verfügbar");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void pvpMisstrust(Player sender, CommandArguments args) {
|
public static void pvpMisstrust(Player sender, CommandArguments args, Int action) {
|
||||||
//PvP Misstrust Command
|
//PvP Misstrust Command
|
||||||
|
if (action == 1) {
|
||||||
|
//anzeigen
|
||||||
|
} else if (action == 2) {
|
||||||
|
//hinzufügen
|
||||||
|
} else if (action == 3) {
|
||||||
|
//entfernen
|
||||||
|
}
|
||||||
|
sender.sendMessage("Command noch nicht verfügbar");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user