Refactor + Massive Feature decrease
Dieser Commit ist enthalten in:
Ursprung
0f9553f284
Commit
c63e5bbb38
@ -1,13 +1,11 @@
|
||||
package de.warking.lobby;
|
||||
package de.steamwar.lobby;
|
||||
|
||||
import de.warking.lobby.command.buildCommand;
|
||||
import de.warking.lobby.command.checkCommand;
|
||||
import de.warking.lobby.command.setLocation;
|
||||
import de.warking.lobby.gadgets.GadgetManager;
|
||||
import de.warking.lobby.listener.*;
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
import de.warking.lobby.manager.LocationManager;
|
||||
import de.steamwar.lobby.command.buildCommand;
|
||||
import de.steamwar.lobby.gadgets.GadgetManager;
|
||||
import de.steamwar.lobby.listener.*;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import de.steamwar.lobby.manager.FileManager;
|
||||
import de.steamwar.lobby.manager.LocationManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -31,12 +29,10 @@ public class LobbySystem extends JavaPlugin {
|
||||
public void onEnable() {
|
||||
|
||||
locationManager = new LocationManager();
|
||||
fileManager = new de.warking.lobby.manager.FileManager(instance);
|
||||
fileManager = new FileManager(instance);
|
||||
loadBackend();
|
||||
prefix = backendManager.prefix;
|
||||
|
||||
this.getCommand("setlocation").setExecutor(new setLocation());
|
||||
this.getCommand("check").setExecutor(new checkCommand());
|
||||
|
||||
this.getCommand("build").setExecutor(new buildCommand());
|
||||
|
||||
init();
|
@ -1,9 +1,8 @@
|
||||
package de.warking.lobby.command;
|
||||
package de.steamwar.lobby.command;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.inventorys.LobbyInventorys;
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.inventorys.LobbyInventorys;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -34,7 +33,7 @@ public class buildCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
} else
|
||||
player.sendMessage(LobbySystem.prefix + "§cDu darfst das nicht!");
|
||||
player.sendMessage(LobbySystem.prefix + "<EFBFBD>cDu darfst das nicht!");
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package de.warking.lobby.gadgets;
|
||||
package de.steamwar.lobby.gadgets;
|
||||
|
||||
public enum Gadget {
|
||||
|
@ -1,16 +1,14 @@
|
||||
package de.warking.lobby.gadgets;
|
||||
package de.steamwar.lobby.gadgets;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class GadgetManager {
|
||||
|
||||
public HashMap<Player, Gadget> playerGadgets = new HashMap<>();
|
||||
public HashMap<Player, Gadget> playerGadgetCooldown = new HashMap<>();
|
||||
|
||||
public GadgetManager() {
|
||||
}
|
||||
public Map<Player, Gadget> playerGadgets = new HashMap<>();
|
||||
public Map<Player, Gadget> playerGadgetCooldown = new HashMap<>();
|
||||
|
||||
public Gadget getPlayerGadget(Player player) {
|
||||
return playerGadgets.get(player);
|
||||
@ -25,10 +23,7 @@ public class GadgetManager {
|
||||
}
|
||||
|
||||
public boolean hasPlayerGadget(Player player) {
|
||||
if(playerGadgets.containsKey(player)) {
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
return playerGadgets.containsKey(player);
|
||||
}
|
||||
|
||||
public void setPlayerGadgetCooldown(Player player, Gadget gadget) {
|
||||
@ -40,10 +35,7 @@ public class GadgetManager {
|
||||
}
|
||||
|
||||
public boolean hasPlayerGadgetCooldown(Player player) {
|
||||
if(playerGadgetCooldown.containsKey(player)) {
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
return playerGadgetCooldown.containsKey(player);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package de.warking.lobby.inventorys;
|
||||
package de.steamwar.lobby.inventorys;
|
||||
|
||||
import de.warking.lobby.utils.ItemBuilder;
|
||||
import de.steamwar.lobby.utils.ItemBuilder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@ -9,16 +9,16 @@ public class ExtrasInventorys {
|
||||
|
||||
public static Inventory getGadgets() {
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§8» §aGadgets §8«");
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§aGadgets");
|
||||
|
||||
for(int i = 0; i < inv.getSize(); i++) {
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
|
||||
}
|
||||
|
||||
inv.setItem(0, new ItemBuilder(Material.ENDER_PEARL).setDisplayName("§dEnder Perle").removeAllAtributs().build());
|
||||
inv.setItem(1, new ItemBuilder(Material.ELYTRA).setDisplayName("§cJetpack").removeAllAtributs().build());
|
||||
inv.setItem(2, new ItemBuilder(Material.FISHING_ROD).setDisplayName("§eGreifhaken").removeAllAtributs().build());
|
||||
//inv.setItem(3, new ItemBuilder(Material.getMaterial(417)).setDisplayName("§cTNT Kanone").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
inv.setItem(0, new ItemBuilder(Material.ENDER_PEARL).setDisplayName("§dEnder Perle").removeAllAtributs().build());
|
||||
inv.setItem(1, new ItemBuilder(Material.ELYTRA).setDisplayName("§cJetpack").removeAllAtributs().build());
|
||||
inv.setItem(2, new ItemBuilder(Material.FISHING_ROD).setDisplayName("§eGreifhaken").removeAllAtributs().build());
|
||||
//inv.setItem(3, new ItemBuilder(Material.getMaterial(417)).setDisplayName("<EFBFBD>cTNT Kanone").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
|
||||
return inv;
|
||||
}
|
||||
@ -26,17 +26,17 @@ public class ExtrasInventorys {
|
||||
|
||||
public static Inventory getArmorInventory() {
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§8» §9Rüstung §8«");
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§8Rüstung");
|
||||
|
||||
for(int i = 0; i < inv.getSize(); i++) {
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
|
||||
}
|
||||
|
||||
inv.setItem(0, new ItemBuilder(Material.WOOD_HOE).setDisplayName("§0LEDER").removeAllAtributs().build());
|
||||
inv.setItem(2, new ItemBuilder(Material.STONE_SPADE).setDisplayName("§8KETTE").removeAllAtributs().build());
|
||||
inv.setItem(4, new ItemBuilder(Material.IRON_PICKAXE).setDisplayName("§7IRON").removeAllAtributs().build());
|
||||
inv.setItem(6, new ItemBuilder(Material.GOLD_AXE).setDisplayName("§eGOLD").removeAllAtributs().build());
|
||||
inv.setItem(8, new ItemBuilder(Material.DIAMOND_SWORD).setDisplayName("§bDIAMANT").removeAllAtributs().build());
|
||||
inv.setItem(0, new ItemBuilder(Material.WOOD_HOE).setDisplayName("§0LEDER").removeAllAtributs().build());
|
||||
inv.setItem(2, new ItemBuilder(Material.STONE_SPADE).setDisplayName("§8KETTE").removeAllAtributs().build());
|
||||
inv.setItem(4, new ItemBuilder(Material.IRON_PICKAXE).setDisplayName("§7IRON").removeAllAtributs().build());
|
||||
inv.setItem(6, new ItemBuilder(Material.GOLD_AXE).setDisplayName("§eGOLD").removeAllAtributs().build());
|
||||
inv.setItem(8, new ItemBuilder(Material.DIAMOND_SWORD).setDisplayName("§bDIAMANT").removeAllAtributs().build());
|
||||
|
||||
|
||||
inv.setItem(9, new ItemBuilder(Material.LEATHER_HELMET).setDisplayName(" ").removeAllAtributs().build());
|
||||
@ -70,7 +70,7 @@ public class ExtrasInventorys {
|
||||
|
||||
public static Inventory getPartikel() {
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§8» §dPartikel §8«");
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§dPartikel");
|
||||
|
||||
for(int i = 0; i < inv.getSize(); i++) {
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
|
||||
@ -84,7 +84,7 @@ public class ExtrasInventorys {
|
||||
|
||||
public static Inventory getPets() {
|
||||
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "§8» §ePets §8«");
|
||||
Inventory inv = Bukkit.createInventory(null, 45, "<EFBFBD>8<EFBFBD> <20>ePets <20>8<EFBFBD>");
|
||||
|
||||
for(int i = 0; i < inv.getSize(); i++) {
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
|
@ -1,12 +1,10 @@
|
||||
package de.warking.lobby.inventorys;
|
||||
package de.steamwar.lobby.inventorys;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
import de.warking.lobby.utils.ItemBuilder;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.manager.FileManager;
|
||||
import de.steamwar.lobby.utils.ItemBuilder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
@ -22,48 +20,48 @@ public class LobbyInventorys {
|
||||
|
||||
FileManager fm = LobbySystem.getInstance().getFileManager();
|
||||
|
||||
inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Navigator.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Navigator.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§")).removeAllAtributs().build());
|
||||
inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Extras.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Extras.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§")).removeAllAtributs().build());
|
||||
//inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Lobby-Switcher.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Lobby-Switcher.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Lobby-Switcher.Display").replaceAll("&", "§")).removeAllAtributs().build());
|
||||
inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Hider.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Hider.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Hider.Display").replaceAll("&", "§")).removeAllAtributs().build());
|
||||
//inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Navigator.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Navigator.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "<EFBFBD>")).removeAllAtributs().build());
|
||||
//inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Extras.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Extras.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§")).removeAllAtributs().build());
|
||||
//inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Lobby-Switcher.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Lobby-Switcher.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Lobby-Switcher.Display").replaceAll("&", "<EFBFBD>")).removeAllAtributs().build());
|
||||
//inv.setItem(fm.getIntegerFromConfig("Items.Lobby.Hider.Slot")-1, new ItemBuilder(Material.valueOf(fm.getStringFromConfig("Items.Lobby.Hider.ID"))).setDisplayName(fm.getStringFromConfig("Items.Lobby.Hider.Display").replaceAll("&", "§")).removeAllAtributs().build());
|
||||
}
|
||||
|
||||
|
||||
public static Inventory getNavigatorInventory() {
|
||||
String name = LobbySystem.getInstance().getFileManager().getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§").split(" ")[0];
|
||||
String name = LobbySystem.getInstance().getFileManager().getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "<EFBFBD>").split(" ")[0];
|
||||
Inventory inv = Bukkit.createInventory(null, 45, name);
|
||||
|
||||
for(int i = 0; i < inv.getSize(); i++) {
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
|
||||
}
|
||||
|
||||
inv.setItem(22, new ItemBuilder(Material.MAGMA_CREAM).setDisplayName("§8» §6Spawn §8«").removeAllAtributs().build());
|
||||
//inv.setItem(2, new ItemBuilder(Material.ELYTRA).setDisplayName("§8» §3AirShip §8«").removeAllAtributs().build());
|
||||
//inv.setItem(6, new ItemBuilder(Material.CHEST).setDisplayName("§8» §aMiniGames §8«").removeAllAtributs().build());
|
||||
//inv.setItem(19, new ItemBuilder(Material.TNT).setDisplayName("§8» §9WarGear §8«").removeAllAtributs().build());
|
||||
//inv.setItem(25, new ItemBuilder(Material.WOOD_SWORD).setDisplayName("§8» §2Survival §8«").removeAllAtributs().build());
|
||||
//inv.setItem(38, new ItemBuilder(Material.EXPLOSIVE_MINECART).setDisplayName("§8» §bMini WarGear §8«").removeAllAtributs().build());
|
||||
//inv.setItem(40, new ItemBuilder(Material.GOLD_NUGGET).setDisplayName("§8» §eTägliche Belohnung §8«").removeAllAtributs().build());
|
||||
//inv.setItem(42, new ItemBuilder(Material.BOWL).setDisplayName("§8» §dBattleBox §8«").removeAllAtributs().build());
|
||||
//inv.setItem(22, new ItemBuilder(Material.MAGMA_CREAM).setDisplayName("<EFBFBD>8<EFBFBD> <20>6Spawn <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(2, new ItemBuilder(Material.ELYTRA).setDisplayName("<EFBFBD>8<EFBFBD> <20>3AirShip <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(6, new ItemBuilder(Material.CHEST).setDisplayName("<EFBFBD>8<EFBFBD> <20>aMiniGames <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(19, new ItemBuilder(Material.TNT).setDisplayName("<EFBFBD>8<EFBFBD> <20>9WarGear <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(25, new ItemBuilder(Material.WOOD_SWORD).setDisplayName("<EFBFBD>8<EFBFBD> <20>2Survival <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(38, new ItemBuilder(Material.EXPLOSIVE_MINECART).setDisplayName("<EFBFBD>8<EFBFBD> <20>bMini WarGear <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(40, new ItemBuilder(Material.GOLD_NUGGET).setDisplayName("<EFBFBD>8<EFBFBD> <20>eT<65>gliche Belohnung <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//inv.setItem(42, new ItemBuilder(Material.BOWL).setDisplayName("<EFBFBD>8<EFBFBD> <20>dBattleBox <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
return inv;
|
||||
}
|
||||
|
||||
|
||||
public static Inventory ExtrasInventory() {
|
||||
String name = LobbySystem.getInstance().getFileManager().getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§").split(" ")[0];
|
||||
String name = LobbySystem.getInstance().getFileManager().getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "<EFBFBD>").split(" ")[0];
|
||||
Inventory inv = Bukkit.createInventory(null, 45, name);
|
||||
|
||||
for(int i = 0; i < inv.getSize(); i++) {
|
||||
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
|
||||
}
|
||||
|
||||
inv.setItem(0, new ItemBuilder(Material.IRON_CHESTPLATE).setDisplayName("§8» §9Rüstung §8«").removeAllAtributs().build());
|
||||
inv.setItem(0, new ItemBuilder(Material.IRON_CHESTPLATE).setDisplayName("§9Rüstung").removeAllAtributs().build());
|
||||
|
||||
inv.setItem(9, new ItemBuilder(Material.PISTON_BASE).setDisplayName("§8» §aGadgets §8«").build());
|
||||
inv.setItem(9, new ItemBuilder(Material.PISTON_BASE).setDisplayName("§aGadgets").build());
|
||||
|
||||
inv.setItem(18, new ItemBuilder(Material.NETHER_STAR).setDisplayName("§8» §dPartikel §8«").build());
|
||||
inv.setItem(18, new ItemBuilder(Material.NETHER_STAR).setDisplayName("§dPartikel").build());
|
||||
|
||||
inv.setItem(27, new ItemBuilder(Material.BONE).setDisplayName("§8» §ePets §8«").build());
|
||||
inv.setItem(27, new ItemBuilder(Material.BONE).setDisplayName("§ePets").build());
|
||||
|
||||
return inv;
|
||||
|
||||
@ -71,18 +69,18 @@ public class LobbyInventorys {
|
||||
|
||||
|
||||
public static Inventory PlayerHideInventory(Player player) {
|
||||
String name = "§9Spieler Verstecken";
|
||||
String name = "§9Spieler Verstecken";
|
||||
Inventory inv = Bukkit.createInventory(null, InventoryType.BREWING, name);
|
||||
inv.setItem(0, new ItemBuilder(Material.INK_SACK, (short)10).setDisplayName("§8» §aAlle Spieler §8«").removeAllAtributs().build());
|
||||
inv.setItem(1, new ItemBuilder(Material.INK_SACK, (short)5).setDisplayName("§8» §5YouTuber/ Teammitglieder §8«").removeAllAtributs().build());
|
||||
inv.setItem(2, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§8» §7Keine Spieler §8«").removeAllAtributs().build());
|
||||
inv.setItem(0, new ItemBuilder(Material.INK_SACK, (short)10).setDisplayName("§aAlle Spieler").removeAllAtributs().build());
|
||||
inv.setItem(1, new ItemBuilder(Material.INK_SACK, (short)5).setDisplayName("§5YouTuber/ Teammitglieder").removeAllAtributs().build());
|
||||
inv.setItem(2, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§7Keine Spieler").removeAllAtributs().build());
|
||||
|
||||
//if(BackendManager.hideAll.contains(player)) inv.setItem(3, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§8» §7Keine Spieler §8«").removeAllAtributs().build());
|
||||
//if(BackendManager.hideUsers.contains(player)) inv.setItem(3, new ItemBuilder(Material.INK_SACK, (short)5).setDisplayName("§7Aktuell §8» §5YouTuber/ Teammitglieder §8«").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
//if(!(BackendManager.hideAll.contains(player) && BackendManager.hideUsers.contains(player))) inv.setItem(3, new ItemBuilder(Material.INK_SACK, (short)10).setDisplayName("§7Aktuell §8» §aAlle Spieler").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
//if(BackendManager.hideAll.contains(player)) inv.setItem(3, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("<EFBFBD>8<EFBFBD> <20>7Keine Spieler <20>8<EFBFBD>").removeAllAtributs().build());
|
||||
//if(BackendManager.hideUsers.contains(player)) inv.setItem(3, new ItemBuilder(Material.INK_SACK, (short)5).setDisplayName("<EFBFBD>7Aktuell <20>8<EFBFBD> <20>5YouTuber/ Teammitglieder <20>8<EFBFBD>").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
//if(!(BackendManager.hideAll.contains(player) && BackendManager.hideUsers.contains(player))) inv.setItem(3, new ItemBuilder(Material.INK_SACK, (short)10).setDisplayName("<EFBFBD>7Aktuell <20>8<EFBFBD> <20>aAlle Spieler").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
|
||||
|
||||
inv.setItem(4, new ItemBuilder(Material.TNT).setDisplayName("§8» §cSilentLobby §8«").removeAllAtributs().build());
|
||||
inv.setItem(4, new ItemBuilder(Material.TNT).setDisplayName("§cSilentLobby").removeAllAtributs().build());
|
||||
|
||||
|
||||
return inv;
|
@ -1,6 +1,6 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,7 +1,7 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import net.minecraft.server.v1_12_R1.PacketPlayOutExplosion;
|
||||
import net.minecraft.server.v1_12_R1.Vec3D;
|
||||
import org.bukkit.Bukkit;
|
@ -1,7 +1,7 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
@ -1,17 +1,16 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import de.steamwar.lobby.manager.FileManager;
|
||||
import de.warking.hunjy.Core;
|
||||
import de.warking.lobby.inventorys.LobbyInventorys;
|
||||
import de.steamwar.lobby.inventorys.LobbyInventorys;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
|
||||
public class JoinEvent implements Listener {
|
||||
|
||||
public BackendManager backend = LobbySystem.getInstance().getBackendManager();
|
@ -1,7 +1,10 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.inventorys.LobbyInventorys;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import de.steamwar.lobby.manager.FileManager;
|
||||
import de.steamwar.lobby.utils.ItemBuilder;
|
||||
import de.steamwar.lobby.inventorys.LobbyInventorys;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -12,14 +15,10 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
import de.warking.lobby.utils.ItemBuilder;
|
||||
|
||||
public class LobbyInteractListener implements Listener {
|
||||
|
||||
|
||||
// »«
|
||||
// <EFBFBD><EFBFBD>
|
||||
|
||||
public FileManager fm = LobbySystem.getInstance().getFileManager();
|
||||
|
||||
@ -36,9 +35,9 @@ public class LobbyInteractListener implements Listener {
|
||||
}else if(event.getItem().getType() == Material.valueOf(fm.getStringFromConfig("Items.Lobby.Extras.ID"))) {
|
||||
player.openInventory(LobbyInventorys.ExtrasInventory());
|
||||
event.setCancelled(true);
|
||||
} else if(event.getItem().getType() == Material.ELYTRA && event.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§cJetpack")) {
|
||||
} else if(event.getItem().getType() == Material.ELYTRA && event.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§cJetpack")) {
|
||||
event.setCancelled(true);
|
||||
} else if(event.getItem().getType() ==Material.getMaterial(417) && event.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§cTNT Kanone")) {
|
||||
} else if(event.getItem().getType() ==Material.getMaterial(417) && event.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§cTNT Kanone")) {
|
||||
shootTNTCanon(player);
|
||||
}
|
||||
} else
|
||||
@ -56,19 +55,19 @@ public class LobbyInteractListener implements Listener {
|
||||
snowball.setShooter(player);
|
||||
player.getWorld().playSound(player.getLocation(), Sound.ENTITY_IRONGOLEM_ATTACK, 1, 1);
|
||||
addCooldown(player, Gadget.TNT_CANNON);
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§6Warten...").removeAllAtributs().build());
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§6Warten...").removeAllAtributs().build());
|
||||
player.getItemInHand().getItemMeta().setUnbreakable(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void addCooldown(Player player, Gadget gadget) {
|
||||
private void addCooldown(final Player player, Gadget gadget) {
|
||||
LobbySystem.getInstance().getGadgetManager().setPlayerGadgetCooldown(player, gadget);
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(LobbySystem.getInstance(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LobbySystem.getInstance().getGadgetManager().removePlayerGadgetCooldown(player);
|
||||
if(LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player) == Gadget.TNT_CANNON) player.getInventory().setItem(5, new ItemBuilder(Material.getMaterial(417)).setDisplayName("§cTNT Kanone").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
if(LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player) == Gadget.TNT_CANNON) player.getInventory().setItem(5, new ItemBuilder(Material.getMaterial(417)).setDisplayName("§cTNT Kanone").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
}
|
||||
}, 20*10);
|
||||
}
|
@ -1,13 +1,14 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import de.steamwar.lobby.manager.FileManager;
|
||||
import de.steamwar.lobby.utils.ItemBuilder;
|
||||
import de.warking.hunjy.Core;
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.inventorys.ExtrasInventorys;
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
import de.warking.lobby.utils.ItemBuilder;
|
||||
import de.steamwar.lobby.inventorys.ExtrasInventorys;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -17,7 +18,6 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
public class LobbyInvClickManager implements Listener{
|
||||
@ -104,57 +104,54 @@ public class LobbyInvClickManager implements Listener{
|
||||
|
||||
//navigator
|
||||
|
||||
String navigatorName = fm.getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§");
|
||||
String navigatorName = fm.getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§");
|
||||
|
||||
if(event.getClickedInventory().getType() == InventoryType.CHEST && event.getClickedInventory().getName().equals(navigatorName)) {
|
||||
|
||||
switch (materialName) {
|
||||
|
||||
case "§8» §6Spawn §8«":
|
||||
case "§6Spawn":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("main.lobby"));
|
||||
break;
|
||||
case "§8» §3AirShip §8«":
|
||||
case "§3AirShip":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.airship"));
|
||||
break;
|
||||
case "§8» §aMiniGames §8«":
|
||||
case "§aMiniGames":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.minigame"));
|
||||
break;
|
||||
case "§8» §9WarGear §8«":
|
||||
case "§9WarGear":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.wargear"));
|
||||
break;
|
||||
case "§8» §2Survival §8«":
|
||||
case "§2Survival":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.survival"));
|
||||
break;
|
||||
case "§8» §bMini WarGear §8«":
|
||||
case "§bMini WarGear":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.miniwargear"));
|
||||
break;
|
||||
case "§8» §eTägliche Belohnung §8«":
|
||||
case "§eTägliche Belohnung":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.tb"));
|
||||
break;
|
||||
case "§8» §dBattleBox §8«":
|
||||
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("navigation.battlebox"));
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//hide players
|
||||
|
||||
String hiderName = fm.getStringFromConfig("Items.Lobby.Hider.Display").replaceAll("&", "§");
|
||||
String hiderName = fm.getStringFromConfig("Items.Lobby.Hider.Display").replaceAll("&", "§");
|
||||
|
||||
if (event.getClickedInventory().getType() == InventoryType.BREWING && event.getClickedInventory().getName().equals(hiderName)) {
|
||||
|
||||
switch (materialName) {
|
||||
|
||||
case "§8» §aAlle Spieler §8«":
|
||||
case "§aAlle Spieler":
|
||||
for (Player allPlayers : Bukkit.getServer().getOnlinePlayers()) {
|
||||
player.showPlayer(allPlayers);
|
||||
}
|
||||
if(BackendManager.hideUsers.contains(player)) BackendManager.hideUsers.remove(player);
|
||||
if(BackendManager.hideAll.contains(player)) BackendManager.hideAll.remove(player);
|
||||
//event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)10).setDisplayName("§7Aktuell §8» §aAlle Spieler").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
//event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)10).setDisplayName("§7Aktuell §8§ §aAlle Spieler").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
break;
|
||||
case "§8» §5YouTuber/ Teammitglieder §8«":
|
||||
case "§5YouTuber/ Teammitglieder":
|
||||
for (Player allPlayers : Bukkit.getServer().getOnlinePlayers()) {
|
||||
if (Core.getInstance().getPlayerManager(allPlayers).getGroupName().equalsIgnoreCase("member")) {
|
||||
player.hidePlayer(allPlayers);
|
||||
@ -163,17 +160,17 @@ public class LobbyInvClickManager implements Listener{
|
||||
}
|
||||
if(BackendManager.hideAll.contains(player)) BackendManager.hideAll.remove(player);
|
||||
if(!BackendManager.hideUsers.contains(player)) BackendManager.hideUsers.add(player);
|
||||
//event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)5).setDisplayName("§7Aktuell §8» §5YouTuber/ Teammitglieder §8«").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
//event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)5).setDisplayName("§7Aktuell §8§ §5YouTuber/ Teammitglieder §8§").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
break;
|
||||
case "§8» §7Keine Spieler §8«":
|
||||
case "§7Keine Spieler":
|
||||
for (Player allPlayers : Bukkit.getServer().getOnlinePlayers()) {
|
||||
player.hidePlayer(allPlayers);
|
||||
}
|
||||
if(!BackendManager.hideAll.contains(player)) BackendManager.hideAll.add(player);
|
||||
if(BackendManager.hideUsers.contains(player)) BackendManager.hideUsers.remove(player);
|
||||
//event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§7Aktuell §8» §7Keine Spieler §8«").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
//event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§7Aktuell §8§ §7Keine Spieler §8§").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
break;
|
||||
case "§8» §cSilentLobby §8«":
|
||||
case "§cSilentLobby":
|
||||
//change server
|
||||
break;
|
||||
}
|
||||
@ -181,55 +178,55 @@ public class LobbyInvClickManager implements Listener{
|
||||
}
|
||||
|
||||
//Extras
|
||||
String extrasName = fm.getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§").split(" ")[0];
|
||||
String extrasName = fm.getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§").split(" ")[0];
|
||||
if (event.getClickedInventory().getType() == InventoryType.CHEST && event.getClickedInventory().getName().equals(extrasName)) {
|
||||
switch (materialName) {
|
||||
|
||||
case "§8» §9Rüstung §8«":
|
||||
case "§9Rüstung":
|
||||
player.openInventory(ExtrasInventorys.getArmorInventory());
|
||||
break;
|
||||
case "§8» §aGadgets §8«":
|
||||
case "§aGadgets":
|
||||
player.openInventory(ExtrasInventorys.getGadgets());
|
||||
break;
|
||||
case "§8» §dPartikel §8«":
|
||||
case "§dPartikel":
|
||||
player.openInventory(ExtrasInventorys.getPartikel());
|
||||
break;
|
||||
case "§8» §ePets §8«":
|
||||
case "§ePets":
|
||||
player.openInventory(ExtrasInventorys.getPets());
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(event.getClickedInventory().getType() == InventoryType.CHEST && event.getClickedInventory().getName().equals("§8» §9Rüstung §8«")) {
|
||||
if(event.getClickedInventory().getType() == InventoryType.CHEST && event.getClickedInventory().getName().equals("§9Rüstung")) {
|
||||
|
||||
switch (materialName) {
|
||||
|
||||
case "§0LEDER":
|
||||
case "§0LEDER":
|
||||
player.getInventory().setHelmet(new ItemBuilder(Material.LEATHER_HELMET).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
break;
|
||||
case "§8KETTE":
|
||||
case "§8KETTE":
|
||||
player.getInventory().setHelmet(new ItemBuilder(Material.CHAINMAIL_HELMET).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.CHAINMAIL_CHESTPLATE).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.CHAINMAIL_LEGGINGS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setBoots(new ItemBuilder(Material.CHAINMAIL_BOOTS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
break;
|
||||
case "§7IRON":
|
||||
case "§7IRON":
|
||||
player.getInventory().setHelmet(new ItemBuilder(Material.IRON_HELMET).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.IRON_CHESTPLATE).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.IRON_LEGGINGS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setBoots(new ItemBuilder(Material.IRON_BOOTS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
break;
|
||||
case "§eGOLD":
|
||||
case "§eGOLD":
|
||||
player.getInventory().setHelmet(new ItemBuilder(Material.GOLD_HELMET).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.GOLD_CHESTPLATE).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.GOLD_LEGGINGS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setBoots(new ItemBuilder(Material.GOLD_BOOTS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
break;
|
||||
case "§bDIAMANT":
|
||||
case "§bDIAMANT":
|
||||
player.getInventory().setHelmet(new ItemBuilder(Material.DIAMOND_HELMET).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setChestplate(new ItemBuilder(Material.DIAMOND_CHESTPLATE).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
player.getInventory().setLeggings(new ItemBuilder(Material.DIAMOND_LEGGINGS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
|
||||
@ -240,33 +237,33 @@ public class LobbyInvClickManager implements Listener{
|
||||
}
|
||||
|
||||
//Gadgets
|
||||
if(event.getClickedInventory().getType() == InventoryType.CHEST && event.getClickedInventory().getName().equals("§8» §aGadgets §8«")) {
|
||||
if(event.getClickedInventory().getType() == InventoryType.CHEST && event.getClickedInventory().getName().equals("§8§ §aGadgets §8§")) {
|
||||
|
||||
switch (materialName) {
|
||||
|
||||
case "§dEnder Perle":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.ENDER_PEARL).setDisplayName("§dEnder Perle").removeAllAtributs().build());
|
||||
case "§dEnder Perle":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.ENDER_PEARL).setDisplayName("§dEnder Perle").removeAllAtributs().build());
|
||||
if(LobbySystem.getInstance().getGadgetManager().hasPlayerGadget(player)) LobbySystem.getInstance().getGadgetManager().removePlayerGadget(player);
|
||||
LobbySystem.getInstance().getGadgetManager().setPlayerGadget(player, Gadget.ENDER_PEARL);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, 1, 100);
|
||||
player.updateInventory();
|
||||
break;
|
||||
case "§cJetpack":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.ELYTRA).setDisplayName("§cJetpack").setUnbreakable(true).removeAllAtributs().build());
|
||||
case "§cJetpack":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.ELYTRA).setDisplayName("§cJetpack").setUnbreakable(true).removeAllAtributs().build());
|
||||
if(LobbySystem.getInstance().getGadgetManager().hasPlayerGadget(player)) LobbySystem.getInstance().getGadgetManager().removePlayerGadget(player);
|
||||
LobbySystem.getInstance().getGadgetManager().setPlayerGadget(player, Gadget.JETPACK);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, 1, 100);
|
||||
player.updateInventory();
|
||||
break;
|
||||
case "§eGreifhaken":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.FISHING_ROD).setDisplayName("§eGreifhaken").setUnbreakable(true).removeAllAtributs().build());
|
||||
case "§eGreifhaken":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.FISHING_ROD).setDisplayName("§eGreifhaken").setUnbreakable(true).removeAllAtributs().build());
|
||||
if(LobbySystem.getInstance().getGadgetManager().hasPlayerGadget(player)) LobbySystem.getInstance().getGadgetManager().removePlayerGadget(player);
|
||||
LobbySystem.getInstance().getGadgetManager().setPlayerGadget(player, Gadget.HOOK);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, 1, 100);
|
||||
player.updateInventory();
|
||||
break;
|
||||
case "§cTNT Kanone":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.getMaterial(417)).setDisplayName("§cTNT Kanone").setUnbreakable(true).addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
case "§cTNT Kanone":
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.getMaterial(417)).setDisplayName("§cTNT Kanone").setUnbreakable(true).addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
|
||||
if(LobbySystem.getInstance().getGadgetManager().hasPlayerGadget(player)) LobbySystem.getInstance().getGadgetManager().removePlayerGadget(player);
|
||||
LobbySystem.getInstance().getGadgetManager().setPlayerGadget(player, Gadget.TNT_CANNON);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_ANVIL_USE, 1, 100);
|
@ -1,8 +1,8 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,6 +1,6 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
@ -1,4 +1,4 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,8 +1,8 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.utils.ItemBuilder;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import de.steamwar.lobby.utils.ItemBuilder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EnderPearl;
|
||||
@ -31,7 +31,7 @@ public class ProjectileLaunchEvent implements Listener {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(LobbySystem.getInstance(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§6Warten...").removeAllAtributs().build());
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("<EFBFBD>6Warten...").removeAllAtributs().build());
|
||||
}
|
||||
}, 5L);
|
||||
player.updateInventory();
|
||||
@ -42,7 +42,7 @@ public class ProjectileLaunchEvent implements Listener {
|
||||
public void run() {
|
||||
LobbySystem.getInstance().getGadgetManager().removePlayerGadgetCooldown(player);
|
||||
if(!LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player).equals(Gadget.ENDER_PEARL)) return;
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.ENDER_PEARL).setDisplayName("§dEnder Perle").removeAllAtributs().build());
|
||||
player.getInventory().setItem(5, new ItemBuilder(Material.ENDER_PEARL).setDisplayName("<EFBFBD>dEnder Perle").removeAllAtributs().build());
|
||||
}
|
||||
}, 20*10);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.manager.BackendManager;
|
||||
import de.steamwar.lobby.manager.BackendManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,7 +1,7 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -14,7 +14,7 @@ public class SneakListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void handleSneak(PlayerToggleSneakEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
final Player player = event.getPlayer();
|
||||
if(LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player) == Gadget.JETPACK) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
@ -30,8 +30,8 @@ public class SneakListener implements Listener {
|
||||
@Override
|
||||
public void run() {
|
||||
if(player.isSneaking() && LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player) == Gadget.JETPACK) {
|
||||
player.getWorld().playEffect(player.getLocation(), Effect.LAVA_POP, 10);
|
||||
player.getWorld().playEffect(player.getLocation(), Effect.LAVA_POP, 10);
|
||||
//player.getWorld().playEffect(player.getLocation(), Effect.LAVA_POP, 10);
|
||||
//player.getWorld().playEffect(player.getLocation(), Effect.LAVA_POP, 10);
|
||||
player.getWorld().playEffect(player.getLocation(), Effect.LAVA_POP, 10);
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_FIREWORK_LAUNCH, 0.1F, 0.1F);
|
||||
|
@ -1,7 +1,7 @@
|
||||
package de.warking.lobby.listener;
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.warking.lobby.gadgets.Gadget;
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.gadgets.Gadget;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
@ -1,6 +1,6 @@
|
||||
package de.warking.lobby.manager;
|
||||
package de.steamwar.lobby.manager;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
@ -1,12 +1,11 @@
|
||||
package de.warking.lobby.manager;
|
||||
package de.steamwar.lobby.manager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
|
||||
|
||||
public class FileManager {
|
||||
|
||||
@ -35,7 +34,7 @@ public class FileManager {
|
||||
}
|
||||
|
||||
public String getStringFromConfig(String path) {
|
||||
return config.getString(path).replaceAll("&", "§");
|
||||
return config.getString(path).replaceAll("&", "<EFBFBD>");
|
||||
}
|
||||
|
||||
public int getIntegerFromConfig(String path) {
|
@ -1,15 +1,14 @@
|
||||
package de.warking.lobby.manager;
|
||||
package de.steamwar.lobby.manager;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
|
||||
public class LocationManager {
|
||||
|
||||
private File file;
|
@ -1,4 +1,4 @@
|
||||
package de.warking.lobby.utils;
|
||||
package de.steamwar.lobby.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -1,39 +0,0 @@
|
||||
package de.warking.lobby.command;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class checkCommand implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String lable, String[] args) {
|
||||
if(!(sender instanceof Player))
|
||||
return false;
|
||||
Player player = (Player)sender;
|
||||
|
||||
if(args.length == 0) {
|
||||
player.sendMessage(LobbySystem.prefix + "§7Benutze §c/check [loc/mysql/config]");
|
||||
}else if(args.length == 1) {
|
||||
if(args[0].equalsIgnoreCase("loc") || args[0].equalsIgnoreCase("l") || args[0].equalsIgnoreCase("location")) {
|
||||
if(player.hasPermission("lobby.admin.edit.location")) {
|
||||
String[] split = LobbySystem.getInstance().getBackendManager().checkLocations().split(" newLine ");
|
||||
player.sendMessage(LobbySystem.prefix + "§7Es fehlen folgene Positionen!");
|
||||
if(split.length > 0) {
|
||||
for(int i = 0; i < split.length; i++) {
|
||||
player.sendMessage(split[i]);
|
||||
}
|
||||
player.sendMessage(LobbySystem.prefix + "§7Du kannst die fehlnene Positionen mit §c/setlocation §7erstellen");
|
||||
}else {
|
||||
player.sendMessage(LobbySystem.prefix + "§aEs wurden alle Positionen gesetzt!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package de.warking.lobby.command;
|
||||
|
||||
import de.warking.lobby.LobbySystem;
|
||||
import de.warking.lobby.inventorys.LobbyInventorys;
|
||||
import de.warking.lobby.listener.LobbyInvClickManager;
|
||||
import de.warking.lobby.manager.FileManager;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class setLocation implements CommandExecutor {
|
||||
|
||||
public FileManager fm = LobbySystem.getInstance().getFileManager();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String lable, String[] args) {
|
||||
if(!(sender instanceof Player))
|
||||
return false;
|
||||
Player player = (Player)sender;
|
||||
|
||||
if(player.hasPermission("lobby.admin.edit.location")) {
|
||||
LobbyInvClickManager.inSetup.add(player);
|
||||
player.openInventory(LobbyInventorys.getNavigatorInventory());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -2,10 +2,8 @@ name: LobbySystem
|
||||
version: 1.0
|
||||
author: [hunjy, Yaruma3341]
|
||||
depend: [CoreSystem]
|
||||
main: de.warking.lobby.LobbySystem
|
||||
main: de.steamwar.lobby.LobbySystem
|
||||
|
||||
commands:
|
||||
setlocation:
|
||||
check:
|
||||
build:
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren