diff --git a/src/de/craftinc/gates/GatesManager.java b/src/de/craftinc/gates/GatesManager.java index 81fda3d..b7e7797 100644 --- a/src/de/craftinc/gates/GatesManager.java +++ b/src/de/craftinc/gates/GatesManager.java @@ -535,7 +535,7 @@ public class GatesManager } } - // TODO: call this method! + public void handleGateExitChange(final Gate g, final Location oldExit) { // nothing to do diff --git a/src/de/craftinc/gates/commands/CommandExit.java b/src/de/craftinc/gates/commands/CommandExit.java index 05231ab..0aff595 100644 --- a/src/de/craftinc/gates/commands/CommandExit.java +++ b/src/de/craftinc/gates/commands/CommandExit.java @@ -22,6 +22,7 @@ import de.craftinc.gates.util.GateBlockChangeSender; import org.bukkit.ChatColor; import de.craftinc.gates.Plugin; +import org.bukkit.Location; public class CommandExit extends BaseCommand @@ -47,8 +48,10 @@ public class CommandExit extends BaseCommand { try { + Location oldExit = gate.getExit(); gate.setExit(player.getLocation()); sendMessage(ChatColor.GREEN + "The exit of gate '" + gate.getId() + "' is now where you stand."); + Plugin.getPlugin().getGatesManager().handleGateExitChange(gate, oldExit); } catch (Exception e) { GateBlockChangeSender.updateGateBlocks(gate); diff --git a/src/de/craftinc/gates/commands/CommandExitOpen.java b/src/de/craftinc/gates/commands/CommandExitOpen.java index 47c7436..f131e78 100644 --- a/src/de/craftinc/gates/commands/CommandExitOpen.java +++ b/src/de/craftinc/gates/commands/CommandExitOpen.java @@ -20,6 +20,7 @@ package de.craftinc.gates.commands; import de.craftinc.gates.Plugin; import de.craftinc.gates.util.GateBlockChangeSender; import org.bukkit.ChatColor; +import org.bukkit.Location; import java.util.logging.Level; @@ -46,8 +47,10 @@ public class CommandExitOpen extends BaseCommand { try { + Location oldExit = gate.getExit(); gate.setExit(player.getLocation()); sendMessage(ChatColor.GREEN + "The exit of gate '" + gate.getId() + "' is now where you stand."); + Plugin.getPlugin().getGatesManager().handleGateExitChange(gate, oldExit); try { boolean needsGateManagerUpdate = false;