Newlines in Config?

Discussion in 'Plugin Development' started by mattrick, Sep 2, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    mattrick

    Is there any way to have newlines to config? Sorry for being vauge..... Here is my code:
    Code:
    public class CommandExecutorClass implements CommandExecutor{
        public Blocktionary plugin;
         
        public CommandExecutorClass(Blocktionary plugin){
                this.plugin = plugin;
        }
        @Override
        public boolean onCommand(CommandSender sender, Command command,String label, String[] args) {
            if (sender instanceof Player) {
                  Player player = (Player) sender;
                  if (command.getName().equalsIgnoreCase("buildspawn")){
                      Location loc = player.getLocation();
                      FileConfiguration config = plugin.getConfig();
                      config.set("Loc.world" , loc.getWorld().getName());
                      config.set("Loc.x" , loc.getX());
                      config.set("Loc.y" , loc.getY());
                      config.set("Loc.z" , loc.getZ());;
                      plugin.saveConfig();
                      sender.sendMessage("Set builder spawnpoint to §6 X: "+loc.getX()+" Y: "+loc.getY()+" Z: "+loc.getZ()+"§f in world §6" + loc.getWorld().getName());
                  }
                } else {
                  sender.sendMessage("Only players can run this command!");
                  return false;
                }
                return false;
        }
     
    }
     
Thread Status:
Not open for further replies.

Share This Page