SteamWar/BauSystem
Archiviert
13
0

converted enums to upper case

added CommandSelect
Dieser Commit ist enthalten in:
Zeanon 2021-04-03 22:16:19 +02:00
Ursprung d5f194656b
Commit db3e3a7cbc
21 geänderte Dateien mit 172 neuen und 62 gelöschten Zeilen

Datei anzeigen

@ -20,8 +20,8 @@
package de.steamwar.bausystem;
public enum Permission {
world,
worldedit,
build,
member
WORLD,
WORLDEDIT,
BUILD,
MEMBER
}

Datei anzeigen

@ -54,7 +54,7 @@ public class CommandClear extends SWCommand {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "$cDu darfst hier keine fremden Inventare leeren.");
return false;
}

Datei anzeigen

@ -39,7 +39,7 @@ public class CommandDebugStick extends SWCommand {
@Register
public void genericCommand(Player p) {
if (Welt.noPermission(p, Permission.build)) {
if (Welt.noPermission(p, Permission.BUILD)) {
p.sendMessage(BauSystem.PREFIX + "§cKein Debugstick für dich hier.");
} else {
VersionedRunnable.call(new VersionedRunnable(() -> p.sendMessage(BauSystem.PREFIX + "§cDen Debugstick gibt es nicht in der 1.12."), 8),

Datei anzeigen

@ -105,7 +105,7 @@ public class CommandDetonator extends SWCommand {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Detonator nutzen");
return false;
}

Datei anzeigen

@ -72,7 +72,7 @@ public class CommandFire extends SWCommand implements Listener {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + getNoPermMessage());
return false;
}

Datei anzeigen

@ -77,7 +77,7 @@ public class CommandFreeze extends SWCommand implements Listener {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + getNoPermMessage());
return false;
}

Datei anzeigen

@ -97,45 +97,45 @@ public class CommandGUI extends SWCommand implements Listener {
player.performCommand("gui item");
});
ItemStack dtWand = wand(player, Detonator.WAND, "§8/§7dt wand", Permission.world, "§cDu hast keine Worldrechte");
ItemStack dtWand = wand(player, Detonator.WAND, "§8/§7dt wand", Permission.WORLD, "§cDu hast keine Worldrechte");
inv.setItem(39, dtWand, clickType -> {
if (Welt.noPermission(player, Permission.world))
if (Welt.noPermission(player, Permission.WORLD))
return;
player.closeInventory();
player.performCommand("dt wand");
});
ItemStack simWand = wand(player, TNTSimulator.WAND, "§8/§7sim wand", Permission.world, "§cDu hast keine Worldrechte");
ItemStack simWand = wand(player, TNTSimulator.WAND, "§8/§7sim wand", Permission.WORLD, "§cDu hast keine Worldrechte");
inv.setItem(38, simWand, clickType -> {
if (Welt.noPermission(player, Permission.world))
if (Welt.noPermission(player, Permission.WORLD))
return;
player.closeInventory();
player.performCommand("sim wand");
});
ItemStack redstoneWand = wand(player, RedstoneListener.WAND, "§8/§7redstonetester", Permission.build, "Du hast keine Buildrechte");
ItemStack redstoneWand = wand(player, RedstoneListener.WAND, "§8/§7redstonetester", Permission.BUILD, "Du hast keine Buildrechte");
inv.setItem(37, redstoneWand, clickType -> {
if (Welt.noPermission(player, Permission.build))
if (Welt.noPermission(player, Permission.BUILD))
return;
player.closeInventory();
player.performCommand("redstonetester");
});
inv.setItem(40, getMaterial("WOODEN_AXE", "WOOD_AXE"), "§eWorldedit Axt", getNoPermsLore(Arrays.asList("§8//§7wand"), player, "§cDu hast keine Worldeditrechte", Permission.worldedit), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
if (Welt.noPermission(player, Permission.WORLD))
return;
player.closeInventory();
player.performCommand("/wand");
});
inv.setItem(41, getMaterial("DEBUG_STICK", "STICK"), "§eDebugstick", getNoPermsLore(Arrays.asList("§8/§7debugstick"), player, "§cDu hast keine Worldrechte", Permission.world), Core.getVersion() < 13, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(41, getMaterial("DEBUG_STICK", "STICK"), "§eDebugstick", getNoPermsLore(Arrays.asList("§8/§7debugstick"), player, "§cDu hast keine Worldrechte", Permission.WORLD), Core.getVersion() < 13, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.closeInventory();
player.performCommand("debugstick");
});
inv.setItem(20, Material.COMPASS, "§7TPS Limitieren", getNoPermsLore(Arrays.asList("§7Aktuell: §e" + CommandTPSLimiter.getCurrentTPSLimit(), "§8/§7tpslimit §8[§e0,5 - " + (TPSUtils.isWarpAllowed() ? 40 : 20) + "§8]"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(20, Material.COMPASS, "§7TPS Limitieren", getNoPermsLore(Arrays.asList("§7Aktuell: §e" + CommandTPSLimiter.getCurrentTPSLimit(), "§8/§7tpslimit §8[§e0,5 - " + (TPSUtils.isWarpAllowed() ? 40 : 20) + "§8]"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
SWAnvilInv anvilInv = new SWAnvilInv(player, "TPS Limitieren");
anvilInv.setItem(Material.COMPASS);
@ -170,16 +170,16 @@ public class CommandGUI extends SWCommand implements Listener {
scriptBooksGUI(player);
});
inv.setItem(21, Material.OBSERVER, "§7Tracer", getNoPermsLore(Arrays.asList("§7Status: §e" + RecordStateMachine.getRecordStatus().getName()), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(21, Material.OBSERVER, "§7Tracer", getNoPermsLore(Arrays.asList("§7Status: §e" + RecordStateMachine.getRecordStatus().getName()), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.closeInventory();
OPEN_TRACER_INVS.add(player);
traceGUI(player);
});
inv.setItem(22, Material.DISPENSER, "§7Auto-Loader", getNoPermsLore(Arrays.asList("§7Status: " + (AutoLoader.hasLoader(player) ? "§aan" : "§caus")), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(22, Material.DISPENSER, "§7Auto-Loader", getNoPermsLore(Arrays.asList("§7Status: " + (AutoLoader.hasLoader(player) ? "§aan" : "§caus")), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.closeInventory();
autoLoaderGUI(player);
@ -200,15 +200,15 @@ public class CommandGUI extends SWCommand implements Listener {
inv.setItem(27, Material.BARRIER, "§eKeine Region", clickType -> {
});
} else {
inv.setItem(27, getMaterial("HEAVY_WEIGHTED_PRESSURE_PLATE", "IRON_PLATE"), "§eRegion Reseten", getNoPermsLore(Arrays.asList("§8/§7reset"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(27, getMaterial("HEAVY_WEIGHTED_PRESSURE_PLATE", "IRON_PLATE"), "§eRegion Reseten", getNoPermsLore(Arrays.asList("§8/§7reset"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
confirmationInventory(player, "Region Reseten?", () -> player.performCommand("reset"), () -> openBauGui(player));
});
if (region.hasProtection()) {
inv.setItem(18, Material.OBSIDIAN, "§eRegion Protecten", getNoPermsLore(Arrays.asList("§8/§7protect"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(18, Material.OBSIDIAN, "§eRegion Protecten", getNoPermsLore(Arrays.asList("§8/§7protect"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
confirmationInventory(player, "Region Protecten", () -> player.performCommand("protect"), () -> openBauGui(player));
});
@ -218,8 +218,8 @@ public class CommandGUI extends SWCommand implements Listener {
}
if (region.hasTestblock()) {
inv.setItem(9, getMaterial("END_STONE", "ENDER_STONE"), "§eTestblock erneuern", getNoPermsLore(Arrays.asList("§8/§7testblock"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(9, getMaterial("END_STONE", "ENDER_STONE"), "§eTestblock erneuern", getNoPermsLore(Arrays.asList("§8/§7testblock"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
confirmationInventory(player, "Testblock erneuern", () -> player.performCommand("testblock"), () -> openBauGui(player));
});
@ -254,11 +254,11 @@ public class CommandGUI extends SWCommand implements Listener {
}
boolean isBuildArea = region.hasBuildRegion();
List<String> tntLore = getNoPermsLore(Arrays.asList("§8/§7tnt §8[" + (isBuildArea ? "§eTB§7, " : "") + "§eOff §7oder §eOn§7]"), player, "§cDu hast keine Worldrechte", Permission.world);
List<String> tntLore = getNoPermsLore(Arrays.asList("§8/§7tnt §8[" + (isBuildArea ? "§eTB§7, " : "") + "§eOff §7oder §eOn§7]"), player, "§cDu hast keine Worldrechte", Permission.WORLD);
switch (region.getTntMode()) {
case OFF:
inv.setItem(23, Material.MINECART, "§7TNT: §eAusgeschaltet", tntLore, false, clickType -> {
if (Welt.noPermission(player, Permission.world))
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("tnt " + (isBuildArea ? "tb" : "on"));
updateInventories();
@ -266,7 +266,7 @@ public class CommandGUI extends SWCommand implements Listener {
break;
case ONLY_TB:
inv.setItem(23, getMaterial("TNT_MINECART", "EXPLOSIVE_MINECART"), "§7TNT: §enur Testblock", tntLore, false, clickType -> {
if (Welt.noPermission(player, Permission.world))
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("tnt on");
updateInventories();
@ -274,7 +274,7 @@ public class CommandGUI extends SWCommand implements Listener {
break;
default:
inv.setItem(23, Material.TNT, "§7TNT: §eEingeschaltet", tntLore, false, clickType -> {
if (Welt.noPermission(player, Permission.world))
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("tnt off");
updateInventories();
@ -282,15 +282,15 @@ public class CommandGUI extends SWCommand implements Listener {
}
if (region.isFreeze()) {
inv.setItem(24, getMaterial("GUNPOWDER", "SULPHUR"), "§7Freeze: §eEingeschaltet", getNoPermsLore(Arrays.asList("§8/§7freeze"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(24, getMaterial("GUNPOWDER", "SULPHUR"), "§7Freeze: §eEingeschaltet", getNoPermsLore(Arrays.asList("§8/§7freeze"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("freeze");
updateInventories();
});
} else {
inv.setItem(24, Material.REDSTONE, "§7Freeze: §eAusgeschaltet", getNoPermsLore(Arrays.asList("§8/§7freeze"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(24, Material.REDSTONE, "§7Freeze: §eAusgeschaltet", getNoPermsLore(Arrays.asList("§8/§7freeze"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("freeze");
updateInventories();
@ -298,23 +298,23 @@ public class CommandGUI extends SWCommand implements Listener {
}
if (region.isFire()) {
inv.setItem(3, getMaterial("FIREWORK_STAR", "FIREWORK_CHARGE"), "§7Fire: §eAusgeschaltet", getNoPermsLore(Arrays.asList("§8/§7fire"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(3, getMaterial("FIREWORK_STAR", "FIREWORK_CHARGE"), "§7Fire: §eAusgeschaltet", getNoPermsLore(Arrays.asList("§8/§7fire"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("fire");
updateInventories();
});
} else {
inv.setItem(3, getMaterial("FIRE_CHARGE", "FIREBALL"), "§7Fire: §eEingeschaltet", getNoPermsLore(Arrays.asList("§8/§7fire"), player, "§cDu hast keine Worldrechte", Permission.world), false, clickType -> {
if (Welt.noPermission(player, Permission.world))
inv.setItem(3, getMaterial("FIRE_CHARGE", "FIREBALL"), "§7Fire: §eEingeschaltet", getNoPermsLore(Arrays.asList("§8/§7fire"), player, "§cDu hast keine Worldrechte", Permission.WORLD), false, clickType -> {
if (Welt.noPermission(player, Permission.WORLD))
return;
player.performCommand("fire");
updateInventories();
});
}
inv.setItem(2, Material.ENDER_PEARL, "§7Teleporter", getNoPermsLore(Arrays.asList("§8/§7tp §8[§eSpieler§8]"), player, "§cDu hast keine Buildrechte", Permission.build), false, clickType -> {
if (Welt.noPermission(player, Permission.build))
inv.setItem(2, Material.ENDER_PEARL, "§7Teleporter", getNoPermsLore(Arrays.asList("§8/§7tp §8[§eSpieler§8]"), player, "§cDu hast keine Buildrechte", Permission.BUILD), false, clickType -> {
if (Welt.noPermission(player, Permission.BUILD))
return;
List<SWListInv.SWListEntry<String>> playerSWListEntry = new ArrayList<>();
Bukkit.getOnlinePlayers().forEach(player1 -> {

Datei anzeigen

@ -80,7 +80,7 @@ public class CommandLoader extends SWCommand {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.build)) {
if (Welt.noPermission(player, Permission.BUILD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den AutoLader verwenden");
return false;
}

Datei anzeigen

@ -52,7 +52,7 @@ public class CommandRedstoneTester extends SWCommand {
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.build)) {
if (Welt.noPermission(player, Permission.BUILD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Redstonetester nutzen");
return false;
}

Datei anzeigen

@ -78,7 +78,7 @@ public class CommandReset extends SWCommand {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht die Region zurücksetzen");
return false;
}

Datei anzeigen

@ -0,0 +1,110 @@
package de.steamwar.bausystem.commands;
import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.world.World;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.world.Welt;
import de.steamwar.bausystem.world.regions.*;
import de.steamwar.command.SWCommand;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class CommandSelect extends SWCommand {
public static final WorldEditPlugin WORLDEDIT_PLUGIN = ((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"));
public static final World BUKKITWORLD = new BukkitWorld(Bukkit.getWorlds().get(0));
public CommandSelect() {
super("select");
}
@Register
public void baurahmenCommand(Player p, RegionType regionType) {
if (!permissionCheck(p)) {
return;
}
Region region = Region.getRegion(p.getLocation());
if (GlobalRegion.isGlobalRegion(region)) {
//TODO
return;
}
if (regionType == RegionType.TESTBLOCK) {
if (!region.hasTestblock()) {
//TODO motz den user an
return;
}
setSelection(regionType, RegionExtensionType.NORMAL, region, p);
return;
}
if (regionType == RegionType.BUILD) {
if (!region.hasBuildRegion()) {
//TODO motz den user an
return;
}
setSelection(regionType, RegionExtensionType.NORMAL, region, p);
return;
}
setSelection(regionType, RegionExtensionType.NORMAL, region, p);
}
@Register
public void baurahmenCommand(Player p, RegionType regionType, RegionExtensionType regionExtensionType) {
if (!permissionCheck(p)) {
return;
}
Region region = Region.getRegion(p.getLocation());
if (GlobalRegion.isGlobalRegion(region)) {
//TODO
return;
}
if (regionType == RegionType.TESTBLOCK) {
if (!region.hasTestblock() || !region.hasTestblockExtensionAreaRegistered()) {
//TODO motz den user an
return;
}
setSelection(regionType, regionExtensionType, region, p);
return;
}
if (regionType == RegionType.BUILD) {
if (!region.hasBuildRegion() || !region.hasBuildAreaExtensionAreaRegistered()) {
//TODO motz den user an
return;
}
setSelection(regionType, regionExtensionType, region, p);
return;
}
setSelection(regionType, regionExtensionType, region, p);
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.WORLDEDIT)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den AutoLader verwenden");
return false;
}
return true;
}
private void setSelection(RegionType regionType, RegionExtensionType regionExtensionType, Region region, Player p) {
Point minPoint = region.getMinPoint(regionType, regionExtensionType);
Point maxPoint = region.getMaxPoint(regionType, regionExtensionType);
WORLDEDIT_PLUGIN.getSession(p).setRegionSelector(BUKKITWORLD, new CuboidRegionSelector(BUKKITWORLD, minPoint.toBlockVector3(), maxPoint.toBlockVector3()));
}
}

Datei anzeigen

@ -67,7 +67,7 @@ public class CommandSimulator extends SWCommand {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Simulator nutzen");
return false;
}

Datei anzeigen

@ -96,7 +96,7 @@ public class CommandTNT extends SWCommand implements Listener {
}
private boolean permissionCheck(Player p) {
if (Welt.noPermission(p, Permission.world)) {
if (Welt.noPermission(p, Permission.WORLD)) {
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht TNT-Schaden (de-)aktivieren");
return false;
}

Datei anzeigen

@ -105,7 +105,7 @@ public class CommandTPSLimiter extends SWCommand {
}
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den TPS-Limiter nutzen");
return false;
}

Datei anzeigen

@ -45,7 +45,7 @@ public class CommandTime extends SWCommand {
@Register
public void genericCommand(Player p, int time) {
if (Welt.noPermission(p, Permission.world)) {
if (Welt.noPermission(p, Permission.WORLD)) {
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht die Zeit ändern");
return;
}
@ -58,7 +58,7 @@ public class CommandTime extends SWCommand {
@Register
public void genericCommand(Player p, Time time) {
if (Welt.noPermission(p, Permission.world)) {
if (Welt.noPermission(p, Permission.WORLD)) {
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht die Zeit ändern");
return;
}

Datei anzeigen

@ -123,7 +123,7 @@ public class CommandTrace extends SWCommand {
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den TNT-Tracer nutzen");
return false;
}

Datei anzeigen

@ -21,7 +21,7 @@ public class DetonatorListener implements Listener {
if (VersionedCallable.call(new VersionedCallable<>(() -> event.getItem().isSimilar(Detonator.WAND), 12),
new VersionedCallable<>(() -> event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(BauSystem.getPlugin(), "deto"), PersistentDataType.BYTE), 15))) {
Player player = event.getPlayer();
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Detonator nutzen");
return;
}

Datei anzeigen

@ -49,7 +49,7 @@ public class RedstoneListener implements Listener {
private static Map<Player, RedstoneTester> playerMap = new HashMap<>();
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.build)) {
if (Welt.noPermission(player, Permission.BUILD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Redstonetester nutzen");
return false;
}

Datei anzeigen

@ -63,7 +63,7 @@ public class RegionListener implements Listener {
public void onBlockBreak(BlockBreakEvent e) {
Player p = e.getPlayer();
if (Welt.noPermission(p, Permission.build)) {
if (Welt.noPermission(p, Permission.BUILD)) {
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier keine Blöcke abbauen");
e.setCancelled(true);
}
@ -75,7 +75,7 @@ public class RegionListener implements Listener {
Player p = e.getPlayer();
try {
if (Welt.noPermission(p, Permission.build)) {
if (Welt.noPermission(p, Permission.BUILD)) {
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier keine Blöcke platzieren");
e.setBuildable(false);
}
@ -90,7 +90,7 @@ public class RegionListener implements Listener {
Player p = e.getPlayer();
try {
if (Welt.noPermission(p, Permission.build)) {
if (Welt.noPermission(p, Permission.BUILD)) {
p.sendMessage(BauSystem.PREFIX + "§cDu darfst hier keine Blöcke platzieren");
e.setCancelled(true);
}

Datei anzeigen

@ -37,7 +37,7 @@ public class TNTSimulatorListener implements Listener {
private static final Vector HALF = new Vector(0.5, 0, 0.5);
private boolean permissionCheck(Player player) {
if (Welt.noPermission(player, Permission.world)) {
if (Welt.noPermission(player, Permission.WORLD)) {
player.sendMessage(BauSystem.PREFIX + "§cDu darfst hier nicht den Simulator nutzen");
return false;
}

Datei anzeigen

@ -40,13 +40,13 @@ public class Welt {
return true;
switch (perm) {
case build:
case BUILD:
return !member1.isBuild();
case worldedit:
return !member1.isWorldEdit();
case world:
case WORLD:
return !member1.isWorld();
case member:
case MEMBER:
return false;
default:
return true;