SteamWar/BauSystem
Archiviert
13
0

Add CommandBuildMode

Dieser Commit ist enthalten in:
jojo 2021-01-20 11:25:34 +01:00
Ursprung a22e1d37b9
Commit 0be031f5fe
5 geänderte Dateien mit 3 neuen und 24 gelöschten Zeilen

Datei anzeigen

@ -81,8 +81,8 @@ public class BauSystem extends JavaPlugin implements Listener {
getCommand("nightvision").setExecutor(new CommandNV()); getCommand("nightvision").setExecutor(new CommandNV());
getCommand("reset").setExecutor(new CommandReset()); getCommand("reset").setExecutor(new CommandReset());
getCommand("speed").setExecutor(new CommandSpeed()); getCommand("speed").setExecutor(new CommandSpeed());
getCommand("tnt").setExecutor(new CommandTNT());
getCommand("buildmode").setExecutor(new CommandBuildMode()); getCommand("buildmode").setExecutor(new CommandBuildMode());
getCommand("tnt").setExecutor(new CommandTNT());
getCommand("fire").setExecutor(new CommandFire()); getCommand("fire").setExecutor(new CommandFire());
getCommand("freeze").setExecutor(new CommandFreeze()); getCommand("freeze").setExecutor(new CommandFreeze());
getCommand("testblock").setExecutor(new CommandTestblock()); getCommand("testblock").setExecutor(new CommandTestblock());

Datei anzeigen

@ -55,18 +55,6 @@ public class CommandBuildMode extends ToggleCommand {
return "§cBuild mode deaktiviert"; 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 @EventHandler
public void onEntityExplode(EntityExplodeEvent event) { public void onEntityExplode(EntityExplodeEvent event) {
boolean blocksDestroyed = event.blockList().removeIf(block -> { boolean blocksDestroyed = event.blockList().removeIf(block -> {

Datei anzeigen

@ -45,14 +45,6 @@ public class CommandTNT extends ToggleCommand {
return "§aTNT-Schaden aktiviert"; return "§aTNT-Schaden aktiviert";
} }
@Override
public void toggle() {
if (CommandBuildMode.getInstance().isOn()) {
CommandBuildMode.getInstance().toggle();
}
super.toggle();
}
@EventHandler @EventHandler
public void onExplode(EntityExplodeEvent e) { public void onExplode(EntityExplodeEvent e) {
e.blockList().clear(); e.blockList().clear();

Datei anzeigen

@ -108,7 +108,7 @@ public class BauScoreboard implements Listener {
private String tntString() { private String tntString() {
if (!CommandTNT.getInstance().isOn()) { if (!CommandTNT.getInstance().isOn()) {
if (CommandBuildMode.getInstance().isOn()) { if (CommandBuildMode.getInstance().isOn()) {
return "§eTestblock"; return "§7nur §eTestblock";
} }
return "§aan"; return "§aan";
} }

Datei anzeigen

@ -109,8 +109,7 @@ public class Region {
} }
public static class Prototype{ public static class Prototype{
// private static final String SECTION_PATH = "/home/minecraft/backbone/server/UserBau/"; 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 Map<String, Prototype> prototypes = new HashMap<>(); private static final Map<String, Prototype> prototypes = new HashMap<>();
private final int sizeX; private final int sizeX;