New Update V2.0
Aktuellste Version (Achtung die vorschläge von Lixfel sind noch nicht umgesetzt worden)
Dieser Commit ist enthalten in:
Ursprung
d699ebe620
Commit
ca12db1213
@ -1,16 +1,12 @@
|
||||
package de.quantumnanox.warshipfactory.commands;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.sk89q.worldedit.CuboidClipboard;
|
||||
import com.boydti.fawe.util.EditSessionBuilder;
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
@ -29,9 +25,6 @@ import de.pro_crafting.commandframework.CommandArgs;
|
||||
import de.quantumnanox.warshipfactory.content.FactoryWorld;
|
||||
import de.quantumnanox.warshipfactory.content.WorldPlayer;
|
||||
import de.quantumnanox.warshipfactory.main.WarShipFactory;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
@ -44,27 +37,20 @@ public class CommandBau {
|
||||
@Command(name = "bau")
|
||||
public void onBau(CommandArgs args) {
|
||||
CommandSender s = args.getSender();
|
||||
s.sendMessage(WarShipFactory.S_PREFIX + "WarShipFactory by Exceptionflug v" + WarShipFactory.getInstance().getDescription().getVersion());
|
||||
s.sendMessage(WarShipFactory.S_PREFIX + "BauFactory by Exceptionflug updated by Diamant-ix.de Team v" + "1.2");
|
||||
s.sendMessage(WarShipFactory.S_PREFIX + "Um eine Liste mit Befehlen zu erhalten, gib §t/bau help §7ein.");
|
||||
}
|
||||
|
||||
@Command(name = "bau.help", inGameOnly = true)
|
||||
public void onHelp(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "Hilfe:");
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "Hilfe Seite 1 von 2:");
|
||||
p.sendMessage("§8/bau - §6Zeigt dir Infos über das Plugin");
|
||||
p.sendMessage("§8/bau help - §6Zeigt dir diese Liste");
|
||||
p.sendMessage("§8/bau help 2 - §6Zeigt dir die 2 Seite der Hilfe Seite");
|
||||
p.sendMessage("§8/bau home - §6Teleportiert dich auf deine Welt");
|
||||
p.sendMessage("§8/bau addmember - §6Fügt einen Spieler zu deiner Welt hinzu");
|
||||
p.sendMessage("§8/bau delmember - §6Entfernt einen Spieler von deiner Welt");
|
||||
p.sendMessage("§8/bau togglewe - §6Ändert den Zustand für: Darf ein Spieler WorldEdit verwenden?");
|
||||
p.sendMessage("§8/bau togglebuild - §6Ändert den Zustand für: Darf ein Spieler bauen?");
|
||||
p.sendMessage("§8/bau toggletp - §6Ändert den Zustand für: Darf ein Spieler sich teleportieren?");
|
||||
p.sendMessage("§8/bau toggletestblock - §6Ändert den Zustand für : Darf ein Spieler einen TestBlock erneuern");
|
||||
p.sendMessage("§8/bau togglereset - §6Ändert den Zustand für : Darf ein Spieler eine Region erneuern");
|
||||
p.sendMessage("§8/bau toggleresetall - §6Ändert den Zustand für : Darf ein Spieler eine ganze Welt erneuern");
|
||||
p.sendMessage("§8/bau togglereplace - §6Ändert den Zustand für : Darf ein Spieler in einer Region replacen");
|
||||
p.sendMessage("§8/bau togglechgm - §6Ändert den Zustand für: Darf ein Spieler seinen Spielmodus ändern?");
|
||||
p.sendMessage("§8/bau tntdmg - §6Erlaubt / verbietet TNT Explosionen");
|
||||
p.sendMessage("§8/bau testblock - §6Erneuert einen Testblock in der umgebung");
|
||||
p.sendMessage("§8/bau reset - §6Setzt eine region zurück wo man sich befindet");
|
||||
@ -74,7 +60,19 @@ public class CommandBau {
|
||||
p.sendMessage("§8/bau info - §6Zeigt dir Infos über die aktuelle Welt");
|
||||
p.sendMessage("§8/bau gui - §6Öffnet eine GUI");
|
||||
}
|
||||
|
||||
@Command(name = "bau.help.2", inGameOnly = true)
|
||||
public void onHelp2(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "Hilfe Seite 2 von 2:");
|
||||
p.sendMessage("§8/bau togglewe - §6Ändert den Zustand für: Darf ein Spieler WorldEdit verwenden?");
|
||||
p.sendMessage("§8/bau togglebuild - §6Ändert den Zustand für: Darf ein Spieler bauen?");
|
||||
p.sendMessage("§8/bau toggletp - §6Ändert den Zustand für: Darf ein Spieler sich teleportieren?");
|
||||
p.sendMessage("§8/bau toggletestblock - §6Ändert den Zustand für : Darf ein Spieler einen TestBlock erneuern");
|
||||
p.sendMessage("§8/bau togglereset - §6Ändert den Zustand für : Darf ein Spieler eine Region erneuern");
|
||||
p.sendMessage("§8/bau toggleresetall - §6Ändert den Zustand für : Darf ein Spieler eine ganze Welt erneuern");
|
||||
p.sendMessage("§8/bau togglereplace - §6Ändert den Zustand für : Darf ein Spieler in einer Region replacen");
|
||||
p.sendMessage("§8/bau togglechgm - §6Ändert den Zustand für: Darf ein Spieler seinen Spielmodus ändern?");
|
||||
}
|
||||
@Command(name = "bau.home", inGameOnly = true)
|
||||
public void onHome(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -105,7 +103,6 @@ public class CommandBau {
|
||||
}, 20L);
|
||||
|
||||
}
|
||||
|
||||
@Command(name = "bau.addmember", inGameOnly = true)
|
||||
public void onAdd(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -131,8 +128,8 @@ public class CommandBau {
|
||||
wp.canBuild = true;
|
||||
fw.getMembers().register(wp);
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler wurde zu deiner Welt hinzugefügt.");
|
||||
wp.getPlayer().sendMessage(WarShipFactory.S_PREFIX + "§aDu wurdest zu der Welt von §6" + p.getName() + " §ahinzugefügt");
|
||||
}
|
||||
|
||||
@Command(name = "bau.delmember", inGameOnly = true)
|
||||
public void onDel(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -157,6 +154,7 @@ public class CommandBau {
|
||||
fw.getMembers().unregister(fw.getMembers().getID(fw.getMember(id)));
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cDer Spieler wurde entfernt.");
|
||||
Player z = Bukkit.getPlayer(id);
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + ChatColor.RED + "§4Du wurdest von der Welt §6" + p.getName() + ChatColor.RED + " §4entfernt");
|
||||
if (z != null) {
|
||||
if (z.getWorld().getUID().equals(fw.getWrapped().getUID())) {
|
||||
z.teleport(WarShipFactory.getInstance().config.spawn);
|
||||
@ -164,7 +162,6 @@ public class CommandBau {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Command(name = "bau.tp", inGameOnly = true)
|
||||
public void onTp(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -233,7 +230,6 @@ public class CommandBau {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Command(name = "bau.togglewe", inGameOnly = true)
|
||||
public void onToggleWE(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -271,7 +267,6 @@ public class CommandBau {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cDer Spieler darf kein WorldEdit verwenden.");
|
||||
}
|
||||
}
|
||||
|
||||
@Command(name = "bau.toggletp", inGameOnly = true)
|
||||
public void onToggleTP(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -309,7 +304,6 @@ public class CommandBau {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cDer Spieler darf sich nicht teleportieren.");
|
||||
}
|
||||
}
|
||||
|
||||
@Command(name = "bau.togglebuild", inGameOnly = true)
|
||||
public void onToggleBD(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
@ -347,7 +341,6 @@ public class CommandBau {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cDer Spieler darf nicht bauen.");
|
||||
}
|
||||
}
|
||||
|
||||
@Command(name = "bau.togglechgm", inGameOnly = true)
|
||||
public void onToggleCHG(CommandArgs args) {
|
||||
Player p = args.getPlayer();
|
||||
|
@ -1,28 +1,23 @@
|
||||
package de.quantumnanox.warshipfactory.commands;
|
||||
|
||||
import de.pro_crafting.commandframework.CommandArgs;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import de.quantumnanox.warshipfactory.content.FactoryWorld;
|
||||
import de.quantumnanox.warshipfactory.content.UUIDFetcher;
|
||||
import de.quantumnanox.warshipfactory.content.WorldPlayer;
|
||||
import de.quantumnanox.warshipfactory.main.WarShipFactory;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import sun.security.jca.GetInstance;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import javax.tools.JavaFileManager;
|
||||
import java.io.File;
|
||||
|
||||
public class CommandGui implements Listener {
|
||||
|
||||
@ -31,7 +26,7 @@ public class CommandGui implements Listener {
|
||||
if (e.getInventory().getTitle().equals("§bBau Abteilungen")) {
|
||||
if (e.getCurrentItem().getItemMeta() != null) {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName() != null) {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bWarShip §aTestGeländer 1")) {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bWarShip §aTestGelände 1")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
p.performCommand("minecraft:tp -943 122 149");
|
||||
@ -43,7 +38,7 @@ public class CommandGui implements Listener {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
p.performCommand("minecraft:tp -1200 122 149");
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§7Du wurdest zu WarShip TestGelände 1 Teleportiert");
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§7Du wurdest zu WarShip TestGelände 2 Teleportiert");
|
||||
e.getView().close();
|
||||
e.setCancelled(true);
|
||||
}
|
||||
@ -175,6 +170,13 @@ public class CommandGui implements Listener {
|
||||
e.getView().close();
|
||||
e.setCancelled(true);
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bZurück")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
e.getView().close();
|
||||
p.openInventory(mainmenu());
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -197,46 +199,7 @@ public class CommandGui implements Listener {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cAuf deiner Welt ist jetzt TNT Schaden verboten.");
|
||||
}
|
||||
e.getView().close();
|
||||
Player p1 = (Player) e.getWhoClicked();
|
||||
FactoryWorld fw1 = WarShipFactory.getInstance().getWorldFromOwner(p1.getUniqueId());
|
||||
Inventory inv2 = Bukkit.createInventory(null, 18, "§bWelten Optionen");
|
||||
ItemStack tnt = new ItemStack(Material.TNT);
|
||||
ItemMeta meta = tnt.getItemMeta();
|
||||
meta = tnt.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aTNT Schaden");
|
||||
tnt.setItemMeta(meta);
|
||||
inv2.addItem(tnt);
|
||||
ItemStack back = new ItemStack(Material.SLIME_BALL);
|
||||
meta = back.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bZurück");
|
||||
back.setItemMeta(meta);
|
||||
inv2.setItem(4, back);
|
||||
e.setCancelled(true);
|
||||
ItemStack fire = new ItemStack(Material.LAVA_BUCKET);
|
||||
meta = fire.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aFeuer Schaden");
|
||||
fire.setItemMeta(meta);
|
||||
inv2.setItem(8, fire);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
e.setCancelled(true);
|
||||
if (fw1.isTntDamage()) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst1);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
}
|
||||
p.openInventory(weltoption(p));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aFeuer Schaden")) {
|
||||
@ -271,23 +234,7 @@ public class CommandGui implements Listener {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
e.getView().close();
|
||||
Inventory inv = Bukkit.createInventory(null, 9, "§aBau Optionen");
|
||||
ItemStack bau = new ItemStack(Material.COMPASS);
|
||||
ItemMeta meta = bau.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bBau Abteilungen");
|
||||
bau.setItemMeta(meta);
|
||||
inv.addItem(bau);
|
||||
ItemStack optionen = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
meta = optionen.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWelten Optionen");
|
||||
optionen.setItemMeta(meta);
|
||||
inv.setItem(8, optionen);
|
||||
ItemStack spieler = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = spieler.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bSpieler Optionen");
|
||||
spieler.setItemMeta(meta);
|
||||
inv.setItem(4, spieler);
|
||||
p.openInventory(inv);
|
||||
p.openInventory(mainmenu());
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -299,98 +246,7 @@ public class CommandGui implements Listener {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bBau Abteilungen")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
Inventory inv1 = Bukkit.createInventory(null, 36, "§bBau Abteilungen");
|
||||
ItemStack warship1 = new ItemStack(Material.WATER_BUCKET);
|
||||
ItemMeta meta = warship1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarShip §aTestGelände 1");
|
||||
warship1.setItemMeta(meta);
|
||||
inv1.addItem(warship1);
|
||||
ItemStack warship2 = new ItemStack(Material.WATER_BUCKET);
|
||||
meta = warship2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarShip §aTestGelände 2");
|
||||
warship2.setItemMeta(meta);
|
||||
inv1.setItem(1, warship2);
|
||||
ItemStack wargear1 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 5");
|
||||
wargear1.setItemMeta(meta);
|
||||
inv1.setItem(9, wargear1);
|
||||
ItemStack wargear2 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 6");
|
||||
wargear2.setItemMeta(meta);
|
||||
inv1.setItem(10, wargear2);
|
||||
ItemStack wargear3 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear3.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 7");
|
||||
wargear3.setItemMeta(meta);
|
||||
inv1.setItem(11, wargear3);
|
||||
ItemStack wargear4 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear4.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 8");
|
||||
wargear4.setItemMeta(meta);
|
||||
inv1.setItem(12, wargear4);
|
||||
ItemStack miniwargear1 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 1");
|
||||
miniwargear1.setItemMeta(meta);
|
||||
inv1.setItem(18, miniwargear1);
|
||||
ItemStack miniwargear2 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 2");
|
||||
miniwargear2.setItemMeta(meta);
|
||||
inv1.setItem(19, miniwargear2);
|
||||
ItemStack miniwargear3 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear3.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 7");
|
||||
miniwargear3.setItemMeta(meta);
|
||||
inv1.setItem(20, miniwargear3);
|
||||
ItemStack miniwargear4 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear4.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 8");
|
||||
miniwargear4.setItemMeta(meta);
|
||||
inv1.setItem(21, miniwargear4);
|
||||
ItemStack airship1 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 1");
|
||||
airship1.setItemMeta(meta);
|
||||
inv1.setItem(27, airship1);
|
||||
ItemStack airship2 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 2");
|
||||
airship2.setItemMeta(meta);
|
||||
inv1.setItem(28, airship2);
|
||||
ItemStack airship3 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship3.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 3");
|
||||
airship3.setItemMeta(meta);
|
||||
inv1.setItem(29, airship3);
|
||||
ItemStack airship4 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship4.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 4");
|
||||
airship4.setItemMeta(meta);
|
||||
inv1.setItem(30, airship4);
|
||||
ItemStack airship5 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship5.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 5");
|
||||
airship5.setItemMeta(meta);
|
||||
inv1.setItem(31, airship5);
|
||||
ItemStack airship6 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship6.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 6");
|
||||
airship6.setItemMeta(meta);
|
||||
inv1.setItem(32, airship6);
|
||||
ItemStack airship7 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship7.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 7");
|
||||
airship7.setItemMeta(meta);
|
||||
inv1.setItem(33, airship7);
|
||||
ItemStack airship8 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship8.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 8");
|
||||
airship8.setItemMeta(meta);
|
||||
inv1.setItem(34, airship8);
|
||||
p.openInventory(inv1);
|
||||
p.openInventory(bauabteilung());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -401,44 +257,7 @@ public class CommandGui implements Listener {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bWelten Optionen")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(p.getUniqueId());
|
||||
Inventory inv2 = Bukkit.createInventory(null, 18, "§bWelten Optionen");
|
||||
ItemStack tnt = new ItemStack(Material.TNT);
|
||||
ItemMeta meta = tnt.getItemMeta();
|
||||
meta = tnt.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aTNT Schaden");
|
||||
tnt.setItemMeta(meta);
|
||||
inv2.addItem(tnt);
|
||||
ItemStack back = new ItemStack(Material.SLIME_BALL);
|
||||
meta = back.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bZurück");
|
||||
back.setItemMeta(meta);
|
||||
inv2.setItem(4, back);
|
||||
e.setCancelled(true);
|
||||
ItemStack fire = new ItemStack(Material.LAVA_BUCKET);
|
||||
meta = fire.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aFeuer Schaden");
|
||||
fire.setItemMeta(meta);
|
||||
inv2.setItem(8, fire);
|
||||
p.openInventory(inv2);
|
||||
e.setCancelled(true);
|
||||
if (fw.isTntDamage()) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst1);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
}
|
||||
p.openInventory(weltoption(p));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -449,24 +268,11 @@ public class CommandGui implements Listener {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bSpieler Optionen")) {
|
||||
//code
|
||||
Player player = (Player) e.getWhoClicked();
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(player.getUniqueId());
|
||||
Inventory inv = Bukkit.createInventory(null, 54, "§bSpieler Optionen");
|
||||
{
|
||||
e.setCancelled(true);
|
||||
inv.clear();
|
||||
|
||||
int slot = 0;
|
||||
for (Player p : Bukkit.getWorld(player.getWorld().getName()).getPlayers()) {
|
||||
inv.setItem(slot, getSkull(p.getName()));
|
||||
slot++;
|
||||
}
|
||||
player.openInventory(inv);
|
||||
player.openInventory(spieleroption(player));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getInventory().getTitle().equals("§bSpieler Optionen")) {
|
||||
if (e.getCurrentItem().getItemMeta() != null) {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName() != null) {
|
||||
@ -478,10 +284,225 @@ public class CommandGui implements Listener {
|
||||
SkullTeleport(player, e.getCurrentItem());
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bZurück")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
e.getView().close();
|
||||
p.openInventory(mainmenu());
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Player target : e.getWhoClicked().getWorld().getPlayers()) {
|
||||
if (e.getInventory().getTitle().equals(target.getDisplayName())) {
|
||||
if (e.getCurrentItem().getItemMeta() != null) {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName() != null) {
|
||||
Player player = (Player) e.getWhoClicked();
|
||||
ItemStack skull = new ItemStack(Material.SKULL_ITEM);
|
||||
ItemMeta meta = skull.getItemMeta();
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(player.getUniqueId());
|
||||
if (fw == null) {
|
||||
player.sendMessage(WarShipFactory.S_PREFIX + "§cDu hast keine Welt");
|
||||
}
|
||||
WorldPlayer wp = fw.getMember(target.getUniqueId());
|
||||
if (wp == null) {
|
||||
player.sendMessage(WarShipFactory.S_PREFIX + "§cDer Spieler ist kein Mitglied deiner Welt");
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle Worldedit")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
wp.canWorldEdit = !wp.canWorldEdit;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
if (z != null) {
|
||||
if (wp.canWorldEdit) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler darf jetzt auf deiner Welt Worldedit benutzten.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§aDu kannst nun auf der Welt von §6" + p.getName() + "§a WorldEdit verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf jetzt auf deiner Welt kein Worldedit mehr benutzten.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c WorldEdit verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle Teleport")) {
|
||||
//code
|
||||
wp.canTeleport = !wp.canTeleport;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (z != null) {
|
||||
if (wp.canTeleport) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler kann sich jetzt auf deiner Welt Teleportieren.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§aDu kannst nun auf der Welt von §6" + p.getName() + "§a /tp verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf sich jetzt nicht mehr auf deiner Welt Teleportieren.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c /tp verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle Build")) {
|
||||
//code
|
||||
wp.canBuild = !wp.canBuild;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (z != null) {
|
||||
if (wp.canBuild) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler darf jetzt Bauen auf deiner Welt.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§aDu kannst nun auf der Welt von §6" + p.getName() + "§a bauen.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf jetzt nicht mehr Bauen auf deiner Welt.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c bauen.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle ChangeGamemode")) {
|
||||
//code
|
||||
wp.canChangeGamemode = !wp.canChangeGamemode;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (z != null) {
|
||||
if (wp.canChangeGamemode) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler darf jetzt sein Gamemode auf deiner Welt wechseln.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§aDu kannst nun auf der Welt von §6" + p.getName() + "§a deinen Spielmodus ändern.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf jetzt nicht mehr sein Gamemode auf deiner Welt wechseln.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c deinen Spielmodus ändern.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aSpieler entfernen")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
fw.getMembers().unregister(fw.getMembers().getID(fw.getMember(target.getUniqueId())));
|
||||
target.sendMessage(WarShipFactory.S_PREFIX + ChatColor.RED + "§aDu wurdest von der Welt §6" + p.getName() + ChatColor.RED + " §aentfernt");
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
if (z != null) {
|
||||
if (z.getWorld().getUID().equals(fw.getWrapped().getUID())) {
|
||||
z.teleport(WarShipFactory.getInstance().config.spawn);
|
||||
z.getInventory().clear();
|
||||
}
|
||||
}
|
||||
p.openInventory(spieleroption(p));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle Replace")) {
|
||||
//code
|
||||
wp.canReplace = !wp.canReplace;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (z != null) {
|
||||
if (wp.canReplace) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler darf jetzt auf deiner Welt Replacen.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun auf der Welt von §6" + p.getName() + "§c /bau replace verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf jetzt nicht mehr auf deiner Welt Replacen.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c /bau replace verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle Reset")) {
|
||||
//code
|
||||
wp.canReset = !wp.canReset;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (z != null) {
|
||||
if (wp.canReset) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler darf jetzt auf deiner Welt einzelne Regionen erneuern.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun auf der Welt von §6" + p.getName() + "§c /bau reset verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf jetzt nicht mehr auf deiner Welt einzelne Regionen erneuern.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c /bau reset verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§aToggle TestBlock")) {
|
||||
//code
|
||||
wp.canTestBlock = !wp.canTestBlock;
|
||||
Player z = Bukkit.getPlayer(target.getUniqueId());
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (z != null) {
|
||||
if (wp.canTestBlock) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§aDer Spieler darf jetzt auf deiner Welt TestBlöcke erneuern.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun auf der Welt von §6" + p.getName() + "§c /bau testblock verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
} else {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Der Spieler darf jetzt nicht mehr auf deiner Welt TestBlöcke erneuern.");
|
||||
z.sendMessage(WarShipFactory.S_PREFIX + "§cDu kannst nun nicht mehr auf der Welt von §6" + p.getName() + "§c /bau testblock verwenden.");
|
||||
p.closeInventory();
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§eStatus §4An")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Das darfst du nicht");
|
||||
e.getView().close();
|
||||
e.setCancelled(true);
|
||||
player.closeInventory();
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§eStatus §4Aus")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§4Das darfst du nicht");
|
||||
e.getView().close();
|
||||
e.setCancelled(true);
|
||||
player.closeInventory();
|
||||
}
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.RED + "§bZurück")) {
|
||||
//code
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
e.getView().close();
|
||||
e.setCancelled(true);
|
||||
player.closeInventory();
|
||||
player.openInventory(spieleroption(p));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getSkull(String name) {
|
||||
ItemStack skull = new ItemStack(397, 1, (short) 3);
|
||||
@ -492,50 +513,335 @@ public class CommandGui implements Listener {
|
||||
return skull;
|
||||
}
|
||||
|
||||
public void onInventoryClick(InventoryClickEvent event, ItemStack item) {
|
||||
if (event.getInventory().getName().contains("§bSpieler Optionen")) {
|
||||
event.setCancelled(true);
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
SkullMeta skullmeta = (SkullMeta) item.getItemMeta();
|
||||
Player target = Bukkit.getPlayer(skullmeta.getDisplayName());
|
||||
{
|
||||
if (event.getSlotType() == InventoryType.SlotType.CONTAINER) {
|
||||
SkullTeleport(player, event.getCurrentItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SkullTeleport(Player player, ItemStack item) {
|
||||
if (item.getType() != Material.AIR && item != null) {
|
||||
SkullMeta skullmeta = (SkullMeta) item.getItemMeta();
|
||||
if (skullmeta.getDisplayName() != null) {
|
||||
if (Bukkit.getPlayer(skullmeta.getDisplayName()) != null) {
|
||||
Player target = Bukkit.getPlayer(skullmeta.getDisplayName());
|
||||
player.openInventory(skullOwnerInventory(target));
|
||||
}
|
||||
SkullMeta skullmeta = (SkullMeta) item.getItemMeta();
|
||||
if (skullmeta.getDisplayName() != null) {
|
||||
if (Bukkit.getPlayer(skullmeta.getDisplayName()) != null) {
|
||||
Player target = Bukkit.getPlayer(skullmeta.getDisplayName());
|
||||
player.openInventory(skullOwnerInventory(target, player));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Inventory skullOwnerInventory(Player p) {
|
||||
private Inventory skullOwnerInventory(Player p, Player player) {
|
||||
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(p.getUniqueId());
|
||||
Inventory inv2 = Bukkit.createInventory(null, 18, p.getDisplayName());
|
||||
ItemStack skull = new ItemStack(Material.SKULL_ITEM);
|
||||
ItemMeta meta = skull.getItemMeta();
|
||||
meta = skull.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aSpieler entfernen");
|
||||
skull.setItemMeta(meta);
|
||||
inv2.addItem(skull);
|
||||
|
||||
ItemStack togglewe = new ItemStack(Material.WOOD_AXE);
|
||||
meta = togglewe.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle Worldedit");
|
||||
togglewe.setItemMeta(meta);
|
||||
inv2.setItem(1, togglewe);
|
||||
|
||||
ItemStack toggletp = new ItemStack(Material.COMPASS);
|
||||
meta = toggletp.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle Teleport");
|
||||
toggletp.setItemMeta(meta);
|
||||
inv2.setItem(2, toggletp);
|
||||
|
||||
ItemStack togglebuild = new ItemStack(Material.GRASS);
|
||||
meta = togglebuild.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle Build");
|
||||
togglebuild.setItemMeta(meta);
|
||||
inv2.setItem(3, togglebuild);
|
||||
|
||||
ItemStack togglegm = new ItemStack(Material.LADDER);
|
||||
meta = togglegm.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle ChangeGamemode");
|
||||
togglegm.setItemMeta(meta);
|
||||
inv2.setItem(4, togglegm);
|
||||
|
||||
ItemStack togglerep = new ItemStack(Material.BREWING_STAND_ITEM);
|
||||
meta = togglerep.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle Replace");
|
||||
togglerep.setItemMeta(meta);
|
||||
inv2.setItem(5, togglerep);
|
||||
|
||||
ItemStack togglereset = new ItemStack(Material.BARRIER);
|
||||
meta = togglereset.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle Reset");
|
||||
togglereset.setItemMeta(meta);
|
||||
inv2.setItem(6, togglereset);
|
||||
|
||||
ItemStack toggletestblock = new ItemStack(Material.ENDER_STONE);
|
||||
meta = toggletestblock.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle TestBlock");
|
||||
toggletestblock.setItemMeta(meta);
|
||||
inv2.setItem(7, toggletestblock);
|
||||
|
||||
ItemStack back = new ItemStack(Material.SLIME_BALL);
|
||||
meta = back.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bZurück");
|
||||
back.setItemMeta(meta);
|
||||
inv2.setItem(8, back);
|
||||
|
||||
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(player.getUniqueId());
|
||||
if (fw == null) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cDu hast keine Welt");
|
||||
}
|
||||
ItemStack skull = new ItemStack(Material.SKULL_ITEM);
|
||||
ItemMeta meta = skull.getItemMeta();
|
||||
Inventory inv2 = Bukkit.createInventory(null, 18, p.getDisplayName());
|
||||
meta = skull.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aSpieler hinzufügen");
|
||||
skull.setItemMeta(meta);
|
||||
inv2.addItem(skull);
|
||||
ItemStack togglewe = new ItemStack(Material.WOOD_AXE);
|
||||
meta = togglewe.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aToggle Worldedit");
|
||||
togglewe.setItemMeta(meta);
|
||||
inv2.setItem(1, togglewe);
|
||||
WorldPlayer wp = fw.getMember(p.getUniqueId());
|
||||
if (wp == null) {
|
||||
p.sendMessage(WarShipFactory.S_PREFIX + "§cDer Spieler ist kein Mitglied deiner Welt");
|
||||
} else {
|
||||
Player z = Bukkit.getPlayer(p.getUniqueId());
|
||||
if (z != null) {
|
||||
if (wp.canWorldEdit) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(10, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(10, tntst1);
|
||||
}
|
||||
if (wp.canTeleport) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(11, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(11, tntst1);
|
||||
}
|
||||
if (wp.canBuild) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(12, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(12, tntst1);
|
||||
}
|
||||
if (wp.canChangeGamemode) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(13, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(13, tntst1);
|
||||
}
|
||||
if (wp.canReplace) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(14, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(14, tntst1);
|
||||
}
|
||||
if (wp.canReset) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(15, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(15, tntst1);
|
||||
}
|
||||
if (wp.canTestBlock) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(16, tntst);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(16, tntst1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return inv2;
|
||||
}
|
||||
|
||||
private Inventory mainmenu() {
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, 9, "§aBau Optionen");
|
||||
{
|
||||
ItemStack bau = new ItemStack(Material.COMPASS);
|
||||
ItemMeta meta = bau.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bBau Abteilungen");
|
||||
bau.setItemMeta(meta);
|
||||
inv.addItem(bau);
|
||||
ItemStack optionen = new ItemStack(Material.ENCHANTED_BOOK);
|
||||
meta = optionen.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWelten Optionen");
|
||||
optionen.setItemMeta(meta);
|
||||
inv.setItem(8, optionen);
|
||||
ItemStack spieler = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = spieler.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bSpieler Optionen");
|
||||
spieler.setItemMeta(meta);
|
||||
inv.setItem(4, spieler);
|
||||
}
|
||||
return inv;
|
||||
}
|
||||
|
||||
private Inventory spieleroption(Player player) {
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(player.getUniqueId());
|
||||
Inventory inv = Bukkit.createInventory(null, 54, "§bSpieler Optionen");
|
||||
{
|
||||
inv.clear();
|
||||
int slot = 0;
|
||||
for (Player p : Bukkit.getWorld(player.getWorld().getName()).getPlayers()) {
|
||||
inv.setItem(slot, getSkull(p.getName()));
|
||||
slot++;
|
||||
}
|
||||
ItemStack skull1 = new ItemStack(Material.SLIME_BALL);
|
||||
ItemMeta meta1 = skull1.getItemMeta();
|
||||
meta1 = skull1.getItemMeta();
|
||||
meta1.setDisplayName(ChatColor.RED + "§bZurück");
|
||||
skull1.setItemMeta(meta1);
|
||||
inv.setItem(53, skull1);
|
||||
}return inv;
|
||||
}
|
||||
|
||||
private Inventory bauabteilung() {
|
||||
Inventory inv1 = Bukkit.createInventory(null, 54, "§bBau Abteilungen");
|
||||
{
|
||||
ItemStack warship1 = new ItemStack(Material.WATER_BUCKET);
|
||||
ItemMeta meta = warship1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarShip §aTestGelände 1");
|
||||
warship1.setItemMeta(meta);
|
||||
inv1.addItem(warship1);
|
||||
ItemStack warship2 = new ItemStack(Material.WATER_BUCKET);
|
||||
meta = warship2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarShip §aTestGelände 2");
|
||||
warship2.setItemMeta(meta);
|
||||
inv1.setItem(1, warship2);
|
||||
ItemStack wargear1 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 5");
|
||||
wargear1.setItemMeta(meta);
|
||||
inv1.setItem(9, wargear1);
|
||||
ItemStack wargear2 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 6");
|
||||
wargear2.setItemMeta(meta);
|
||||
inv1.setItem(10, wargear2);
|
||||
ItemStack wargear3 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear3.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 7");
|
||||
wargear3.setItemMeta(meta);
|
||||
inv1.setItem(11, wargear3);
|
||||
ItemStack wargear4 = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
meta = wargear4.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bWarGear §aTestGelände 8");
|
||||
wargear4.setItemMeta(meta);
|
||||
inv1.setItem(12, wargear4);
|
||||
ItemStack miniwargear1 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 1");
|
||||
miniwargear1.setItemMeta(meta);
|
||||
inv1.setItem(18, miniwargear1);
|
||||
ItemStack miniwargear2 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 2");
|
||||
miniwargear2.setItemMeta(meta);
|
||||
inv1.setItem(19, miniwargear2);
|
||||
ItemStack miniwargear3 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear3.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 7");
|
||||
miniwargear3.setItemMeta(meta);
|
||||
inv1.setItem(20, miniwargear3);
|
||||
ItemStack miniwargear4 = new ItemStack(Material.REDSTONE);
|
||||
meta = miniwargear4.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bMiniWarGear §aTestGelände 8");
|
||||
miniwargear4.setItemMeta(meta);
|
||||
inv1.setItem(21, miniwargear4);
|
||||
ItemStack airship1 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 1");
|
||||
airship1.setItemMeta(meta);
|
||||
inv1.setItem(27, airship1);
|
||||
ItemStack airship2 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship2.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 2");
|
||||
airship2.setItemMeta(meta);
|
||||
inv1.setItem(28, airship2);
|
||||
ItemStack airship3 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship3.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 3");
|
||||
airship3.setItemMeta(meta);
|
||||
inv1.setItem(29, airship3);
|
||||
ItemStack airship4 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship4.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 4");
|
||||
airship4.setItemMeta(meta);
|
||||
inv1.setItem(30, airship4);
|
||||
ItemStack airship5 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship5.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 5");
|
||||
airship5.setItemMeta(meta);
|
||||
inv1.setItem(31, airship5);
|
||||
ItemStack airship6 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship6.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 6");
|
||||
airship6.setItemMeta(meta);
|
||||
inv1.setItem(32, airship6);
|
||||
ItemStack airship7 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship7.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 7");
|
||||
airship7.setItemMeta(meta);
|
||||
inv1.setItem(33, airship7);
|
||||
ItemStack airship8 = new ItemStack(Material.ELYTRA);
|
||||
meta = airship8.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bAirShip §aTestGelände 8");
|
||||
airship8.setItemMeta(meta);
|
||||
inv1.setItem(34, airship8);
|
||||
ItemStack back = new ItemStack(Material.SLIME_BALL);
|
||||
ItemMeta meta1 = back.getItemMeta();
|
||||
meta1 = back.getItemMeta();
|
||||
meta1.setDisplayName(ChatColor.RED + "§bZurück");
|
||||
back.setItemMeta(meta1);
|
||||
inv1.setItem(53, back);
|
||||
}return inv1;
|
||||
}
|
||||
|
||||
private Inventory weltoption(Player p) {
|
||||
FactoryWorld fw = WarShipFactory.getInstance().getWorldFromOwner(p.getUniqueId());
|
||||
Inventory inv2 = Bukkit.createInventory(null, 18, "§bWelten Optionen");
|
||||
{
|
||||
ItemStack tnt = new ItemStack(Material.TNT);
|
||||
ItemMeta meta = tnt.getItemMeta();
|
||||
meta = tnt.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§aTNT Schaden");
|
||||
tnt.setItemMeta(meta);
|
||||
inv2.addItem(tnt);
|
||||
ItemStack back = new ItemStack(Material.SLIME_BALL);
|
||||
meta = back.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§bZurück");
|
||||
@ -547,23 +853,23 @@ public class CommandGui implements Listener {
|
||||
fire.setItemMeta(meta);
|
||||
inv2.setItem(8, fire);
|
||||
p.openInventory(inv2);
|
||||
if (fw.isTntDamage()){
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst1);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
}
|
||||
return inv2;
|
||||
}
|
||||
if (fw.isTntDamage()) {
|
||||
ItemStack tntst = new ItemStack(351, 1, (short) 10);
|
||||
meta = tntst.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §2An");
|
||||
tntst.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
} else {
|
||||
ItemStack tntst1 = new ItemStack(351, 1, (short) 8);
|
||||
meta = tntst1.getItemMeta();
|
||||
meta.setDisplayName(ChatColor.RED + "§eStatus §4Aus");
|
||||
tntst1.setItemMeta(meta);
|
||||
inv2.setItem(9, tntst1);
|
||||
p.closeInventory();
|
||||
p.openInventory(inv2);
|
||||
}
|
||||
}return inv2;
|
||||
}
|
||||
}
|
@ -6,7 +6,6 @@ import java.io.IOException;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.configuration.MemorySection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -18,7 +17,6 @@ public class Config {
|
||||
public String backupDir;
|
||||
public String regionDir;
|
||||
public Location spawn;
|
||||
public Location wargear1mini;
|
||||
public Location pasteloc;
|
||||
|
||||
public Config() {
|
||||
@ -36,9 +34,6 @@ public class Config {
|
||||
cfg.addDefault("Coords.loc.x", 0);
|
||||
cfg.addDefault("Coords.loc.y", 0);
|
||||
cfg.addDefault("Coords.loc.z", 0);
|
||||
cfg.addDefault("Coords.wargear1mini.loc.x", -943);
|
||||
cfg.addDefault("Coords.wargear1mini.loc.y", 122);
|
||||
cfg.addDefault("Coords.wargear1mini.loc.z", 149);
|
||||
cfg.addDefault("Lobby.name", "Lobby_1");
|
||||
try {
|
||||
this.cfg.save(this.file);
|
||||
@ -49,7 +44,6 @@ public class Config {
|
||||
regionDir = cfg.getString("RegionSource.dir");
|
||||
spawn = toLocation(cfg.getString("Location.spawn"));
|
||||
pasteloc = new Location(null, cfg.getDouble("Coords.loc.x"), cfg.getDouble("Coords.loc.y"), cfg.getDouble("Coords.loc.z"));
|
||||
wargear1mini = new Location(pasteloc.getWorld(), cfg.getDouble("Coords.wargear1mini.loc.x"), cfg.getDouble("Coords.wargear1mini.loc.y"), cfg.getDouble("Coords.wargear1mini.loc.z"));
|
||||
}
|
||||
|
||||
public Location toLocation(String configString) {
|
||||
|
@ -15,9 +15,7 @@ import org.apache.commons.io.FileUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -28,7 +26,6 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
|
||||
@ -44,7 +41,6 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class WarShipFactory extends JavaPlugin implements Listener {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: WarShipFactory
|
||||
author: Exceptionflug
|
||||
version: 1.1
|
||||
depend: [Brew, WorldEdit, WorldGuard]
|
||||
depend: [Brew, WorldEdit, WorldGuard, CoreSystem]
|
||||
|
||||
main: de.quantumnanox.warshipfactory.main.WarShipFactory
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren