1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 20:11:21 +02:00

Formatting.

Signed-off-by: Paul Buonopane <techsoftadvanced@gmail.com>
This commit is contained in:
Paul Buonopane
2012-02-23 12:24:46 -05:00
parent 9b25a25e91
commit 53c9265800
5 changed files with 34 additions and 31 deletions

View File

@@ -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);

View File

@@ -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)

View File

@@ -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;