From c740a5b11158609f6be79ac4186e39fb8e38730a Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sat, 1 Jun 2013 15:02:22 +0200 Subject: [PATCH] Fixed a bug where gates did not work after chaining it's location. --- src/de/craftinc/gates/commands/CommandSetLocation.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/craftinc/gates/commands/CommandSetLocation.java b/src/de/craftinc/gates/commands/CommandSetLocation.java index e9f8587..ba8423f 100644 --- a/src/de/craftinc/gates/commands/CommandSetLocation.java +++ b/src/de/craftinc/gates/commands/CommandSetLocation.java @@ -1,6 +1,7 @@ package de.craftinc.gates.commands; +import java.util.Set; import java.util.logging.Level; import org.bukkit.ChatColor; @@ -41,7 +42,12 @@ public class CommandSetLocation extends BaseLocationCommand try { - gate.setLocation(playerLocation); + Location oldLocation = gate.getLocation(); + Set oldGateBlockLocations = gate.getGateBlockLocations(); + + gate.setLocation(playerLocation); + Plugin.getPlugin().getGatesManager().handleGateLocationChange(gate, oldLocation, oldGateBlockLocations); + sendMessage(ChatColor.GREEN + "The location of '" + gate.getId() + "' is now at your current location."); } catch (Exception e)