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());
this.volume.setWorld(this.location.getWorld());
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.saveBlocks();

View File

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

View File

@ -15,7 +15,7 @@ permissions:
war.build: true
war.pvp: true
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
children:
war.player: true

View File

@ -15,7 +15,7 @@ permissions:
war.build: true
war.pvp: true
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
children:
war.player: true