diff --git a/src/de/steamwar/lobby/LobbySystem.java b/src/de/steamwar/lobby/LobbySystem.java index 9074671..91743df 100644 --- a/src/de/steamwar/lobby/LobbySystem.java +++ b/src/de/steamwar/lobby/LobbySystem.java @@ -54,8 +54,8 @@ public class LobbySystem extends JavaPlugin { new DoubleJumpListener(); new ElytraListener(); new ParticleListener(); - new PlayerInventoryListener(); - new PlayerWorldInteractionListener(); + new InventoryInteraction(); + new WorldInteraction(); new WorldBorder(); } diff --git a/src/de/steamwar/lobby/command/DebugCommand.java b/src/de/steamwar/lobby/command/DebugCommand.java index 06b7342..4d87b04 100644 --- a/src/de/steamwar/lobby/command/DebugCommand.java +++ b/src/de/steamwar/lobby/command/DebugCommand.java @@ -24,6 +24,7 @@ import de.steamwar.lobby.LobbySystem; import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; import org.bukkit.GameMode; +import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -34,9 +35,9 @@ import java.util.Set; public class DebugCommand extends SWCommand implements Listener { - private static final Set debugMode = new HashSet<>(); + private static final Set debugMode = new HashSet<>(); - public static boolean debugging(Player player) { + public static boolean debugging(HumanEntity player) { return debugMode.contains(player); } diff --git a/src/de/steamwar/lobby/inventories/LobbyInventory.java b/src/de/steamwar/lobby/inventories/LobbyInventory.java deleted file mode 100644 index 4ab69c6..0000000 --- a/src/de/steamwar/lobby/inventories/LobbyInventory.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2022 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.lobby.inventories; - -import de.steamwar.lobby.util.ItemBuilder; -import de.steamwar.lobby.util.LobbyPlayer; -import org.bukkit.Material; -import org.bukkit.entity.Player; - -public class LobbyInventory { - - private LobbyInventory() {} - - public static final Material PARTICLE = Material.NAME_TAG; - public static final Material ELYTRA_USED = Material.FIREWORK_STAR; - public static final Material ELYTRA_READY = Material.ELYTRA; - - public static void givePlayerLobbyItems(Player player) { - - LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player.getUniqueId()); - - player.getInventory().setItem(3, new ItemBuilder(lobbyPlayer.isFlyingElytra() ? ELYTRA_USED : ELYTRA_READY) - .setDisplayName("§5Elytra") - .setUnbreakable(true) - .removeAllAtributs() - .build()); - - if(lobbyPlayer.isFlyingElytra()) { - player.getInventory().setItem(4, - new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build()); - } - - player.getInventory().setItem(5, new ItemBuilder(PARTICLE) - .setDisplayName("§6Partikel") - .setUnbreakable(true) - .removeAllAtributs() - .build()); - } - -} diff --git a/src/de/steamwar/lobby/listener/ElytraListener.java b/src/de/steamwar/lobby/listener/ElytraListener.java index 8b3ba8c..dac82f2 100644 --- a/src/de/steamwar/lobby/listener/ElytraListener.java +++ b/src/de/steamwar/lobby/listener/ElytraListener.java @@ -19,17 +19,12 @@ package de.steamwar.lobby.listener; -import de.steamwar.lobby.inventories.LobbyInventory; import de.steamwar.lobby.util.LobbyPlayer; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerMoveEvent; -import org.bukkit.inventory.ItemStack; public class ElytraListener extends BasicListener { @@ -38,7 +33,7 @@ public class ElytraListener extends BasicListener { Player player = event.getPlayer(); LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player); - if (event.getMaterial() != LobbyInventory.ELYTRA_READY) return; + /*if (event.getMaterial() != LobbyInventory.ELYTRA_READY) return; if(!lobbyPlayer.isFlyingElytra()) { player.getInventory().setChestplate(new ItemStack(Material.ELYTRA)); @@ -47,18 +42,18 @@ public class ElytraListener extends BasicListener { player.setGliding(true); lobbyPlayer.setFlyingElytra(true); LobbyInventory.givePlayerLobbyItems(player); - } + }*/ } @EventHandler public void onMove(PlayerMoveEvent event) { - Player player = event.getPlayer(); + /*Player player = event.getPlayer(); LobbyPlayer lobbyPlayer = LobbyPlayer.getLobbyPlayer(player); if(lobbyPlayer.isFlyingElytra() && player.isOnGround()) { lobbyPlayer.setFlyingElytra(false); player.getInventory().clear(); LobbyInventory.givePlayerLobbyItems(player); - } + }*/ } } diff --git a/src/de/steamwar/lobby/listener/PlayerInventoryListener.java b/src/de/steamwar/lobby/listener/InventoryInteraction.java similarity index 70% rename from src/de/steamwar/lobby/listener/PlayerInventoryListener.java rename to src/de/steamwar/lobby/listener/InventoryInteraction.java index 782fdb2..8f3eb89 100644 --- a/src/de/steamwar/lobby/listener/PlayerInventoryListener.java +++ b/src/de/steamwar/lobby/listener/InventoryInteraction.java @@ -19,14 +19,27 @@ package de.steamwar.lobby.listener; +import de.steamwar.lobby.command.DebugCommand; +import org.bukkit.Material; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerSwapHandItemsEvent; -public class PlayerInventoryListener extends BasicListener { +public class InventoryInteraction extends BasicListener { + + @EventHandler(priority = EventPriority.LOW) + public void handlePlayerInteract(PlayerInteractEvent event) { + if(event.getItem() == null) return; + if (event.getItem().getType() == Material.FIREWORK_ROCKET) { + event.getItem().setAmount(2); + return; + } + event.setCancelled(true); + } @EventHandler public void handlePlayerDropItem(PlayerDropItemEvent event) { @@ -40,12 +53,14 @@ public class PlayerInventoryListener extends BasicListener { @EventHandler(priority = EventPriority.LOWEST) public void handleInventoryClick(InventoryClickEvent event) { - event.setCancelled(true); + if(!DebugCommand.debugging(event.getWhoClicked())) + event.setCancelled(true); } @EventHandler public void handlePlayerSwapHandItemsEvent(PlayerSwapHandItemsEvent event) { - event.setCancelled(true); + if(!DebugCommand.debugging(event.getPlayer())) + event.setCancelled(true); } } diff --git a/src/de/steamwar/lobby/listener/ParticleListener.java b/src/de/steamwar/lobby/listener/ParticleListener.java index 19f9382..9d37e92 100644 --- a/src/de/steamwar/lobby/listener/ParticleListener.java +++ b/src/de/steamwar/lobby/listener/ParticleListener.java @@ -20,8 +20,7 @@ package de.steamwar.lobby.listener; import de.steamwar.lobby.LobbySystem; -import de.steamwar.lobby.inventories.LobbyInventory; -import de.steamwar.lobby.inventories.ParticleInventory; +import de.steamwar.lobby.particle.ParticleInventory; import de.steamwar.lobby.particle.SpecialParticle; import de.steamwar.lobby.util.LobbyPlayer; import org.bukkit.Bukkit; @@ -45,7 +44,7 @@ public class ParticleListener extends BasicListener { @EventHandler(priority = EventPriority.NORMAL) public void handlePlayerInteract(PlayerInteractEvent event) { Player player = event.getPlayer(); - if (event.getMaterial() != LobbyInventory.PARTICLE) return; + if (!PlayerSpawn.PARTICLE.equals(event.getItem())) return; ParticleInventory.openParticleInventory(player); } diff --git a/src/de/steamwar/lobby/listener/PlayerSpawn.java b/src/de/steamwar/lobby/listener/PlayerSpawn.java index 7466fca..278ed8b 100644 --- a/src/de/steamwar/lobby/listener/PlayerSpawn.java +++ b/src/de/steamwar/lobby/listener/PlayerSpawn.java @@ -21,18 +21,22 @@ package de.steamwar.lobby.listener; import de.steamwar.comms.packets.ImALobbyPacket; import de.steamwar.lobby.LobbySystem; -import de.steamwar.lobby.inventories.LobbyInventory; +import de.steamwar.lobby.util.ItemBuilder; import org.bukkit.Bukkit; import org.bukkit.GameMode; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; public class PlayerSpawn extends BasicListener { - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGH) public void onJoin(PlayerJoinEvent e) { Player player = e.getPlayer(); e.setJoinMessage(null); @@ -41,13 +45,26 @@ public class PlayerSpawn extends BasicListener { player.setGameMode(GameMode.ADVENTURE); player.setWalkSpeed(0.5f); player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation()); - LobbyInventory.givePlayerLobbyItems(player); player.setHealth(20); player.setFoodLevel(20); + giveItems(player); Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> new ImALobbyPacket().send(player), 20); } + private static final ItemStack ELYTRA = new ItemBuilder(Material.ELYTRA).setDisplayName("§5Elytra").setUnbreakable(true).removeAllAttributes().build(); + public static final ItemStack PARTICLE = new ItemBuilder(Material.NAME_TAG).setDisplayName("§6Partikel").setUnbreakable(true).removeAllAttributes().build(); + + private void giveItems(Player player) { + PlayerInventory inventory = player.getInventory(); + + inventory.setItem(EquipmentSlot.CHEST, ELYTRA); + + player.getInventory().setItem(4, new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build()); + + player.getInventory().setItem(5, PARTICLE); + } + @EventHandler(priority = EventPriority.HIGH) public void handlePlayerQuit(PlayerQuitEvent event) { event.setQuitMessage(null); diff --git a/src/de/steamwar/lobby/listener/PlayerWorldInteractionListener.java b/src/de/steamwar/lobby/listener/WorldInteraction.java similarity index 59% rename from src/de/steamwar/lobby/listener/PlayerWorldInteractionListener.java rename to src/de/steamwar/lobby/listener/WorldInteraction.java index ee6df31..180f6db 100644 --- a/src/de/steamwar/lobby/listener/PlayerWorldInteractionListener.java +++ b/src/de/steamwar/lobby/listener/WorldInteraction.java @@ -19,24 +19,16 @@ package de.steamwar.lobby.listener; -import org.bukkit.Material; +import de.steamwar.lobby.command.DebugCommand; +import org.bukkit.entity.HumanEntity; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; +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.PlayerInteractEvent; +import org.bukkit.event.hanging.HangingBreakByEntityEvent; -public class PlayerWorldInteractionListener extends BasicListener { - - @EventHandler(priority = EventPriority.LOW) - public void handlePlayerInteract(PlayerInteractEvent event) { - if(event.getItem() == null) return; - if (event.getItem().getType() == Material.FIREWORK_ROCKET) { - event.getItem().setAmount(2); - return; - } - event.setCancelled(true); - } +public class WorldInteraction extends BasicListener { @EventHandler public void handleEntityDamage(EntityDamageEvent event) { @@ -47,5 +39,23 @@ public class PlayerWorldInteractionListener extends BasicListener { public void handleFoodLevelChange(FoodLevelChangeEvent event) { event.setCancelled(true); } + + @EventHandler + public void handleBlockBreak(BlockBreakEvent event) { + if(!DebugCommand.debugging(event.getPlayer())) + event.setCancelled(true); + } + + @EventHandler + public void handleBlockPlace(BlockPlaceEvent event) { + if(!DebugCommand.debugging(event.getPlayer())) + event.setCancelled(true); + } + + @EventHandler + public void handleHangingBreak(HangingBreakByEntityEvent event) { + if(!DebugCommand.debugging((HumanEntity) event.getRemover())) + event.setCancelled(true); + } } diff --git a/src/de/steamwar/lobby/inventories/EventParticle.java b/src/de/steamwar/lobby/particle/EventParticle.java similarity index 59% rename from src/de/steamwar/lobby/inventories/EventParticle.java rename to src/de/steamwar/lobby/particle/EventParticle.java index bd42f8e..2268766 100644 --- a/src/de/steamwar/lobby/inventories/EventParticle.java +++ b/src/de/steamwar/lobby/particle/EventParticle.java @@ -1,7 +1,7 @@ /* * This file is a part of the SteamWar software. * - * Copyright (C) 2022 SteamWar.de-Serverteam + * Copyright (C) 2021 SteamWar.de-Serverteam * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,18 +17,17 @@ * along with this program. If not, see . */ -package de.steamwar.lobby.inventories; +package de.steamwar.lobby.particle; -import de.steamwar.lobby.particle.*; import org.bukkit.Material; import org.bukkit.Particle; public enum EventParticle { - WarGearSeason(22, new int[]{12, 285, 54}, new CloudCircleParticle(Material.ENCHANTING_TABLE, "§cVerzaubert", ParticleInventory.loreBuilder(new String[]{"Wolke", "Ring"}, "WarGearSeason Event 1., 2. oder 3. Platz"), Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0)), new SimpleParticle(Material.BOOK, "§5Verzaubert", ParticleInventory.loreBuilder(new String[0], "WarGearSeason Event"), Particle.ENCHANTMENT_TABLE)), - AirshipEvent(26, new int[]{205, 9, 54, 120, 292}, new CircleParticle(Material.SNOWBALL, "§fCloud", ParticleInventory.loreBuilder(new String[]{"Ring"}, "AirshipEvent Event 1., 2. oder 3. Platz"), Particle.CLOUD, null, location -> location.add(0, 2.2, 0)), new SimpleParticle(Material.SNOW_BLOCK, "§fCloud", ParticleInventory.loreBuilder(new String[0], "AirshipEvent Event"), Particle.CLOUD)), - HellsBellsWs(28, new int[]{205, 9, 11}, new CloudCircleParticle(Material.TNT_MINECART, "§7Smoke", ParticleInventory.loreBuilder(new String[]{"Wolke", "Ring"}, "HellsBells Event 1., 2. oder 3. Platz"), Particle.CAMPFIRE_COSY_SMOKE, location -> location.add(0, 2.2, 0)), new CircleParticle(Material.TNT, "§8Smoke", ParticleInventory.loreBuilder(new String[]{"Ring"}, "HellsBells Event"), Particle.CAMPFIRE_COSY_SMOKE, null, location -> location, 0, 0, 0, 0.01)), - Underwater(31, new int[]{9, 210, 520}, new CloudParticle(Material.PRISMARINE_CRYSTALS, "§bWasser", ParticleInventory.loreBuilder(new String[]{"Wolke"}, "Underwater Event 1., 2. oder 3. Platz"), Particle.DRIP_WATER), new SimpleParticle(Material.PRISMARINE_BRICKS, "§bWasser", ParticleInventory.loreBuilder(new String[0], "Underwater Event"), Particle.DRIP_WATER)); + WarGearSeason(22, new int[]{12, 285, 54}, new CloudCircleParticle(Material.ENCHANTING_TABLE, "§cVerzaubert", ParticleInventory.loreBuilder(new String[]{"Wolke", "Ring"}, "WarGearSeason 1., 2. oder 3. Platz"), Particle.ENCHANTMENT_TABLE, location -> location.add(0, 1.1, 0)), new SimpleParticle(Material.BOOK, "§5Verzaubert", ParticleInventory.loreBuilder(new String[0], "WarGearSeason"), Particle.ENCHANTMENT_TABLE)), + AirshipEvent(26, new int[]{205, 9, 54, 120, 292}, new CircleParticle(Material.SNOWBALL, "§fCloud", ParticleInventory.loreBuilder(new String[]{"Ring"}, "AirshipEvent 1., 2. oder 3. Platz"), Particle.CLOUD, null, location -> location.add(0, 2.2, 0)), new SimpleParticle(Material.SNOW_BLOCK, "§fCloud", ParticleInventory.loreBuilder(new String[0], "AirshipEvent"), Particle.CLOUD)), + HellsBellsWs(28, new int[]{205, 9, 11}, new CloudCircleParticle(Material.TNT_MINECART, "§7Smoke", ParticleInventory.loreBuilder(new String[]{"Wolke", "Ring"}, "HellsBells 1., 2. oder 3. Platz"), Particle.CAMPFIRE_COSY_SMOKE, location -> location.add(0, 2.2, 0)), new CircleParticle(Material.TNT, "§8Smoke", ParticleInventory.loreBuilder(new String[]{"Ring"}, "HellsBells"), Particle.CAMPFIRE_COSY_SMOKE, null, location -> location, 0, 0, 0, 0.01)), + Underwater(31, new int[]{9, 210, 520}, new CloudParticle(Material.PRISMARINE_CRYSTALS, "§bWasser", ParticleInventory.loreBuilder(new String[]{"Wolke"}, "Underwater 1., 2. oder 3. Platz"), Particle.DRIP_WATER), new SimpleParticle(Material.PRISMARINE_BRICKS, "§bWasser", ParticleInventory.loreBuilder(new String[0], "Underwater"), Particle.DRIP_WATER)); public static EventParticle[] eventParticles = values(); diff --git a/src/de/steamwar/lobby/inventories/ParticleInventory.java b/src/de/steamwar/lobby/particle/ParticleInventory.java similarity index 97% rename from src/de/steamwar/lobby/inventories/ParticleInventory.java rename to src/de/steamwar/lobby/particle/ParticleInventory.java index dd5d7c4..33a7771 100644 --- a/src/de/steamwar/lobby/inventories/ParticleInventory.java +++ b/src/de/steamwar/lobby/particle/ParticleInventory.java @@ -1,7 +1,7 @@ /* * This file is a part of the SteamWar software. * - * Copyright (C) 2022 SteamWar.de-Serverteam + * Copyright (C) 2021 SteamWar.de-Serverteam * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,19 +17,24 @@ * along with this program. If not, see . */ -package de.steamwar.lobby.inventories; +package de.steamwar.lobby.particle; import de.steamwar.inventory.SWInventory; import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWListInv; -import de.steamwar.lobby.particle.*; import de.steamwar.lobby.util.LobbyPlayer; -import de.steamwar.sql.*; +import de.steamwar.sql.Event; +import de.steamwar.sql.SteamwarUser; +import de.steamwar.sql.TeamTeilnahme; +import de.steamwar.sql.UserGroup; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.entity.Player; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.stream.Collectors; public class ParticleInventory { @@ -47,7 +52,7 @@ public class ParticleInventory { static { List defaultLore = loreBuilder(null, null); - List teamLore = loreBuilder(null, "Team beitritt"); + List teamLore = loreBuilder(null, "Teambeitritt"); List serverTeamLore = loreBuilder(null, "Serverteam"); List serverTeamLore_C = loreBuilder(new String[]{"Wolke"}, "Serverteam"); List serverTeamLore_R = loreBuilder(new String[]{"Ring"}, "Serverteam"); @@ -158,6 +163,7 @@ public class ParticleInventory { SWListInv particleSWListInv = new SWListInv<>(player, "§6Partikel", false, particleList, (clickType, particle) -> { if (particle == null) return; lobbyPlayer.setParticle(particle); + player.closeInventory(); }); particleSWListInv.setItem(49, Material.BARRIER, "§8Keine Partikel", new ArrayList<>(), false, clickType -> { lobbyPlayer.setParticle(null); diff --git a/src/de/steamwar/lobby/portal/CommandPortal.java b/src/de/steamwar/lobby/portal/CommandPortal.java index 20734fa..53e66f3 100644 --- a/src/de/steamwar/lobby/portal/CommandPortal.java +++ b/src/de/steamwar/lobby/portal/CommandPortal.java @@ -20,12 +20,14 @@ package de.steamwar.lobby.portal; import de.steamwar.comms.packets.ExecuteCommandPacket; +import de.steamwar.lobby.LobbySystem; import de.steamwar.lobby.listener.Portals; import org.bukkit.Location; import org.bukkit.entity.Player; import java.util.Deque; import java.util.Map; +import java.util.logging.Level; public class CommandPortal implements PortalHandler { @@ -55,7 +57,8 @@ public class CommandPortal implements PortalHandler { String[] pieces = new String[stackIds.length]; while (maxId > 0) { if(stack.isEmpty()) { - player.sendMessage("Fehlende Stackinhalte für den command"); + LobbySystem.getPlugin().getLogger().log(Level.WARNING, "Stackportal with missing elements: " + player.getName() + " /" + command); + player.sendMessage("§cEigentlich solltest du gerade gar nicht durch dieses Portal durchgehen können..."); return; } diff --git a/src/de/steamwar/lobby/portal/TeleportPortal.java b/src/de/steamwar/lobby/portal/TeleportPortal.java index fd0fe9c..e4e3ba5 100644 --- a/src/de/steamwar/lobby/portal/TeleportPortal.java +++ b/src/de/steamwar/lobby/portal/TeleportPortal.java @@ -19,12 +19,15 @@ package de.steamwar.lobby.portal; +import de.steamwar.lobby.LobbySystem; +import de.steamwar.lobby.command.DebugCommand; import de.steamwar.lobby.listener.Portals; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; import java.util.*; +import java.util.logging.Level; public class TeleportPortal implements PortalHandler { @@ -65,10 +68,12 @@ public class TeleportPortal implements PortalHandler { private void teleport(Player player, Location to, Portal target) { if(target == null) { - player.sendMessage("teleport " + portal.getId() + " -> UNKNOWN"); + LobbySystem.getPlugin().getLogger().log(Level.WARNING, "Portal with unknown target: " + portal.getId()); + player.sendMessage("§cAus unbekannten Gründen führt dieses Portal zurzeit in den Limbus"); return; } - player.sendMessage("teleport " + portal.getId() + " -> " + target.getId()); + if(DebugCommand.debugging(player)) + player.sendMessage("teleport " + portal.getId() + " -> " + target.getId()); player.teleport(target.denormalize(portal.normalize(to)).toLocation(to.getWorld(), (float) (to.getYaw() - Math.toDegrees(target.getYrotation() - portal.getYrotation())), to.getPitch()), PlayerTeleportEvent.TeleportCause.PLUGIN); } diff --git a/src/de/steamwar/lobby/util/ItemBuilder.java b/src/de/steamwar/lobby/util/ItemBuilder.java index e512cde..06e1cd8 100644 --- a/src/de/steamwar/lobby/util/ItemBuilder.java +++ b/src/de/steamwar/lobby/util/ItemBuilder.java @@ -25,12 +25,12 @@ import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import java.util.ArrayList; +import java.util.List; public class ItemBuilder { - private ItemStack item; - private ItemMeta meta; + private final ItemStack item; + private final ItemMeta meta; public ItemBuilder(Material matrial) { item = new ItemStack(matrial); @@ -42,12 +42,8 @@ public class ItemBuilder { item = new ItemStack(matrial, amount); meta = item.getItemMeta(); } - public ItemBuilder(Material matrial, short subid) { - item = new ItemStack(matrial, 1, subid); - meta = item.getItemMeta(); - } - public ItemBuilder removeAllAtributs() { + public ItemBuilder removeAllAttributes() { meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); meta.addItemFlags(ItemFlag.HIDE_DESTROYS); meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE); @@ -62,7 +58,7 @@ public class ItemBuilder { return this; } - public ItemBuilder addLore(ArrayList lore) { + public ItemBuilder addLore(List lore) { meta.setLore(lore); return this; } diff --git a/src/de/steamwar/lobby/util/LobbyPlayer.java b/src/de/steamwar/lobby/util/LobbyPlayer.java index f20ff34..ed0a018 100644 --- a/src/de/steamwar/lobby/util/LobbyPlayer.java +++ b/src/de/steamwar/lobby/util/LobbyPlayer.java @@ -20,8 +20,6 @@ package de.steamwar.lobby.util; import de.steamwar.lobby.particle.SpecialParticle; -import lombok.Getter; -import lombok.Setter; import org.bukkit.entity.Player; import java.util.HashMap; @@ -34,10 +32,6 @@ public class LobbyPlayer { private SpecialParticle specialParticle; - @Getter - @Setter - private boolean flyingElytra; - private boolean fly; private LobbyPlayer(UUID uuid) {