Add CommandBau help
Add CommandClear help
Dieser Commit ist enthalten in:
Ursprung
e01d9b6b90
Commit
4534e0bbb4
@ -14,32 +14,31 @@ 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) {
|
||||
if (!permissionCheck(p)) return;
|
||||
p.sendMessage(BauSystem.PREFIX + "§e/bau togglebuild §8[§7Player§8] §8- §7Editiere die Bau Rechte eines Spielers");
|
||||
p.sendMessage(BauSystem.PREFIX + "§e/bau togglewe §8[§7Player§8] §8- §7Editiere die WorldEdit Rechte eines Spielers");
|
||||
p.sendMessage(BauSystem.PREFIX + "§e/bau toggleworld §8[§7Player§8] §8- §7Editiere die Werlt Rechte eines Spielers");
|
||||
}
|
||||
|
||||
@Register("togglebuild")
|
||||
public void toggleBuildCommand(Player p, String arg) {
|
||||
if (permissionCheck(p)) {
|
||||
if (!permissionCheck(p)) return;
|
||||
onToggleBD(p, arg);
|
||||
}
|
||||
}
|
||||
|
||||
@Register("togglewe")
|
||||
public void toggleWECommand(Player p, String arg) {
|
||||
if (permissionCheck(p)) {
|
||||
if (!permissionCheck(p)) return;
|
||||
onToggleWE(p, arg);
|
||||
}
|
||||
}
|
||||
|
||||
@Register("toggleworld")
|
||||
public void toggleWorldCommand(Player p, String arg) {
|
||||
if (permissionCheck(p)) {
|
||||
if (!permissionCheck(p)) return;
|
||||
onToggleWorld(p, arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void onToggleBD(Player p, String 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,12 @@ public class CommandClear extends SWCommand {
|
||||
super("clear");
|
||||
}
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(BauSystem.PREFIX + "§e/clear §8- §7Leere dein Inventar");
|
||||
if (!permissionCheck(p)) return;
|
||||
p.sendMessage(BauSystem.PREFIX + "§e/bau clear §8[§7Player§8] §8- §7Leere ein Spieler Inventar");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void genericClearCommand(Player p) {
|
||||
@ -25,16 +30,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 {
|
||||
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();
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren