Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onTeleport(PlayerJoinEvent e){
- Player p = e.getPlayer();
- File file = new File("plugins/Lobby", "lobby.yml");
- FileConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- String str = "primepvp.lobby.";
- try {
- World w = Bukkit.getWorld(cfg.getString(str + "world"));
- if (w == null) {
- p.sendMessage("§cUnknown World!");
- return;
- }
- double x = cfg.getDouble(str + "x");
- double y = cfg.getDouble(str + "y");
- double z = cfg.getDouble(str + "z");
- double yaw = cfg.getDouble(str + "yaw");
- double pitch = cfg.getDouble(str + "pitch");
- Location loc = new Location(w, x, y, z, (float)yaw, (float)pitch);
- p.teleport(loc);
- p.sendMessage(main.pr+"§eDu befindest dich nun in der Lobby.");
- } catch (Exception e) {
- p.sendMessage(main.pr+"§eSetze zuerst den Lobbypunkt!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement