From 4996a7457d4ceb445e8c2fd76040651af112fc26 Mon Sep 17 00:00:00 2001 From: taoneill Date: Wed, 7 Dec 2011 22:26:05 -0500 Subject: [PATCH] Closes gh-315. Warhub can now be moved from one world to another properly. --- war/src/main/java/com/tommytony/war/WarHub.java | 1 + war/src/main/java/com/tommytony/war/volumes/Volume.java | 6 +++++- war/src/main/java/plugin.yml | 2 +- war/target/classes/plugin.yml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/war/src/main/java/com/tommytony/war/WarHub.java b/war/src/main/java/com/tommytony/war/WarHub.java index e03c4e5..aed5e51 100644 --- a/war/src/main/java/com/tommytony/war/WarHub.java +++ b/war/src/main/java/com/tommytony/war/WarHub.java @@ -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(); diff --git a/war/src/main/java/com/tommytony/war/volumes/Volume.java b/war/src/main/java/com/tommytony/war/volumes/Volume.java index 5ab8130..b4f1050 100644 --- a/war/src/main/java/com/tommytony/war/volumes/Volume.java +++ b/war/src/main/java/com/tommytony/war/volumes/Volume.java @@ -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; @@ -45,6 +45,10 @@ public class Volume { public World getWorld() { return this.world; } + + public void setWorld(World world) { + this.world = world; + } public boolean hasTwoCorners() { return this.cornerOne != null && this.cornerTwo != null; diff --git a/war/src/main/java/plugin.yml b/war/src/main/java/plugin.yml index 25a0d36..de45828 100644 --- a/war/src/main/java/plugin.yml +++ b/war/src/main/java/plugin.yml @@ -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 diff --git a/war/target/classes/plugin.yml b/war/target/classes/plugin.yml index 25a0d36..de45828 100644 --- a/war/target/classes/plugin.yml +++ b/war/target/classes/plugin.yml @@ -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