From ad57ed767b696d4b3c84c517b740333df62ec9b0 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Tue, 27 Jan 2015 18:08:44 -0600 Subject: [PATCH] Use our simple location object when loading a jail, finally resolves #41 --- src/main/java/com/graywolf336/jail/JailIO.java | 4 ++-- src/main/java/com/graywolf336/jail/beans/Cell.java | 4 ++-- .../java/com/graywolf336/jail/beans/CreationPlayer.java | 6 +++--- .../java/com/graywolf336/jail/legacy/OldInputOutput.java | 2 +- .../java/com/graywolf336/jail/steps/CellCreationSteps.java | 2 +- src/main/resources/plugin.yml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/JailIO.java b/src/main/java/com/graywolf336/jail/JailIO.java index daf6d52..57fa2df 100644 --- a/src/main/java/com/graywolf336/jail/JailIO.java +++ b/src/main/java/com/graywolf336/jail/JailIO.java @@ -441,7 +441,7 @@ public class JailIO { c.setTeleport(new SimpleLocation(j.getWorldName(), set.getDouble("tp.x"), set.getDouble("tp.y"), set.getDouble("tp.z"), set.getFloat("tp.yaw"), set.getFloat("tp.pitch"))); - c.setChestLocation(new Location(j.getWorld(), set.getInt("chest.x"), set.getInt("chest.y"), set.getInt("chest.z"))); + c.setChestLocation(new SimpleLocation(j.getWorldName(), set.getInt("chest.x"), set.getInt("chest.y"), set.getInt("chest.z"))); String cSigns = set.getString("signs"); if(!cSigns.isEmpty()) { @@ -635,7 +635,7 @@ public class JailIO { flat.getDouble(cellNode + "tp.z"), (float) flat.getDouble(cellNode + "tp.yaw"), (float) flat.getDouble(cellNode + "tp.pitch"))); - c.setChestLocation(new Location(pl.getServer().getWorld(j.getWorldName()), + c.setChestLocation(new SimpleLocation(j.getWorldName(), flat.getInt(cellNode + "chest.x"), flat.getInt(cellNode + "chest.y"), flat.getInt(cellNode + "chest.z"))); diff --git a/src/main/java/com/graywolf336/jail/beans/Cell.java b/src/main/java/com/graywolf336/jail/beans/Cell.java index a510512..8112399 100644 --- a/src/main/java/com/graywolf336/jail/beans/Cell.java +++ b/src/main/java/com/graywolf336/jail/beans/Cell.java @@ -104,8 +104,8 @@ public class Cell { } /** Sets the location of the chest. */ - public void setChestLocation(Location location) { - this.chest = new SimpleLocation(location); + public void setChestLocation(SimpleLocation simpleLocation) { + this.chest = simpleLocation; } /** diff --git a/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java b/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java index bc97fa7..4b846db 100644 --- a/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java +++ b/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java @@ -21,7 +21,7 @@ public class CreationPlayer { private double inX, inY, inZ, freeX, freeY, freeZ; private float inPitch, inYaw, freePitch, freeYaw; private HashSet signs; - private Location chest; + private SimpleLocation chest; /** * Create a new instance of a CreationPlayer, given the name of the jail. @@ -216,12 +216,12 @@ public class CreationPlayer { } /** Sets the chest's location, used mainly for cells. */ - public void setChestLocation(Location loc) { + public void setChestLocation(SimpleLocation loc) { this.chest = loc; } /** Gets the chest's location. */ - public Location getChestLocation() { + public SimpleLocation getChestLocation() { return this.chest; } } diff --git a/src/main/java/com/graywolf336/jail/legacy/OldInputOutput.java b/src/main/java/com/graywolf336/jail/legacy/OldInputOutput.java index 4cd6aac..b6c60fb 100644 --- a/src/main/java/com/graywolf336/jail/legacy/OldInputOutput.java +++ b/src/main/java/com/graywolf336/jail/legacy/OldInputOutput.java @@ -184,7 +184,7 @@ public class OldInputOutput { if(!chest.isEmpty()) { String[] ch = chest.split(","); - c.setChestLocation(new Location(j.getWorld(), Double.valueOf(ch[0]), Double.valueOf(ch[1]), Double.valueOf(ch[2]))); + c.setChestLocation(new SimpleLocation(j.getWorldName(), Double.valueOf(ch[0]), Double.valueOf(ch[1]), Double.valueOf(ch[2]))); }else { pl.getLogger().warning("Cell " + c.getName() + " in " + j.getName() + " has no chest."); } diff --git a/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java b/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java index 45b23f1..9db1810 100644 --- a/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java +++ b/src/main/java/com/graywolf336/jail/steps/CellCreationSteps.java @@ -127,7 +127,7 @@ public class CellCreationSteps { if (block.getType() == Material.CHEST || block.getType() == Material.TRAPPED_CHEST) { if(pos1 || pos2 || pos3 || pos4) { - cp.setChestLocation(block.getLocation()); + cp.setChestLocation(new SimpleLocation(block.getLocation())); player.sendMessage(ChatColor.AQUA + "---------- Jail Cell Creation ----------"); player.sendMessage(ChatColor.GREEN + "Chest selected."); player.sendMessage(ChatColor.AQUA + "----------------------------------------"); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 30bdadb..c93dd79 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -4,7 +4,7 @@ version: maven-version-number description: Ban too harsh? Kick/mute/whatever not enough? Jail bad players! authors: [graywolf336] website: dev.bukkit.org/server-mods/jail/ -softdepend: [WorldEdit, Vault, Multiverse] +softdepend: [WorldEdit, Vault, Multiverse-Core] load: POSTWORLD commands: jail: