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");
|
super("bau", "b", "gs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Register(help = true)
|
||||||
@Register
|
public void genericHelp(Player p, String... args) {
|
||||||
public void genericCommand(Player p) {
|
if (!permissionCheck(p)) return;
|
||||||
permissionCheck(p);
|
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")
|
@Register("togglebuild")
|
||||||
public void toggleBuildCommand(Player p, String arg) {
|
public void toggleBuildCommand(Player p, String arg) {
|
||||||
if (permissionCheck(p)) {
|
if (!permissionCheck(p)) return;
|
||||||
onToggleBD(p, arg);
|
onToggleBD(p, arg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Register("togglewe")
|
@Register("togglewe")
|
||||||
public void toggleWECommand(Player p, String arg) {
|
public void toggleWECommand(Player p, String arg) {
|
||||||
if (permissionCheck(p)) {
|
if (!permissionCheck(p)) return;
|
||||||
onToggleWE(p, arg);
|
onToggleWE(p, arg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Register("toggleworld")
|
@Register("toggleworld")
|
||||||
public void toggleWorldCommand(Player p, String arg) {
|
public void toggleWorldCommand(Player p, String arg) {
|
||||||
if (permissionCheck(p)) {
|
if (!permissionCheck(p)) return;
|
||||||
onToggleWorld(p, arg);
|
onToggleWorld(p, arg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void onToggleBD(Player p, String 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.Permission;
|
||||||
import de.steamwar.bausystem.world.Welt;
|
import de.steamwar.bausystem.world.Welt;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -16,6 +15,12 @@ public class CommandClear extends SWCommand {
|
|||||||
super("clear");
|
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
|
@Register
|
||||||
public void genericClearCommand(Player p) {
|
public void genericClearCommand(Player p) {
|
||||||
@ -25,16 +30,19 @@ public class CommandClear extends SWCommand {
|
|||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void clearPlayerCommand(Player p, Player target) {
|
public void clearPlayerCommand(Player p, Player target) {
|
||||||
if (Welt.noPermission(p, Permission.world)) {
|
if (!permissionCheck(p)) return;
|
||||||
p.sendMessage(BauSystem.PREFIX + "$cDu darfst hier keine fremden Inventare leeren.");
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
clear(target);
|
clear(target);
|
||||||
target.sendMessage(BauSystem.PREFIX + "Dein Inventar wurde von" + p.getDisplayName() + " §7geleert.");
|
target.sendMessage(BauSystem.PREFIX + "Dein Inventar wurde von" + p.getDisplayName() + " §7geleert.");
|
||||||
p.sendMessage(BauSystem.PREFIX + "Das Inventar von " + target.getDisplayName() + " §7wurde geleert.");
|
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) {
|
private void clear(Player player) {
|
||||||
player.getInventory().clear();
|
player.getInventory().clear();
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren