SHARE
TWEET

Untitled

a guest Nov 17th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.einfachbauen.hubundportalplugin;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Location;
  5. import org.bukkit.World;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.event.EventHandler;
  8. import org.bukkit.event.Listener;
  9. import org.bukkit.event.player.PlayerJoinEvent;
  10.  
  11. public class onJoinEvent implements Listener {
  12.  
  13.     private Main plugin;
  14.     onJoinEvent(Main instance) {
  15.         plugin = instance;
  16.     }
  17.  
  18.     @EventHandler
  19.     public void onJoin(PlayerJoinEvent e) {
  20.         Player p = e.getPlayer();
  21.         e.setJoinMessage(null);
  22.         World w = Bukkit.getServer().getWorld(plugin.getConfig().getString("config.spawn.world"));
  23.         double x = plugin.getConfig().getDouble("config.spawn.x");
  24.         double y = plugin.getConfig().getDouble("config.spawn.y");
  25.         double z = plugin.getConfig().getDouble("config.spawn.z");
  26.         float yaw = (float) plugin.getConfig().getDouble("config.spawn.yaw");
  27.         int pitch = (int) plugin.getConfig().getDouble("config.spawn.pitch");
  28.         p.teleport(new Location(w, x, y, z, yaw, pitch));
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top