Archiviert
13
0

first stable version

Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Yaruma3341 2019-04-04 21:10:09 +02:00
Ursprung 4e00e3153f
Commit f4f9f7efea
32 geänderte Dateien mit 565 neuen und 581 gelöschten Zeilen

Datei anzeigen

@ -28,3 +28,10 @@ Items:
ID: 'BLAZE_ROD'
Display: '&9Spieler Verstecken'
Slot: 2
WorldMaxRadius:
minX:
minY:
minZ:
maxX:
maxY:
maxZ:

Datei anzeigen

@ -1,83 +0,0 @@
package de.diamant.hunjy.MySQL;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import de.diamant.hunjy.main.LobbySystem;
public class MySQL {
private String HOST = "";
private String PORT = "";
private String DATABASE = "";
private String USER = "";
private String PASSWORD = "";
private Connection con;
public MySQL(String HOST, String PORT, String DATABASE, String USER, String PASSWORD) {
this.HOST = HOST;
this.PORT = PORT;
this.DATABASE = DATABASE;
this.USER = USER;
this.PASSWORD = PASSWORD;
connect();
}
public MySQL(String HOST, String PORT, String DATABASE, String USER) {
this.HOST = HOST;
this.PORT = PORT;
this.DATABASE = DATABASE;
this.USER = USER;
connect();
}
public void connect() {
try {
con = DriverManager.getConnection("jdbc:mysql://" + HOST + ":" + PORT + "/" + DATABASE + "?autoreconnect=true", USER, PASSWORD);
if(con != null)
System.out.println(LobbySystem.getInstance().getDescription().getFullName() + " >> MySQL: Verbunden");
}catch (SQLException e) {
e.printStackTrace();
}
}
public void closeConnection() {
try {
if(con != null)
con.close();
}catch (SQLException e) {
e.printStackTrace();
}
}
public void update(String qry) {
try {
PreparedStatement st = con.prepareStatement(qry);
st.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
public ResultSet getResultSet(String qry) {
try {
PreparedStatement st = con.prepareStatement(qry);
return st.executeQuery();
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}
public Connection getCon() {
return con;
}
}

Datei anzeigen

@ -1,56 +0,0 @@
package de.diamant.hunjy.command;
import de.diamant.hunjy.main.LobbySystem;
import de.diamant.hunjy.manager.BackendManager;
import de.diamant.hunjy.manager.FileManager;
import de.diamant.hunjy.utils.ItemBuilder;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
public class buildCommand implements CommandExecutor {
public FileManager fm = LobbySystem.getInstance().getFileManager();
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player))
return false;
Player player = (Player) sender;
if(player.hasPermission("lobby.build")) {
if(!BackendManager.canBuild.contains(player)) {
BackendManager.canBuild.add(player);
LobbySystem.getInstance().getGadgetManager().removePlayerGadget(player);
LobbySystem.getInstance().getGadgetManager().removePlayerGadgetCooldown(player);
setLobbyItems(player);
player.sendMessage(LobbySystem.prefix + "Du kannst nun auf der Lobby bauen!");
} else {
BackendManager.canBuild.remove(player);
setLobbyItems(player);
player.sendMessage(LobbySystem.prefix + "Du kannst nun auf der Lobby nicht mehr bauen!");
}
} else
player.sendMessage(LobbySystem.prefix + "§cDu darfst das nicht!");
return false;
}
private void setLobbyItems(Player player) {
Inventory inv = player.getInventory();
inv.clear();
player.getInventory().setArmorContents(null);
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());
}
}

Datei anzeigen

@ -1,53 +0,0 @@
package de.diamant.hunjy.command;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import de.diamant.hunjy.listener.LobbyInvClickManager;
import de.diamant.hunjy.main.LobbySystem;
import de.diamant.hunjy.manager.FileManager;
import de.diamant.hunjy.utils.ItemBuilder;
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(LobbyInventory());
}
return false;
}
public Inventory LobbyInventory() {
String name = fm.getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§").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());
return inv;
}
}

Datei anzeigen

@ -1,63 +0,0 @@
package de.diamant.hunjy.listener;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.Inventory;
import de.diamant.hunjy.main.LobbySystem;
import de.diamant.hunjy.manager.BackendManager;
import de.diamant.hunjy.manager.FileManager;
import de.diamant.hunjy.utils.ItemBuilder;
public class JoinEvent implements Listener {
public BackendManager backend = LobbySystem.getInstance().getBackendManager();
public FileManager fm = LobbySystem.getInstance().getFileManager();
@EventHandler
private void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
if(backend.allowJoinMessage) {
if(backend.allowFisrtJoinMessage) {
if(!player.hasPlayedBefore()) {
event.setJoinMessage(backend.FisrtJoinMessage);
}
}
event.setJoinMessage(backend.JoinMessage.replaceAll("%player%", player.getName()));
}else {
event.setJoinMessage(null);
}
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("main.lobby"));
setLobbyItems(player);
//hider
for(Player workPlayer : BackendManager.hideAll) {
workPlayer.hidePlayer(player);
}
for(Player workPlayer : BackendManager.hideUsers) {
workPlayer.hidePlayer(player);
}
}
private void setLobbyItems(Player player) {
Inventory inv = player.getInventory();
inv.clear();
player.getInventory().setArmorContents(null);
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());
}
}

Datei anzeigen

@ -1,136 +0,0 @@
package de.diamant.hunjy.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.manager.BackendManager;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Snowball;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import de.diamant.hunjy.main.LobbySystem;
import de.diamant.hunjy.manager.FileManager;
import de.diamant.hunjy.utils.ItemBuilder;
public class LobbyInteractListener implements Listener {
// »«
public FileManager fm = LobbySystem.getInstance().getFileManager();
@EventHandler
private void onInteract(PlayerInteractEvent event) {
if(event.getItem() != null) {
Player player = event.getPlayer();
if(event.getItem().getType() == Material.valueOf(fm.getStringFromConfig("Items.Lobby.Navigator.ID"))) {
player.openInventory(LobbyInventory());
event.setCancelled(true);
}else if(event.getItem().getType() == Material.valueOf(fm.getStringFromConfig("Items.Lobby.Hider.ID"))) {
player.openInventory(PlayerHideInventory(player));
event.setCancelled(true);
}else if(event.getItem().getType() == Material.valueOf(fm.getStringFromConfig("Items.Lobby.Extras.ID"))) {
player.openInventory(ExtrasInventory());
event.setCancelled(true);
} 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")) {
shootTNTCanon(player);
}
}
}
public Inventory LobbyInventory() {
String name = fm.getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§").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());
return inv;
}
public Inventory PlayerHideInventory(Player player) {
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());
if(BackendManager.hideAll.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.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)8).setDisplayName("§7Aktuell §8» §7Keine Spieler §8«").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
inv.setItem(4, new ItemBuilder(Material.TNT).setDisplayName("§8» §cSilentLobby §8«").removeAllAtributs().build());
return inv;
}
public Inventory ExtrasInventory() {
String name = fm.getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§").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(9, new ItemBuilder(Material.PISTON_BASE).setDisplayName("§8» §aGadgets §8«").build());
inv.setItem(18, new ItemBuilder(Material.NETHER_STAR).setDisplayName("§8» §dPartikel §8«").build());
inv.setItem(27, new ItemBuilder(Material.BONE).setDisplayName("§8» §ePets §8«").build());
return inv;
}
public void shootTNTCanon(Player player) {
if(LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player) == Gadget.TNT_CANNON && LobbySystem.getInstance().getGadgetManager().hasPlayerGadgetCooldown(player) == false) {
Snowball snowball = player.getWorld().spawn(player.getEyeLocation(), Snowball.class);
snowball.setVelocity(player.getLocation().getDirection().multiply(1.6));
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.getItemInHand().getItemMeta().setUnbreakable(true);
}
}
private void addCooldown(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());
}
}, 20*10);
}
}

Datei anzeigen

