Closes gh-315. Warhub can now be moved from one world to another properly.

This commit is contained in:
taoneill 2011-12-07 22:26:05 -05:00
parent 1325611775
commit 4996a7457d
4 changed files with 8 additions and 3 deletions

View File

@ -143,6 +143,7 @@ public class WarHub {
} }
Block locationBlock = this.location.getWorld().getBlockAt(this.location.getBlockX(), this.location.getBlockY(), this.location.getBlockZ()); Block locationBlock = this.location.getWorld().getBlockAt(this.location.getBlockX(), this.location.getBlockY(), this.location.getBlockZ());
this.volume.setWorld(this.location.getWorld());
this.volume.setCornerOne(locationBlock.getFace(back).getFace(left, halfHubWidth).getFace(BlockFace.DOWN)); this.volume.setCornerOne(locationBlock.getFace(back).getFace(left, halfHubWidth).getFace(BlockFace.DOWN));
this.volume.setCornerTwo(locationBlock.getFace(right, halfHubWidth).getFace(front, hubDepth).getFace(BlockFace.UP, hubHeigth)); this.volume.setCornerTwo(locationBlock.getFace(right, halfHubWidth).getFace(front, hubDepth).getFace(BlockFace.UP, hubHeigth));
this.volume.saveBlocks(); this.volume.saveBlocks();

View File

@ -28,7 +28,7 @@ import com.tommytony.war.jobs.BlockResetJob;
*/ */
public class Volume { public class Volume {
private final String name; private final String name;
private final World world; private World world;
// private final Warzone warzone; // private final Warzone warzone;
private BlockInfo cornerOne; private BlockInfo cornerOne;
private BlockInfo cornerTwo; private BlockInfo cornerTwo;
@ -45,6 +45,10 @@ public class Volume {
public World getWorld() { public World getWorld() {
return this.world; return this.world;
} }
public void setWorld(World world) {
this.world = world;
}
public boolean hasTwoCorners() { public boolean hasTwoCorners() {
return this.cornerOne != null && this.cornerTwo != null; return this.cornerOne != null && this.cornerTwo != null;

View File

@ -15,7 +15,7 @@ permissions:
war.build: true war.build: true
war.pvp: true war.pvp: true
war.zonemaker: war.zonemaker:
description: Create and edit warzones, but you only edit a warzone if you are its author. description: Create and edit warzones, but you can only edit a warzone if you are its author.
default: false default: false
children: children:
war.player: true war.player: true

View File

@ -15,7 +15,7 @@ permissions:
war.build: true war.build: true
war.pvp: true war.pvp: true
war.zonemaker: war.zonemaker:
description: Create and edit warzones, but you only edit a warzone if you are its author. description: Create and edit warzones, but you can only edit a warzone if you are its author.
default: false default: false
children: children:
war.player: true war.player: true