mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 20:11:21 +02:00
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package com.earth2me.essentials.storage;
|
package com.earth2me.essentials.storage;
|
||||||
|
|
||||||
import com.earth2me.essentials.api.IReload;
|
import com.earth2me.essentials.api.IReload;
|
||||||
@@ -7,7 +6,6 @@ import java.io.File;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface IStorageObjectMap<I> extends IReload
|
interface IStorageObjectMap<I> extends IReload
|
||||||
{
|
{
|
||||||
boolean objectExists(final String name);
|
boolean objectExists(final String name);
|
||||||
|
@@ -56,13 +56,16 @@ public class Location
|
|||||||
if (loc == null)
|
if (loc == null)
|
||||||
{
|
{
|
||||||
World world = null;
|
World world = null;
|
||||||
if (worldUID != null) {
|
if (worldUID != null)
|
||||||
|
{
|
||||||
world = Bukkit.getWorld(worldUID);
|
world = Bukkit.getWorld(worldUID);
|
||||||
}
|
}
|
||||||
if (world == null) {
|
if (world == null)
|
||||||
|
{
|
||||||
world = Bukkit.getWorld(worldname);
|
world = Bukkit.getWorld(worldname);
|
||||||
}
|
}
|
||||||
if (world == null) {
|
if (world == null)
|
||||||
|
{
|
||||||
throw new WorldNotLoadedException(worldname);
|
throw new WorldNotLoadedException(worldname);
|
||||||
}
|
}
|
||||||
loc = new org.bukkit.Location(world, getX(), getY(), getZ(), getYaw(), getPitch());
|
loc = new org.bukkit.Location(world, getX(), getY(), getZ(), getYaw(), getPitch());
|
||||||
@@ -101,6 +104,7 @@ public class Location
|
|||||||
return pitch;
|
return pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static class WorldNotLoadedException extends Exception
|
public static class WorldNotLoadedException extends Exception
|
||||||
{
|
{
|
||||||
public WorldNotLoadedException(String worldname)
|
public WorldNotLoadedException(String worldname)
|
||||||
|
@@ -45,7 +45,8 @@ public class YamlStorageReader implements IStorageReader
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
T object = (T)yaml.load(reader);
|
T object = (T)yaml.load(reader);
|
||||||
if (object == null) {
|
if (object == null)
|
||||||
|
{
|
||||||
object = clazz.newInstance();
|
object = clazz.newInstance();
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
|
Reference in New Issue
Block a user