Merge remote-tracking branch 'origin/CommandFramework' into CommandFramework
Dieser Commit ist enthalten in:
Commit
18612c6d07
@ -14,31 +14,29 @@ public class CommandBau extends SWCommand {
|
||||
super("bau", "b", "gs");
|
||||
}
|
||||
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
permissionCheck(p);
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ebau togglebuild §8[§7Player§8] §8- §7Editiere die Bau Rechte eines Spielers");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ebau togglewe §8[§7Player§8] §8- §7Editiere die WorldEdit Rechte eines Spielers");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ebau toggleworld §8[§7Player§8] §8- §7Editiere die Werlt Rechte eines Spielers");
|
||||
}
|
||||
|
||||
@Register("togglebuild")
|
||||
public void toggleBuildCommand(Player p, String arg) {
|
||||
if (permissionCheck(p)) {
|
||||
onToggleBD(p, arg);
|
||||
}
|
||||
if (!permissionCheck(p)) return;
|
||||
onToggleBD(p, arg);
|
||||
}
|
||||
|
||||
@Register("togglewe")
|
||||
public void toggleWECommand(Player p, String arg) {
|
||||
if (permissionCheck(p)) {
|
||||
onToggleWE(p, arg);
|
||||
}
|
||||
if (!permissionCheck(p)) return;
|
||||
onToggleWE(p, arg);
|
||||
}
|
||||
|
||||
@Register("toggleworld")
|
||||
public void toggleWorldCommand(Player p, String arg) {
|
||||
if (permissionCheck(p)) {
|
||||
onToggleWorld(p, arg);
|
||||
}
|
||||
if (!permissionCheck(p)) return;
|
||||
onToggleWorld(p, arg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,7 +4,6 @@ import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.world.Welt;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -16,6 +15,11 @@ public class CommandClear extends SWCommand {
|
||||
super("clear");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§eclear §8- §7Leere dein Inventar");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ebau clear §8[§7Player§8] §8- §7Leere ein Spieler Inventar");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericClearCommand(Player p) {
|
||||
@ -25,16 +29,19 @@ public class CommandClear extends SWCommand {
|
||||
|
||||
@Register
|
||||
public void clearPlayerCommand(Player p, Player target) {
|
||||
if (Welt.noPermission(p, Permission.world)) {
|
||||
p.sendMessage(BauSystem.PREFIX + "$cDu darfst hier keine fremden Inventare leeren.");
|
||||
return;
|
||||
} else {
|
||||
clear(target);
|
||||
target.sendMessage(BauSystem.PREFIX + "Dein Inventar wurde von" + p.getDisplayName() + " §7geleert.");
|
||||
p.sendMessage(BauSystem.PREFIX + "Das Inventar von " + target.getDisplayName() + " §7wurde geleert.");
|
||||
}
|
||||
if (!permissionCheck(p)) return;
|
||||
clear(target);
|
||||
target.sendMessage(BauSystem.PREFIX + "Dein Inventar wurde von" + p.getDisplayName() + " §7geleert.");
|
||||
p.sendMessage(BauSystem.PREFIX + "Das Inventar von " + target.getDisplayName() + " §7wurde geleert.");
|
||||
}
|
||||
|
||||
private boolean permissionCheck(Player player) {
|
||||
if (Welt.noPermission(player, Permission.world)) {
|
||||
player.sendMessage(BauSystem.PREFIX + "$cDu darfst hier keine fremden Inventare leeren.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void clear(Player player) {
|
||||
player.getInventory().clear();
|
||||
|
@ -14,6 +14,11 @@ public class CommandDebugStick extends SWCommand {
|
||||
super("debugstick");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§edebugstick §8- §7Erhalte einen DebugStick");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
if (Welt.noPermission(p, Permission.build)) {
|
||||
|
@ -44,6 +44,12 @@ public class CommandGUI extends SWCommand implements Listener {
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(BauSystem.getPlugin(), LAST_F_PLAYER::clear, 0, 20);
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§egui §8- §7Öffne die GUI");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§egui item §8- §7Gebe das GUI item");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
openBauGui(p);
|
||||
|
@ -13,7 +13,6 @@ public class CommandGamemode extends SWCommand {
|
||||
super("gamemode", "gm");
|
||||
}
|
||||
|
||||
|
||||
@Register(help = true)
|
||||
public void gamemodeHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§cUnbekannter Spielmodus");
|
||||
@ -21,30 +20,20 @@ public class CommandGamemode extends SWCommand {
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
if (!permissionCheck(p)) {
|
||||
//noinspection UnnecessaryReturnStatement
|
||||
return;
|
||||
if (!permissionCheck(p)) return;
|
||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
} else {
|
||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
} else {
|
||||
p.setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
p.setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Register
|
||||
public void gamemodeCommand(Player p, GameMode gameMode) {
|
||||
if (!permissionCheck(p)) {
|
||||
//noinspection UnnecessaryReturnStatement
|
||||
return;
|
||||
} else {
|
||||
p.setGameMode(gameMode);
|
||||
}
|
||||
if (!permissionCheck(p)) return;
|
||||
p.setGameMode(gameMode);
|
||||
}
|
||||
|
||||
|
||||
private boolean permissionCheck(Player p) {
|
||||
if (!p.getUniqueId().equals(BauSystem.getOwner())) {
|
||||
BauweltMember member = BauweltMember.getBauMember(BauSystem.getOwner(), p.getUniqueId());
|
||||
|
@ -31,6 +31,11 @@ public class CommandGills extends SWCommand {
|
||||
super("watervision", "wv");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ewatervision §8- §7Toggle WaterBreathing");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
toggleGills(p);
|
||||
|
@ -38,6 +38,11 @@ public class CommandInfo extends SWCommand {
|
||||
super("bauinfo");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ebauinfo §8- §7Gebe Informationen über den Bau");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
p.sendMessage(BauSystem.PREFIX + "Besitzer: §e" + SteamwarUser.get(BauSystem.getOwnerID()).getUserName());
|
||||
|
@ -31,6 +31,11 @@ public class CommandNV extends SWCommand {
|
||||
super("nightvision", "nv");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§enightvision §8- §7Toggle NightVision");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
toggleNightvision(p);
|
||||
|
@ -37,6 +37,12 @@ public class CommandProtect extends SWCommand {
|
||||
super("protect");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§eprotect §8- §7Schütze die Region");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§eprotect §8[§7Schematic§8] §8- §7Schütze die Region mit einer Schematic");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericTestblockCommand(Player p) {
|
||||
if (!permissionCheck(p)) return;
|
||||
|
@ -34,6 +34,11 @@ public class CommandRedstoneTester extends SWCommand {
|
||||
super("redstonetester", "rt");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§eredstonetester §8- §7Gibt den RedstoneTester");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
VersionedRunnable.call(new VersionedRunnable(() -> {
|
||||
|
@ -37,6 +37,12 @@ public class CommandReset extends SWCommand {
|
||||
super("reset");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ereset §8- §7Setzte die Region zurück");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§ereset §8[§7Schematic§8] §8- §7Setzte die Region mit einer Schematic zurück");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericResetCommand(Player p) {
|
||||
if (!permissionCheck(p)) return;
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
package de.steamwar.bausystem.commands;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import org.bukkit.Material;
|
||||
@ -81,6 +82,11 @@ public class CommandScript extends SWCommand {
|
||||
BOOK.setItemMeta(bookMeta);
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§escript §8- §7Gibt das Script Buch");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void giveCommand(Player p) {
|
||||
SWUtils.giveItemToPlayer(p, BOOK);
|
||||
|
@ -15,6 +15,14 @@ public class CommandScriptVars extends SWCommand {
|
||||
super("scripvars");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§escriptvars §8- §7Zähle alle globalen Variablen auf");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§escriptvars §8[§7Variable§8] §8- §7Gebe den Wert der Variable zurück");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§escriptvars §8[§7Variable§8] §8[§7Value§8] §8- §7Setzte eine Variable auf einen Wert");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§escriptvars §8[§7Variable§8] §8<§7remove§8|§7delete§8|§7clear§8> §8- §7Lösche eine Variable");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericCommand(Player p) {
|
||||
Map<String, Integer> globalVariables = ScriptListener.GLOBAL_VARIABLES.get(p);
|
||||
|
@ -35,7 +35,7 @@ public class CommandSkull extends SWCommand {
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§eskull §8[§eSpieler§8]");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§eskull §8[§eSpieler§8] §8- §7Gibt einen SpielerKopf");
|
||||
}
|
||||
|
||||
@Register
|
||||
|
@ -36,7 +36,7 @@ public class CommandSpeed extends SWCommand {
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "/speed [Geschwindigkeit]");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§espeed §8[§7Geschwindigkeit§8] §8- §7Setzte deine Flug- und Gehgeschwindigkeit");
|
||||
}
|
||||
|
||||
@Register({"default"})
|
||||
|
@ -60,6 +60,12 @@ public class CommandTNT extends SWCommand implements Listener {
|
||||
Bukkit.getPluginManager().registerEvents(this, BauSystem.getPlugin());
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§etnt §8- §7Ändere das TNT verhalten");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§etnt §8[§7Mode§8] §8- §7Setzte das TNT verhalten auf einen Modus");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void toggleCommand(Player p) {
|
||||
if (!permissionCheck(p)) return;
|
||||
|
@ -37,6 +37,12 @@ public class CommandTestblock extends SWCommand {
|
||||
super("testblock", "tb");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§etestblock §8- §7Setzte den Testblock zurück");
|
||||
p.sendMessage(BauSystem.PREFIX + "§8/§etestblock §8[§7Schematic§8] §8- §7Setzte den Testblock mit einer Schematic zurück");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericTestblockCommand(Player p) {
|
||||
if (!permissionCheck(p)) return;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren