// <Index = 1> @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player p = event.getPlayer(); String pName = p.getName(); event.setJoinMessage(ChatMessages.WHITE + pName + ChatMessages.joinMessage); if (!ScoreboardHandler.isOnBoard(p)) ScoreboardHandler.initPlayer(p); if (Main.lobbyBoolean) ScoreboardHandler.hide(p); else ScoreboardHandler.sendBoard(p); Main.playerClasses.put(pName, "default"); p.setGameMode(GameMode.SURVIVAL); InventoryClear.clear(p); p.sendMessage(" "); p.sendMessage(ChatMessages.welcomeMessage); p.sendMessage(ChatMessages.welcomeMessage2); p.sendMessage(" "); p.sendMessage(ChatMessages.alphaTestMessage1); p.sendMessage(ChatMessages.alphaTestMessage2); p.sendMessage(" "); Healer.simulateRespawn(p); if (Main.lobbyBoolean == true) { plugin.teleportHandle.teleportServerLobby(p); } else { plugin.teleportHandle.teleportToMapLobby(p); p.sendMessage(ChatMessages.selectedMapIs.replace("%%MAP%%", Main.selectedMap)); } }
// <Index = 4> @EventHandler public void onPlayerRespawn(PlayerRespawnEvent event) { Player p = event.getPlayer(); double x = plugin.getConfig().getInt("maps." + Main.selectedMap + ".lobby.x"); double y = plugin.getConfig().getInt("maps." + Main.selectedMap + ".lobby.y"); double z = plugin.getConfig().getInt("maps." + Main.selectedMap + ".lobby.z"); float yaw = plugin.getConfig().getInt("maps." + Main.selectedMap + ".lobby.yaw"); float pitch = plugin.getConfig().getInt("maps." + Main.selectedMap + ".lobby.pitch"); World world = Bukkit.getServer().getWorld(Main.selectedMap); Location spawn = new Location(world, x, y, z, yaw, pitch); event.setRespawnLocation(spawn); p.teleport(spawn); InventoryClear.clear(p); Healer.simulateRespawn(p); p.sendMessage(ChatMessages.selectedMapIs.replace("%%MAP%%", Main.selectedMap)); }