Use our simple location object when loading a jail, finally resolves #41
This commit is contained in:
parent
d94b12ac40
commit
ad57ed767b
@ -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"),
|
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")));
|
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");
|
String cSigns = set.getString("signs");
|
||||||
if(!cSigns.isEmpty()) {
|
if(!cSigns.isEmpty()) {
|
||||||
@ -635,7 +635,7 @@ public class JailIO {
|
|||||||
flat.getDouble(cellNode + "tp.z"),
|
flat.getDouble(cellNode + "tp.z"),
|
||||||
(float) flat.getDouble(cellNode + "tp.yaw"),
|
(float) flat.getDouble(cellNode + "tp.yaw"),
|
||||||
(float) flat.getDouble(cellNode + "tp.pitch")));
|
(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.x"),
|
||||||
flat.getInt(cellNode + "chest.y"),
|
flat.getInt(cellNode + "chest.y"),
|
||||||
flat.getInt(cellNode + "chest.z")));
|
flat.getInt(cellNode + "chest.z")));
|
||||||
|
@ -104,8 +104,8 @@ public class Cell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the location of the chest. */
|
/** Sets the location of the chest. */
|
||||||
public void setChestLocation(Location location) {
|
public void setChestLocation(SimpleLocation simpleLocation) {
|
||||||
this.chest = new SimpleLocation(location);
|
this.chest = simpleLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@ public class CreationPlayer {
|
|||||||
private double inX, inY, inZ, freeX, freeY, freeZ;
|
private double inX, inY, inZ, freeX, freeY, freeZ;
|
||||||
private float inPitch, inYaw, freePitch, freeYaw;
|
private float inPitch, inYaw, freePitch, freeYaw;
|
||||||
private HashSet<SimpleLocation> signs;
|
private HashSet<SimpleLocation> signs;
|
||||||
private Location chest;
|
private SimpleLocation chest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance of a CreationPlayer, given the name of the jail.
|
* 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. */
|
/** Sets the chest's location, used mainly for cells. */
|
||||||
public void setChestLocation(Location loc) {
|
public void setChestLocation(SimpleLocation loc) {
|
||||||
this.chest = loc;
|
this.chest = loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the chest's location. */
|
/** Gets the chest's location. */
|
||||||
public Location getChestLocation() {
|
public SimpleLocation getChestLocation() {
|
||||||
return this.chest;
|
return this.chest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ public class OldInputOutput {
|
|||||||
|
|
||||||
if(!chest.isEmpty()) {
|
if(!chest.isEmpty()) {
|
||||||
String[] ch = chest.split(",");
|
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 {
|
}else {
|
||||||
pl.getLogger().warning("Cell " + c.getName() + " in " + j.getName() + " has no chest.");
|
pl.getLogger().warning("Cell " + c.getName() + " in " + j.getName() + " has no chest.");
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ public class CellCreationSteps {
|
|||||||
|
|
||||||
if (block.getType() == Material.CHEST || block.getType() == Material.TRAPPED_CHEST) {
|
if (block.getType() == Material.CHEST || block.getType() == Material.TRAPPED_CHEST) {
|
||||||
if(pos1 || pos2 || pos3 || pos4) {
|
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.AQUA + "---------- Jail Cell Creation ----------");
|
||||||
player.sendMessage(ChatColor.GREEN + "Chest selected.");
|
player.sendMessage(ChatColor.GREEN + "Chest selected.");
|
||||||
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
|
player.sendMessage(ChatColor.AQUA + "----------------------------------------");
|
||||||
|
@ -4,7 +4,7 @@ version: maven-version-number
|
|||||||
description: Ban too harsh? Kick/mute/whatever not enough? Jail bad players!
|
description: Ban too harsh? Kick/mute/whatever not enough? Jail bad players!
|
||||||
authors: [graywolf336]
|
authors: [graywolf336]
|
||||||
website: dev.bukkit.org/server-mods/jail/
|
website: dev.bukkit.org/server-mods/jail/
|
||||||
softdepend: [WorldEdit, Vault, Multiverse]
|
softdepend: [WorldEdit, Vault, Multiverse-Core]
|
||||||
load: POSTWORLD
|
load: POSTWORLD
|
||||||
commands:
|
commands:
|
||||||
jail:
|
jail:
|
||||||
|
Loading…
Reference in New Issue
Block a user