1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-10-03 09:31:57 +02:00

Ess2Compat: Convert user files

This commit is contained in:
snowleo
2012-11-03 02:36:17 +01:00
parent 59878a94e4
commit 83fefefb43
6 changed files with 1082 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.storage.StoredLocation;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
@@ -238,19 +239,14 @@ public class EssentialsConf extends YamlConfiguration
return isSet(path);
}
public Location getLocation(final String path, final Server server) throws Exception
public StoredLocation getLocation(final String path, final Server server) throws Exception
{
final String worldName = getString((path == null ? "" : path + ".") + "world");
if (worldName == null || worldName.isEmpty())
{
return null;
}
final World world = server.getWorld(worldName);
if (world == null)
{
throw new Exception(_("invalidWorld"));
}
return new Location(world,
return new StoredLocation(worldName,
getDouble((path == null ? "" : path + ".") + "x", 0),
getDouble((path == null ? "" : path + ".") + "y", 0),
getDouble((path == null ? "" : path + ".") + "z", 0),