/*
 * Copyright (c) 2015 Demigods RPG
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.demigodsrpg.demigames.impl.util;

import org.bukkit.Bukkit;
import org.bukkit.Location;

public class LocationUtil {
    public static String stringFromLocation(Location location) {
        return location.getWorld().getName() + ";" + location.getX() + ";" + location.getY() + ";" + location.getZ() + ";" + location.getYaw() + ";" + location.getPitch();
    }

    public static Location locationFromString(String location) {
        String[] part = location.split(";");
        if (Bukkit.getWorld(part[0]) != null) {
            return new Location(Bukkit.getWorld(part[0]), Double.parseDouble(part[1]), Double.parseDouble(part[2]), Double.parseDouble(part[3]), Float.parseFloat(part[4]), Float.parseFloat(part[4]));
        }
        return null;
    }
}
@@ -1157,16 +1157,66 @@
 .util;%0A%0A
+import com.demigodsrpg.demigames.session.Session;%0A
 import o
@@ -1355,64 +1355,262 @@
 tion
-) %7B%0A        return location.getWorld().getName() + %22;%22 +
+, boolean blockLocation) %7B%0A        if (blockLocation) %7B%0A            return location.getBlockX() + %22.0%22 + %22;%22 + location.getBlockY() + %22.0%22 + %22;%22 + location.getBlockZ() + %22.0%22 + %22;%22 + location.getYaw() + %22;%22 + location.getPitch();%0A        %7D%0A        return
  loc
@@ -1778,16 +1778,33 @@
 mString(
+Session session, 
 String l
@@ -1887,23 +1887,31 @@
 etWorld(
-part%5B0%5D
+session.getId()
 ) != nul
@@ -1963,16 +1963,53 @@
 etWorld(
+session.getId()), Double.parseDouble(
 part%5B0%5D)
@@ -2071,37 +2071,8 @@
 2%5D),
- Double.parseDouble(part%5B3%5D),
  Flo
@@ -2090,17 +2090,17 @@
 at(part%5B
-4
+3
 %5D), Floa

Add more stuff to LocationUtil.