Bugfix: remove portal blocks when deleting a gate.

This commit is contained in:
Tobias Ottenweller 2013-06-23 17:27:57 +02:00
parent d4f33a1885
commit afe693d491
2 changed files with 8 additions and 4 deletions

View File

@ -47,8 +47,7 @@ public class CommandRemove extends BaseCommand
public void perform() public void perform()
{ {
Plugin.getPlugin().getGatesManager().handleDeletion(gate); Plugin.getPlugin().getGatesManager().handleDeletion(gate);
GateBlockChangeSender.updateGateBlocks(gate); GateBlockChangeSender.updateGateBlocks(gate, true);
sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted."); sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted.");
} }
} }

View File

@ -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. * Sends block changes to players near a given gate.
* @param gate Must not be 'null'! * @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) { if (gate == null) {
throw new IllegalArgumentException("'gate must not be 'null'!"); throw new IllegalArgumentException("'gate must not be 'null'!");
@ -126,7 +131,7 @@ public class GateBlockChangeSender
Material material; Material material;
if (gate.isOpen() && !gate.isHidden()) { if (gate.isOpen() && !gate.isHidden() && !deleted) {
material = Material.PORTAL; material = Material.PORTAL;
} }
else { else {