RedstoneTester #202
@ -23,6 +23,7 @@ import de.steamwar.bausystem.commands.*;
|
|||||||
import de.steamwar.bausystem.world.*;
|
import de.steamwar.bausystem.world.*;
|
||||||
import de.steamwar.core.CommandRemover;
|
import de.steamwar.core.CommandRemover;
|
||||||
import de.steamwar.core.Core;
|
import de.steamwar.core.Core;
|
||||||
|
import de.steamwar.core.VersionedRunnable;
|
||||||
import de.steamwar.scoreboard.SWScoreboard;
|
import de.steamwar.scoreboard.SWScoreboard;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -99,9 +100,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
getCommand("script").setExecutor(new CommandScript());
|
getCommand("script").setExecutor(new CommandScript());
|
||||||
getCommand("simulator").setExecutor(new CommandSimulator());
|
getCommand("simulator").setExecutor(new CommandSimulator());
|
||||||
getCommand("simulator").setTabCompleter(new CommandSimulatorTabCompleter());
|
getCommand("simulator").setTabCompleter(new CommandSimulatorTabCompleter());
|
||||||
if (Core.getVersion() >= 15) {
|
|
||||||
getCommand("redstonetester").setExecutor(new CommandRedstoneTester());
|
getCommand("redstonetester").setExecutor(new CommandRedstoneTester());
|
||||||
}
|
|
||||||
getCommand("gui").setExecutor(new CommandGUI());
|
getCommand("gui").setExecutor(new CommandGUI());
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, this);
|
Bukkit.getPluginManager().registerEvents(this, this);
|
||||||
@ -112,9 +111,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
Bukkit.getPluginManager().registerEvents(new TNTSimulatorListener(), this);
|
Bukkit.getPluginManager().registerEvents(new TNTSimulatorListener(), this);
|
||||||
Bukkit.getPluginManager().registerEvents(new CommandGUI(), this);
|
Bukkit.getPluginManager().registerEvents(new CommandGUI(), this);
|
||||||
Bukkit.getPluginManager().registerEvents(new DetonatorListener(), this);
|
Bukkit.getPluginManager().registerEvents(new DetonatorListener(), this);
|
||||||
if (Core.getVersion() >= 15) {
|
VersionedRunnable.call(new VersionedRunnable(() -> Bukkit.getPluginManager().registerEvents(new RedstoneListener(), this), 15));
|
||||||
Bukkit.getPluginManager().registerEvents(new RedstoneListener(), this);
|
|
||||||
}
|
|
||||||
new AFKStopper();
|
new AFKStopper();
|
||||||
|
|
||||||
autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 1200);
|
autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 1200);
|
||||||
|
@ -81,11 +81,7 @@ public class CommandGUI implements CommandExecutor, Listener {
|
|||||||
if (Welt.noPermission(player, Permission.build))
|
if (Welt.noPermission(player, Permission.build))
|
||||||
return;
|
return;
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
if (Core.getVersion() >= 15) {
|
|
||||||
player.performCommand("redstonetester");
|
player.performCommand("redstonetester");
|
||||||
} else {
|
|
||||||
player.sendMessage(BauSystem.PREFIX + "Der RedstoneTester ist nicht in der 1.12 verfügbar");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
inv.setItem(40, getMaterial("WOODEN_AXE", "WOOD_AXE"), "§eWorldedit Axt", getNoPermsLore(Arrays.asList("§8//§7wand"), player, "§cDu hast keine Worldeditrechte", Permission.worldedit), false, clickType -> {
|
inv.setItem(40, getMaterial("WOODEN_AXE", "WOOD_AXE"), "§eWorldedit Axt", getNoPermsLore(Arrays.asList("§8//§7wand"), player, "§cDu hast keine Worldeditrechte", Permission.worldedit), false, clickType -> {
|
||||||
|
@ -24,6 +24,7 @@ import de.steamwar.bausystem.Permission;
|
|||||||
import de.steamwar.bausystem.SWUtils;
|
import de.steamwar.bausystem.SWUtils;
|
||||||
import de.steamwar.bausystem.world.RedstoneListener;
|
import de.steamwar.bausystem.world.RedstoneListener;
|
||||||
import de.steamwar.bausystem.world.Welt;
|
import de.steamwar.bausystem.world.Welt;
|
||||||
|
import de.steamwar.core.Core;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -44,6 +45,10 @@ public class CommandRedstoneTester implements CommandExecutor {
|
|||||||
if (!(commandSender instanceof Player))
|
if (!(commandSender instanceof Player))
|
||||||
return false;
|
return false;
|
||||||
Player player = (Player) commandSender;
|
Player player = (Player) commandSender;
|
||||||
|
if (Core.getVersion() >= 15) {
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Der RedstoneTester ist nicht in der 1.12 verfügbar");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!permissionCheck(player)) {
|
if (!permissionCheck(player)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -100,7 +100,7 @@ public class RedstoneListener implements Listener {
|
|||||||
private boolean validBlock(Player player, BlockData block) {
|
private boolean validBlock(Player player, BlockData block) {
|
||||||
YoyoNow markierte diese Unterhaltung als gelöst
|
|||||||
if (block instanceof Powerable) return true;
|
if (block instanceof Powerable) return true;
|
||||||
if (block instanceof Piston) return true;
|
if (block instanceof Piston) return true;
|
||||||
player.sendMessage(BauSystem.PREFIX + "Unbekannte Position");
|
player.sendMessage(BauSystem.PREFIX + "§cUnbekannte Position");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Der sollte schon irgendeine Permission haben e.g. Build
Warum sollte man hierfür irgendeine Berechtigung haben brauchen?