Send block changes on command execution.

This commit is contained in:
Tobias Ottenweller 2013-06-15 15:33:01 +02:00
parent 1d08c79cff
commit 78283a4f34
6 changed files with 14 additions and 1 deletions

View File

@ -18,6 +18,7 @@ package de.craftinc.gates.commands;
import java.util.logging.Level;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import de.craftinc.gates.Plugin;
@ -49,6 +50,7 @@ public class CommandClose extends BaseCommand
try
{
gate.setOpen(false);
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.GREEN + "The gate was closed.");
}
catch(Exception e)

View File

@ -16,6 +16,7 @@
*/
package de.craftinc.gates.commands;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import de.craftinc.gates.Plugin;
@ -47,6 +48,7 @@ public class CommandDelete extends BaseCommand
public void perform()
{
Plugin.getPlugin().getGatesManager().handleDeletion(gate);
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted.");
}
}

View File

@ -17,6 +17,7 @@
package de.craftinc.gates.commands;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import de.craftinc.gates.Plugin;
@ -47,6 +48,7 @@ public class CommandOpen extends BaseCommand
try
{
gate.setOpen(true);
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.GREEN + "The gate was opened.");
}
catch (Exception e)

View File

@ -18,6 +18,7 @@ package de.craftinc.gates.commands;
import java.util.logging.Level;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import de.craftinc.gates.Plugin;
@ -51,7 +52,8 @@ public class CommandSetExit extends BaseCommand
sendMessage(ChatColor.GREEN + "The exit of gate '" + gate.getId() + "' is now where you stand.");
}
catch (Exception e) {
sendMessage(ChatColor.RED + "Setting the exit for the gate failed! See server log for more information");
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.RED + "Setting the exit for the gate failed! See server log for more information");
Plugin.log(Level.WARNING, e.getMessage());
e.printStackTrace();
}

View File

@ -18,6 +18,7 @@ package de.craftinc.gates.commands;
import java.util.logging.Level;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import de.craftinc.gates.Plugin;
@ -46,6 +47,7 @@ public class CommandSetHidden extends BaseCommand
try
{
gate.setHidden(true);
GateBlockChangeSender.updateGateBlocks(gate);
sendMessage(ChatColor.GREEN + "The gate '" + gate.getId() + "' is now hidden.");
}
catch (Exception e)

View File

@ -20,6 +20,7 @@ package de.craftinc.gates.commands;
import java.util.Set;
import java.util.logging.Level;
import de.craftinc.gates.util.GateBlockChangeSender;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -72,6 +73,8 @@ public class CommandSetLocation extends BaseLocationCommand
Plugin.log(Level.WARNING, e.getMessage());
e.printStackTrace();
}
GateBlockChangeSender.updateGateBlocks(gate);
}
}