diff --git a/src/de/craftinc/gates/commands/CommandLocation.java b/src/de/craftinc/gates/commands/CommandLocation.java index d5fa315..887d763 100644 --- a/src/de/craftinc/gates/commands/CommandLocation.java +++ b/src/de/craftinc/gates/commands/CommandLocation.java @@ -60,11 +60,22 @@ public class CommandLocation extends BaseLocationCommand try { - Location oldLocation = gate.getLocation(); + boolean gateOpen = gate.isOpen(); + + if (gateOpen) { + gate.setOpen(false); + } + + Location oldLocation = gate.getLocation(); Set oldGateBlockLocations = gate.getGateBlockLocations(); Set oldFrameBlocks = gate.getGateFrameBlocks(); gate.setLocation(playerLocation); + + if (gateOpen) { + gate.setOpen(true); + } + Plugin.getPlugin().getGatesManager().handleGateLocationChange(gate, oldLocation, oldGateBlockLocations, oldFrameBlocks); sendMessage(ChatColor.GREEN + "The location of '" + gate.getId() + "' is now at your current location.");