SteamWar/BauSystem
Archiviert
13
0

Update pr stuff

Dieser Commit ist enthalten in:
yoyosource 2021-03-07 10:25:05 +01:00
Ursprung 417f4d3965
Commit 801211c57d
3 geänderte Dateien mit 14 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -19,7 +19,6 @@
package de.steamwar.bausystem; package de.steamwar.bausystem;
import de.steamwar.bausystem.world.TNTSimulatorListener;
import de.steamwar.bausystem.commands.*; 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;

Datei anzeigen

@ -45,18 +45,6 @@ public class CommandGUI implements CommandExecutor, Listener {
Bukkit.getScheduler().runTaskTimerAsynchronously(BauSystem.getPlugin(), LAST_F_PLAYER::clear, 0, 20); Bukkit.getScheduler().runTaskTimerAsynchronously(BauSystem.getPlugin(), LAST_F_PLAYER::clear, 0, 20);
} }
private static ItemStack wand(Player player, ItemStack base, String command, Permission permission, String noPermissionMessage) {
base = base.clone();
ItemMeta meta = base.getItemMeta();
List<String> lore = meta.getLore();
lore.add(command);
if (Welt.noPermission(player, permission))
lore.add(noPermissionMessage);
meta.setLore(lore);
base.setItemMeta(meta);
return base;
}
public static void openBauGui(Player player) { public static void openBauGui(Player player) {
Region region = Region.getRegion(player.getLocation()); Region region = Region.getRegion(player.getLocation());
SWInventory inv = new SWInventory(player, 5 * 9, SteamwarUser.get(BauSystem.getOwner()).getUserName() + "s Bau"); SWInventory inv = new SWInventory(player, 5 * 9, SteamwarUser.get(BauSystem.getOwner()).getUserName() + "s Bau");
@ -578,6 +566,18 @@ public class CommandGUI implements CommandExecutor, Listener {
return null; return null;
} }
private static ItemStack wand(Player player, ItemStack base, String command, Permission permission, String noPermissionMessage) {
base = base.clone();
ItemMeta meta = base.getItemMeta();
List<String> lore = meta.getLore();
lore.add(command);
if (Welt.noPermission(player, permission))
lore.add(noPermissionMessage);
meta.setLore(lore);
base.setItemMeta(meta);
return base;
}
@Override @Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (!(commandSender instanceof Player)) if (!(commandSender instanceof Player))

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bausystem.commands;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.PlayerUtils;
import de.steamwar.bausystem.world.TNTSimulator; import de.steamwar.bausystem.world.TNTSimulator;
import de.steamwar.bausystem.world.Welt; import de.steamwar.bausystem.world.Welt;
import org.bukkit.Material; import org.bukkit.Material;
@ -59,12 +60,7 @@ public class CommandSimulator implements CommandExecutor {
if (args.length == 1) { if (args.length == 1) {
switch (args[0].toLowerCase()) { switch (args[0].toLowerCase()) {
case "wand": case "wand":
if (player.getInventory().getItemInMainHand().getType() == Material.AIR) { PlayerUtils.giveItemToPlayer(player, TNTSimulator.WAND);
player.getInventory().setItemInMainHand(TNTSimulator.WAND);
} else {
player.getInventory().addItem(TNTSimulator.WAND);
}
player.updateInventory();
break; break;
case "start": case "start":
TNTSimulator.get(player).start(); TNTSimulator.get(player).start();