Advertisement
Guest User

Untitled

a guest
May 26th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @EventHandler
  2. public void onLobbyClick(PlayerInteractEvent e) {
  3. Player p = e.getPlayer();
  4. if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
  5. if (e.getClickedBlock().getType() == Material.WALL_SIGN || e.getClickedBlock().getType() == Material.SIGN_POST) {
  6. final Sign sign = (Sign) e.getClickedBlock().getState();
  7. if (sign.getLine(0).contains("§8[§6Lobby§8]")) {
  8. String key = sign.getLine(1);
  9. final String world = plugin.getConfig().getString("lobbys." + key + ".LobbyWorld");
  10. p.teleport(new Location(Bukkit.getWorld(world), -27.5, 46, -27.5));
  11.  
  12. }
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement