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 {