summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <md_5@bigpond.com>2012-02-13 18:05:59 +1100
committermd_5 <md_5@bigpond.com>2012-02-13 18:05:59 +1100
commitc713be8c82c07e00a224e99e5034cc12961360ce (patch)
tree0b53ea0f585724103c5826617eabeee01fa8e302
parenta3c67e23c813709afdac895785272ef7373a31b0 (diff)
downloadEssentials-c713be8c82c07e00a224e99e5034cc12961360ce.tar
Essentials-c713be8c82c07e00a224e99e5034cc12961360ce.tar.gz
Essentials-c713be8c82c07e00a224e99e5034cc12961360ce.tar.lz
Essentials-c713be8c82c07e00a224e99e5034cc12961360ce.tar.xz
Essentials-c713be8c82c07e00a224e99e5034cc12961360ce.zip
No need for that CraftBukkit hack anymore
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java51
-rw-r--r--Essentials/src/com/earth2me/essentials/user/UserBase.java9
2 files changed, 1 insertions, 59 deletions
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java b/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java
deleted file mode 100644
index 8a89c7052..000000000
--- a/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.earth2me.essentials.craftbukkit;
-
-import com.earth2me.essentials.api.IEssentials;
-import com.earth2me.essentials.storage.Location;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import net.minecraft.server.NBTTagCompound;
-import net.minecraft.server.WorldNBTStorage;
-import org.bukkit.craftbukkit.CraftServer;
-
-
-public class OfflineBedLocation
-{
- public static Location getBedLocation(final String playername, final IEssentials ess)
- {
- try
- {
- final CraftServer cserver = (CraftServer)ess.getServer();
- if (cserver == null)
- {
- return null;
- }
- final WorldNBTStorage wnbtStorage = (WorldNBTStorage)cserver.getHandle().playerFileData;
- if (wnbtStorage == null)
- {
- return null;
- }
- final NBTTagCompound playerStorage = wnbtStorage.getPlayerData(playername);
- if (playerStorage == null)
- {
- return null;
- }
-
- if (playerStorage.hasKey("SpawnX") && playerStorage.hasKey("SpawnY") && playerStorage.hasKey("SpawnZ"))
- {
- String spawnWorld = playerStorage.getString("SpawnWorld");
- if ("".equals(spawnWorld))
- {
- spawnWorld = cserver.getWorlds().get(0).getName();
- }
- return new Location(spawnWorld, playerStorage.getInt("SpawnX"), playerStorage.getInt("SpawnY"), playerStorage.getInt("SpawnZ"));
- }
- return null;
- }
- catch (Throwable ex)
- {
- Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
- return null;
- }
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/user/UserBase.java b/Essentials/src/com/earth2me/essentials/user/UserBase.java
index f1e9c8c34..10fda73f7 100644
--- a/Essentials/src/com/earth2me/essentials/user/UserBase.java
+++ b/Essentials/src/com/earth2me/essentials/user/UserBase.java
@@ -120,14 +120,7 @@ public abstract class UserBase extends AsyncStorageObjectHolder<UserData> implem
}
else
{
- try
- {
- return OfflineBedLocation.getBedLocation(base.getName(), ess).getBukkitLocation();
- }
- catch (WorldNotLoadedException ex)
- {
- return null;
- }
+ return ess.getServer().getOfflinePlayer(base.getName()).getBedSpawnLocation();
}
}