From 0be031f5fed5dab3ed0aaf09d096574fe0c904ef Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 20 Jan 2021 11:25:34 +0100 Subject: [PATCH] Add CommandBuildMode --- .../src/de/steamwar/bausystem/BauSystem.java | 2 +- .../bausystem/commands/CommandBuildMode.java | 12 ------------ .../de/steamwar/bausystem/commands/CommandTNT.java | 8 -------- .../de/steamwar/bausystem/world/BauScoreboard.java | 2 +- .../src/de/steamwar/bausystem/world/Region.java | 3 +-- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 2563e1b..6f8ef7c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -81,8 +81,8 @@ public class BauSystem extends JavaPlugin implements Listener { getCommand("nightvision").setExecutor(new CommandNV()); getCommand("reset").setExecutor(new CommandReset()); getCommand("speed").setExecutor(new CommandSpeed()); - getCommand("tnt").setExecutor(new CommandTNT()); getCommand("buildmode").setExecutor(new CommandBuildMode()); + getCommand("tnt").setExecutor(new CommandTNT()); getCommand("fire").setExecutor(new CommandFire()); getCommand("freeze").setExecutor(new CommandFreeze()); getCommand("testblock").setExecutor(new CommandTestblock()); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBuildMode.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBuildMode.java index d65fe6b..51a3454 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBuildMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBuildMode.java @@ -55,18 +55,6 @@ public class CommandBuildMode extends ToggleCommand { return "§cBuild mode deaktiviert"; } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if(!(sender instanceof Player)) - return false; - Player player = (Player) sender; - if (!CommandTNT.getInstance().isOn()) { - player.sendMessage(BauSystem.PREFIX + "§cUm den Build mode zu nutzen muss TNT an sein."); - return false; - } - return super.onCommand(sender, command, label, args); - } - @EventHandler public void onEntityExplode(EntityExplodeEvent event) { boolean blocksDestroyed = event.blockList().removeIf(block -> { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java index de342b1..7298c9b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandTNT.java @@ -45,14 +45,6 @@ public class CommandTNT extends ToggleCommand { return "§aTNT-Schaden aktiviert"; } - @Override - public void toggle() { - if (CommandBuildMode.getInstance().isOn()) { - CommandBuildMode.getInstance().toggle(); - } - super.toggle(); - } - @EventHandler public void onExplode(EntityExplodeEvent e) { e.blockList().clear(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/BauScoreboard.java b/BauSystem_Main/src/de/steamwar/bausystem/world/BauScoreboard.java index e1b775f..5a696e8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/BauScoreboard.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/BauScoreboard.java @@ -108,7 +108,7 @@ public class BauScoreboard implements Listener { private String tntString() { if (!CommandTNT.getInstance().isOn()) { if (CommandBuildMode.getInstance().isOn()) { - return "§eTestblock"; + return "§7nur §eTestblock"; } return "§aan"; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java index b1f4ed4..f1949b1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/Region.java @@ -109,8 +109,7 @@ public class Region { } public static class Prototype{ - // private static final String SECTION_PATH = "/home/minecraft/backbone/server/UserBau/"; - private static final String SECTION_PATH = "/home/yoyonow/Dev1.15//UserBau/f75632be-e3ec-4069-9bec-d13ac6891177/"; + private static final String SECTION_PATH = "/home/minecraft/backbone/server/UserBau/"; private static final Map prototypes = new HashMap<>(); private final int sizeX;