@ -1,21 +1,18 @@
package de.diamant.hunjy.main;
package de.warking.lobby;
import de.diamant.hunjy.gadgets.GadgetManager;
import de.diamant.hunjy.listener.*;
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 org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import de.diamant.hunjy.command.*;
import de.diamant.hunjy.manager.BackendManager;
import de.diamant.hunjy.manager.FileManager;
import de.diamant.hunjy.manager.LocationManager;
public class LobbySystem extends JavaPlugin{
public class LobbySystem extends JavaPlugin {
public static String prefix;
@ -33,9 +30,8 @@ public class LobbySystem extends JavaPlugin{
@Override
public void onEnable() {
locationManager = new LocationManager();
fileManager = new FileManager(instance);
fileManager = new de.warking.lobby.manager.FileManager(instance);
loadBackend();
prefix = backendManager.prefix;
@ -43,21 +39,25 @@ public class LobbySystem extends JavaPlugin{
this.getCommand("check").setExecutor(new checkCommand());
this.getCommand("build").setExecutor(new buildCommand());
init();
}
public void init() {
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new JoinEvent(), instance);
pm.registerEvents(new BlockListener(), instance);
pm.registerEvents(new EntityDamageByEntityEvent(), instance);
pm.registerEvents(new FishEvent(), instance);
pm.registerEvents(new JoinEvent(), instance);
pm.registerEvents(new LobbyInteractListener(), instance);
pm.registerEvents(new LobbyInvClickManager(), instance);
pm.registerEvents(new QuitEvent(), instance);
pm.registerEvents(new ProjectileLaunchEvent(), instance);
pm.registerEvents(new PlayerKickEvent(), instance);
pm.registerEvents(new PlayerMoveListener(), instance);
pm.registerEvents(new ProjectileLaunchEvent(), instance);
pm.registerEvents(new QuitEvent(), instance);
pm.registerEvents(new SneakListener(), instance);
pm.registerEvents(new TeleportEvent(), instance);
pm.registerEvents(new FishEvent(), instance);
pm.registerEvents(new EntityDamageByEntityEvent(), instance);
pm.registerEvents(new PlayerQuitListener(), instance);
}
public void loadBackend() {

Datei anzeigen

@ -0,0 +1,42 @@
package de.warking.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 org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class buildCommand implements CommandExecutor {
public FileManager fm = LobbySystem.getInstance().getFileManager();
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player))
return false;
Player player = (Player) sender;
if(player.hasPermission("lobby.build")) {
if(!BackendManager.canBuild.contains(player)) {
BackendManager.canBuild.add(player);
LobbySystem.getInstance().getGadgetManager().removePlayerGadget(player);
LobbySystem.getInstance().getGadgetManager().removePlayerGadgetCooldown(player);
LobbyInventorys.setLobbyItems(player);
player.sendMessage(LobbySystem.prefix + "Du kannst nun auf der Lobby bauen!");
} else {
BackendManager.canBuild.remove(player);
LobbyInventorys.setLobbyItems(player);
player.sendMessage(LobbySystem.prefix + "Du kannst nun auf der Lobby nicht mehr bauen!");
}
} else
player.sendMessage(LobbySystem.prefix + "§cDu darfst das nicht!");
return false;
}
}

Datei anzeigen

@ -1,12 +1,11 @@
package de.diamant.hunjy.command;
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;
import de.diamant.hunjy.main.LobbySystem;
public class checkCommand implements CommandExecutor {
@Override

Datei anzeigen

@ -0,0 +1,30 @@
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;
}
}

Datei anzeigen

