SHARE
TWEET

Untitled

a guest May 25th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.dave_911.Lobby.Commands;
  2.  
  3. import java.io.IOException;
  4.  
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandExecutor;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.entity.Player;
  9.  
  10. import de.dave_911.Lobby.Lobby;
  11.  
  12. public class SetSpawnCommand implements CommandExecutor {
  13.  
  14.     public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
  15.  
  16.         if (!(sender instanceof Player)) {
  17.             sender.sendMessage(Lobby.prefix + "§cDu musst ein Spieler sein, um diesen Befehl zu verwenden.");
  18.             return true;
  19.         }
  20.  
  21.         Player p = (Player) sender;
  22.  
  23.         if (p.hasPermission("lobby.administrator")) {
  24.             if (args.length == 0) {
  25.                 Lobby.cfg.set("Spawn.World", p.getWorld().getName());
  26.                 Lobby.cfg.set("Spawn.X", Double.valueOf(p.getLocation().getX()));
  27.                 Lobby.cfg.set("Spawn.Y", Double.valueOf(p.getLocation().getY()));
  28.                 Lobby.cfg.set("Spawn.Z", Double.valueOf(p.getLocation().getZ()));
  29.                 Lobby.cfg.set("Spawn.Yaw", Double.valueOf(p.getLocation().getYaw()));
  30.                 Lobby.cfg.set("Spawn.Pitch", Double.valueOf(p.getLocation().getPitch()));
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