From afe693d491a47fcc81e0faef8323b487d1e3405a Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 23 Jun 2013 17:27:57 +0200 Subject: [PATCH] Bugfix: remove portal blocks when deleting a gate. --- src/de/craftinc/gates/commands/CommandRemove.java | 3 +-- src/de/craftinc/gates/util/GateBlockChangeSender.java | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/de/craftinc/gates/commands/CommandRemove.java b/src/de/craftinc/gates/commands/CommandRemove.java index fc497d8..8055cb5 100644 --- a/src/de/craftinc/gates/commands/CommandRemove.java +++ b/src/de/craftinc/gates/commands/CommandRemove.java @@ -47,8 +47,7 @@ public class CommandRemove extends BaseCommand public void perform() { Plugin.getPlugin().getGatesManager().handleDeletion(gate); - GateBlockChangeSender.updateGateBlocks(gate); + GateBlockChangeSender.updateGateBlocks(gate, true); sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted."); } } - diff --git a/src/de/craftinc/gates/util/GateBlockChangeSender.java b/src/de/craftinc/gates/util/GateBlockChangeSender.java index 11f86b1..ba6b146 100644 --- a/src/de/craftinc/gates/util/GateBlockChangeSender.java +++ b/src/de/craftinc/gates/util/GateBlockChangeSender.java @@ -102,11 +102,16 @@ public class GateBlockChangeSender } + public static void updateGateBlocks(final Gate gate) + { + updateGateBlocks(gate, false); + } + /** * Sends block changes to players near a given gate. * @param gate Must not be 'null'! */ - public static void updateGateBlocks(final Gate gate) + public static void updateGateBlocks(final Gate gate, boolean deleted) { if (gate == null) { throw new IllegalArgumentException("'gate must not be 'null'!"); @@ -126,7 +131,7 @@ public class GateBlockChangeSender Material material; - if (gate.isOpen() && !gate.isHidden()) { + if (gate.isOpen() && !gate.isHidden() && !deleted) { material = Material.PORTAL; } else {