@ -1,4 +1,4 @@
package de.diamant.hunjy.gadgets;
package de.warking.lobby.gadgets;
public enum Gadget {

Datei anzeigen

@ -1,4 +1,4 @@
package de.diamant.hunjy.gadgets;
package de.warking.lobby.gadgets;
import org.bukkit.entity.Player;

Datei anzeigen

@ -0,0 +1,99 @@
package de.warking.lobby.inventorys;
import de.warking.lobby.utils.ItemBuilder;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
public class ExtrasInventorys {
public static Inventory getGadgets() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §aGadgets §8«");
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());
return inv;
}
public static Inventory getArmorInventory() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §9Rüstung §8«");
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(9, new ItemBuilder(Material.LEATHER_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(18, new ItemBuilder(Material.LEATHER_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(27, new ItemBuilder(Material.LEATHER_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(36, new ItemBuilder(Material.LEATHER_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(11, new ItemBuilder(Material.CHAINMAIL_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(20, new ItemBuilder(Material.CHAINMAIL_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(29, new ItemBuilder(Material.CHAINMAIL_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(38, new ItemBuilder(Material.CHAINMAIL_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(13, new ItemBuilder(Material.IRON_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(22, new ItemBuilder(Material.IRON_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(31, new ItemBuilder(Material.IRON_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(40, new ItemBuilder(Material.IRON_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(15, new ItemBuilder(Material.GOLD_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(24, new ItemBuilder(Material.GOLD_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(33, new ItemBuilder(Material.GOLD_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(42, new ItemBuilder(Material.GOLD_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(17, new ItemBuilder(Material.DIAMOND_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(26, new ItemBuilder(Material.DIAMOND_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(35, new ItemBuilder(Material.DIAMOND_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(44, new ItemBuilder(Material.DIAMOND_BOOTS).setDisplayName(" ").removeAllAtributs().build());
return inv;
}
public static Inventory getPartikel() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §dPartikel §8«");
for(int i = 0; i < inv.getSize(); i++) {
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
}
//
return inv;
}
public static Inventory getPets() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §ePets §8«");
for(int i = 0; i < inv.getSize(); i++) {
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
}
//
return inv;
}
}

Datei anzeigen

@ -0,0 +1,92 @@
package de.warking.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 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;
public class LobbyInventorys {
public static void setLobbyItems(Player player) {
Inventory inv = player.getInventory();
inv.clear();
player.getInventory().setArmorContents(null);
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());
}
public static Inventory getNavigatorInventory() {
String name = LobbySystem.getInstance().getFileManager().getStringFromConfig("Items.Lobby.Navigator.Display").replaceAll("&", "§").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());
return inv;
}
public static Inventory ExtrasInventory() {
String name = LobbySystem.getInstance().getFileManager().getStringFromConfig("Items.Lobby.Extras.Display").replaceAll("&", "§").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(9, new ItemBuilder(Material.PISTON_BASE).setDisplayName("§8» §aGadgets §8«").build());
inv.setItem(18, new ItemBuilder(Material.NETHER_STAR).setDisplayName("§8» §dPartikel §8«").build());
inv.setItem(27, new ItemBuilder(Material.BONE).setDisplayName("§8» §ePets §8«").build());
return inv;
}
public static Inventory PlayerHideInventory(Player player) {
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());
//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());
inv.setItem(4, new ItemBuilder(Material.TNT).setDisplayName("§8» §cSilentLobby §8«").removeAllAtributs().build());
return inv;
}
}

Datei anzeigen

@ -1,6 +1,6 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.manager.BackendManager;
import de.warking.lobby.manager.BackendManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -8,16 +8,20 @@ import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.weather.WeatherChangeEvent;
public class BlockListener implements Listener{
@EventHandler
private void onDamage(EntityDamageEvent event) {
if(event.getEntity() instanceof Player) {
//event.setCancelled(true);
if(event.getEntity() instanceof Player)
event.setCancelled(true);
}
@EventHandler
private void onPlayerDropItem(PlayerDropItemEvent event) {
event.setCancelled(true);
}
@EventHandler

Datei anzeigen

@ -1,7 +1,7 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.LobbySystem;
import net.minecraft.server.v1_12_R1.PacketPlayOutExplosion;
import net.minecraft.server.v1_12_R1.Vec3D;
import org.bukkit.Bukkit;
@ -9,7 +9,6 @@ import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

Datei anzeigen

@ -1,7 +1,7 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.LobbySystem;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;

Datei anzeigen

@ -0,0 +1,51 @@
package de.warking.lobby.listener;
import de.warking.hunjy.Core;
import de.warking.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();
public FileManager fm = LobbySystem.getInstance().getFileManager();
@EventHandler
private void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
if(backend.allowJoinMessage) {
if(backend.allowFisrtJoinMessage) {
if(!player.hasPlayedBefore()) {
event.setJoinMessage(backend.FisrtJoinMessage);
}
}
event.setJoinMessage(backend.JoinMessage.replaceAll("%player%", player.getName()));
}else {
event.setJoinMessage(null);
}
player.teleport(LobbySystem.getInstance().getLocationManager().loadLocation("main.lobby"));
LobbyInventorys.setLobbyItems(player);
player.setGameMode(GameMode.ADVENTURE);
//hider
for(Player workPlayer : BackendManager.hideAll) {
workPlayer.hidePlayer(player);
}
for(Player workPlayer : BackendManager.hideUsers) {
if(Core.getInstance().getPlayerManager(player).getGroupName().equalsIgnoreCase("member"))
workPlayer.hidePlayer(player);
}
}
}

Datei anzeigen

@ -0,0 +1,75 @@
package de.warking.lobby.listener;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.inventorys.LobbyInventorys;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
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 {
// »«
public FileManager fm = LobbySystem.getInstance().getFileManager();
@EventHandler
private void onInteract(PlayerInteractEvent event) {
if(event.getItem() != null) {
Player player = event.getPlayer();
if(event.getItem().getType() == Material.valueOf(fm.getStringFromConfig("Items.Lobby.Navigator.ID"))) {
player.openInventory(LobbyInventorys.getNavigatorInventory());
event.setCancelled(true);
}else if(event.getItem().getType() == Material.valueOf(fm.getStringFromConfig("Items.Lobby.Hider.ID"))) {
player.openInventory(LobbyInventorys.PlayerHideInventory(player));
event.setCancelled(true);
}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")) {
event.setCancelled(true);
} else if(event.getItem().getType() ==Material.getMaterial(417) && event.getItem().getItemMeta().getDisplayName().equalsIgnoreCase("§cTNT Kanone")) {
shootTNTCanon(player);
}
}
}
public void shootTNTCanon(Player player) {
if(LobbySystem.getInstance().getGadgetManager().getPlayerGadget(player) == Gadget.TNT_CANNON && LobbySystem.getInstance().getGadgetManager().hasPlayerGadgetCooldown(player) == false) {
Snowball snowball = player.getWorld().spawn(player.getEyeLocation(), Snowball.class);
snowball.setVelocity(player.getLocation().getDirection().multiply(1.6));
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.getItemInHand().getItemMeta().setUnbreakable(true);
}
}
private void addCooldown(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());
}
}, 20*10);
}
}

Datei anzeigen

@ -1,11 +1,13 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import java.util.ArrayList;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.manager.BackendManager;
import de.diamant.hunjy.manager.FileManager;
import de.diamant.hunjy.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 org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -15,9 +17,8 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.LobbySystem;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
public class LobbyInvClickManager implements Listener{
@ -151,26 +152,26 @@ public class LobbyInvClickManager implements Listener{
}
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«":
for (Player allPlayers : Bukkit.getServer().getOnlinePlayers()) {
if (!allPlayers.hasPermission("PERMISSION")) {//permission fehlt
if (Core.getInstance().getPlayerManager(allPlayers).getGroupName().equalsIgnoreCase("member")) {
player.hidePlayer(allPlayers);
} else
player.showPlayer(allPlayers);
}
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«":
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.add(player);
event.getInventory().setItem(3, new ItemBuilder(Material.INK_SACK, (short)8).setDisplayName("§7Aktuell §8» §7Keine Spieler §8«").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
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());
break;
case "§8» §cSilentLobby §8«":
//change server
@ -185,16 +186,16 @@ public class LobbyInvClickManager implements Listener{
switch (materialName) {
case "§8» §9Rüstung §8«":
player.openInventory(ArmorInventory());
player.openInventory(ExtrasInventorys.getArmorInventory());
break;
case "§8» §aGadgets §8«":
player.openInventory(Gadgets());
player.openInventory(ExtrasInventorys.getGadgets());
break;
case "§8» §dPartikel §8«":
player.openInventory(Partikel());
player.openInventory(ExtrasInventorys.getPartikel());
break;
case "§8» §ePets §8«":
player.openInventory(Pets());
player.openInventory(ExtrasInventorys.getPets());
break;
}
return;
@ -205,34 +206,34 @@ public class LobbyInvClickManager implements Listener{
switch (materialName) {
case "§0LEDER":
player.getInventory().setHelmet(new ItemBuilder(Material.LEATHER_HELMET).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setDisplayName(" ").removeAllAtributs().build());
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":
player.getInventory().setHelmet(new ItemBuilder(Material.CHAINMAIL_HELMET).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setChestplate(new ItemBuilder(Material.CHAINMAIL_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setLeggings(new ItemBuilder(Material.CHAINMAIL_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setBoots(new ItemBuilder(Material.CHAINMAIL_BOOTS).setDisplayName(" ").removeAllAtributs().build());
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":
player.getInventory().setHelmet(new ItemBuilder(Material.IRON_HELMET).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setChestplate(new ItemBuilder(Material.IRON_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setLeggings(new ItemBuilder(Material.IRON_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setBoots(new ItemBuilder(Material.IRON_BOOTS).setDisplayName(" ").removeAllAtributs().build());
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":
player.getInventory().setHelmet(new ItemBuilder(Material.GOLD_HELMET).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setChestplate(new ItemBuilder(Material.GOLD_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setLeggings(new ItemBuilder(Material.GOLD_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setBoots(new ItemBuilder(Material.GOLD_BOOTS).setDisplayName(" ").removeAllAtributs().build());
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":
player.getInventory().setHelmet(new ItemBuilder(Material.DIAMOND_HELMET).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setChestplate(new ItemBuilder(Material.DIAMOND_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setLeggings(new ItemBuilder(Material.DIAMOND_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
player.getInventory().setBoots(new ItemBuilder(Material.DIAMOND_BOOTS).setDisplayName(" ").removeAllAtributs().build());
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());
player.getInventory().setBoots(new ItemBuilder(Material.DIAMOND_BOOTS).setDisplayName(" ").setUnbreakable(true).removeAllAtributs().build());
break;
}
return;
@ -251,21 +252,21 @@ public class LobbyInvClickManager implements Listener{
player.updateInventory();
break;
case "§cJetpack":
player.getInventory().setItem(5, new ItemBuilder(Material.ELYTRA).setDisplayName("§cJetpack").removeAllAtributs().build());
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").removeAllAtributs().build());
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").addEnchantment(Enchantment.DURABILITY, 1).removeAllAtributs().build());
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);
@ -277,89 +278,4 @@ public class LobbyInvClickManager implements Listener{
}
public Inventory ArmorInventory() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §9Rüstung §8«");
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(9, new ItemBuilder(Material.LEATHER_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(18, new ItemBuilder(Material.LEATHER_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(27, new ItemBuilder(Material.LEATHER_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(36, new ItemBuilder(Material.LEATHER_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(11, new ItemBuilder(Material.CHAINMAIL_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(20, new ItemBuilder(Material.CHAINMAIL_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(29, new ItemBuilder(Material.CHAINMAIL_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(38, new ItemBuilder(Material.CHAINMAIL_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(13, new ItemBuilder(Material.IRON_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(22, new ItemBuilder(Material.IRON_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(31, new ItemBuilder(Material.IRON_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(40, new ItemBuilder(Material.IRON_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(15, new ItemBuilder(Material.GOLD_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(24, new ItemBuilder(Material.GOLD_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(33, new ItemBuilder(Material.GOLD_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(42, new ItemBuilder(Material.GOLD_BOOTS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(17, new ItemBuilder(Material.DIAMOND_HELMET).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(26, new ItemBuilder(Material.DIAMOND_CHESTPLATE).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(35, new ItemBuilder(Material.DIAMOND_LEGGINGS).setDisplayName(" ").removeAllAtributs().build());
inv.setItem(44, new ItemBuilder(Material.DIAMOND_BOOTS).setDisplayName(" ").removeAllAtributs().build());
return inv;
}
public Inventory Gadgets() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §aGadgets §8«");
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());
return inv;
}
public Inventory Partikel() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §dPartikel §8«");
for(int i = 0; i < inv.getSize(); i++) {
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
}
//
return inv;
}
public Inventory Pets() {
Inventory inv = Bukkit.createInventory(null, 45, "§8» §ePets §8«");
for(int i = 0; i < inv.getSize(); i++) {
inv.setItem(i, new ItemBuilder(Material.STAINED_GLASS_PANE, (short)15).setDisplayName(" ").build());
}
//
return inv;
}
}

Datei anzeigen

@ -1,8 +1,8 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.main.LobbySystem;
import de.diamant.hunjy.manager.BackendManager;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.LobbySystem;
import de.warking.lobby.manager.BackendManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

Datei anzeigen

@ -0,0 +1,42 @@
package de.warking.lobby.listener;
import de.warking.lobby.LobbySystem;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
public class PlayerMoveListener implements Listener {
private static Location location = LobbySystem.getInstance().getLocationManager().loadLocation("main.lobby");
private static int minX = LobbySystem.getInstance().getFileManager().getIntegerFromConfig("WorldMaxRadius.minX");
private static int minY = LobbySystem.getInstance().getFileManager().getIntegerFromConfig("WorldMaxRadius.minY");
private static int minZ = LobbySystem.getInstance().getFileManager().getIntegerFromConfig("WorldMaxRadius.minZ");
private static int maxX = LobbySystem.getInstance().getFileManager().getIntegerFromConfig("WorldMaxRadius.maxX");
private static int maxY = LobbySystem.getInstance().getFileManager().getIntegerFromConfig("WorldMaxRadius.maxY");
private static int maxZ = LobbySystem.getInstance().getFileManager().getIntegerFromConfig("WorldMaxRadius.maxZ");
@EventHandler
public void handlePlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
if(player.getLocation().getY() < 100)
player.teleport(location);
Location playerLocation = player.getLocation();
int x = playerLocation.getBlockX();
int y = playerLocation.getBlockY();
int z = playerLocation.getBlockZ();
if(x <= minX
|| x >= maxX
|| y <= minY
|| y >= maxY
|| z <= minZ
|| z >= maxZ)
player.teleport(location);
}
}

Datei anzeigen

@ -0,0 +1,15 @@
package de.warking.lobby.listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
public class PlayerQuitListener implements Listener {
@EventHandler
public void handlePlayerQuit(PlayerQuitEvent event) {
event.setQuitMessage("");
}
}

Datei anzeigen

@ -1,8 +1,8 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.main.LobbySystem;
import de.diamant.hunjy.utils.ItemBuilder;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.LobbySystem;
import de.warking.lobby.utils.ItemBuilder;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.EnderPearl;

Datei anzeigen

@ -1,6 +1,6 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.manager.BackendManager;
import de.warking.lobby.manager.BackendManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

Datei anzeigen

@ -1,7 +1,7 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.LobbySystem;
import org.bukkit.Effect;
import org.bukkit.Sound;
import org.bukkit.entity.Player;

Datei anzeigen

@ -1,7 +1,7 @@
package de.diamant.hunjy.listener;
package de.warking.lobby.listener;
import de.diamant.hunjy.gadgets.Gadget;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.gadgets.Gadget;
import de.warking.lobby.LobbySystem;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

Datei anzeigen

@ -1,6 +1,6 @@
package de.diamant.hunjy.manager;
package de.warking.lobby.manager;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.LobbySystem;
import org.bukkit.entity.Player;
import java.util.ArrayList;

Datei anzeigen

@ -1,11 +1,11 @@
package de.diamant.hunjy.manager;
package de.warking.lobby.manager;
import java.io.File;
import java.io.IOException;
import org.bukkit.configuration.file.FileConfiguration;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.LobbySystem;
public class FileManager {

Datei anzeigen

@ -1,4 +1,4 @@
package de.diamant.hunjy.manager;
package de.warking.lobby.manager;
import java.io.File;
import java.io.IOException;
@ -8,7 +8,7 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.YamlConfiguration;
import de.diamant.hunjy.main.LobbySystem;
import de.warking.lobby.LobbySystem;
public class LocationManager {

Datei anzeigen

@ -1,4 +1,4 @@
package de.diamant.hunjy.utils;
package de.warking.lobby.utils;
import java.util.ArrayList;
@ -58,4 +58,9 @@ public class ItemBuilder {
return item;
}
public ItemBuilder setUnbreakable(boolean unbreakable) {
meta.setUnbreakable(unbreakable);
return this;
}
}

Datei anzeigen

@ -1,9 +1,8 @@
name: LobbySystem
version: 1.0
author: hunjy
main: de.diamant.hunjy.main.LobbySystem
author: [hunjy, Yaruma3341]
depend: [CoreSystem]
main: de.warking.lobby.LobbySystem
commands:
setlocation: