Use our simple location object when loading a jail, finally resolves #41

This commit is contained in:
graywolf336 2015-01-27 18:08:44 -06:00
parent d94b12ac40
commit ad57ed767b
6 changed files with 10 additions and 10 deletions

View File

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

View File

@ -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;
}
/**

View File

@ -21,7 +21,7 @@ public class CreationPlayer {
private double inX, inY, inZ, freeX, freeY, freeZ;
private float inPitch, inYaw, freePitch, freeYaw;
private HashSet<SimpleLocation> 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;
}
}

View File

@ -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.");
}

View File

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

View File

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