From a474963666eaaf9b81007fd3a1daf439e5f0d5f2 Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sat, 25 Feb 2012 23:16:54 +0100 Subject: [PATCH] fixed bug preventing removal of gates without from location --- src/org/mcteam/ancientgates/Gate.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/org/mcteam/ancientgates/Gate.java b/src/org/mcteam/ancientgates/Gate.java index 8c803ae..1100bd5 100644 --- a/src/org/mcteam/ancientgates/Gate.java +++ b/src/org/mcteam/ancientgates/Gate.java @@ -95,7 +95,7 @@ public class Gate { return false; } - // Uncomment lines below to have the old Portal open functionality back. + // Uncomment lines below to have the old Portal open functionality back. // This is not to do an effect // It is to stop portalblocks from destroyingthemself as they cant rely on non created blocks :P @@ -110,12 +110,14 @@ public class Gate { return true; } - public void close() { - Set blocks = FloodUtil.getGateFrameBlocks(from.getBlock()); - - // Uncomment lines below to have the old Portal open functionality back. - for (Block block : blocks) { - block.setType(Material.AIR); + public void close() + { + if (from != null) + { + Set blocks = FloodUtil.getGateFrameBlocks(from.getBlock()); + + for (Block block : blocks) + block.setType(Material.AIR); } }