Send block changes on command execution.
This commit is contained in:
parent
1d08c79cff
commit
78283a4f34
@ -18,6 +18,7 @@ package de.craftinc.gates.commands;
|
|||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import de.craftinc.gates.util.GateBlockChangeSender;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import de.craftinc.gates.Plugin;
|
import de.craftinc.gates.Plugin;
|
||||||
@ -49,6 +50,7 @@ public class CommandClose extends BaseCommand
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
gate.setOpen(false);
|
gate.setOpen(false);
|
||||||
|
GateBlockChangeSender.updateGateBlocks(gate);
|
||||||
sendMessage(ChatColor.GREEN + "The gate was closed.");
|
sendMessage(ChatColor.GREEN + "The gate was closed.");
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package de.craftinc.gates.commands;
|
package de.craftinc.gates.commands;
|
||||||
|
|
||||||
|
import de.craftinc.gates.util.GateBlockChangeSender;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import de.craftinc.gates.Plugin;
|
import de.craftinc.gates.Plugin;
|
||||||
@ -47,6 +48,7 @@ public class CommandDelete extends BaseCommand
|
|||||||
public void perform()
|
public void perform()
|
||||||
{
|
{
|
||||||
Plugin.getPlugin().getGatesManager().handleDeletion(gate);
|
Plugin.getPlugin().getGatesManager().handleDeletion(gate);
|
||||||
|
GateBlockChangeSender.updateGateBlocks(gate);
|
||||||
sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted.");
|
sendMessage(ChatColor.GREEN + "Gate with id '" + gate.getId() + "' was deleted.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
package de.craftinc.gates.commands;
|
package de.craftinc.gates.commands;
|
||||||
|
|
||||||
|
|
||||||
|
import de.craftinc.gates.util.GateBlockChangeSender;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import de.craftinc.gates.Plugin;
|
import de.craftinc.gates.Plugin;
|
||||||
@ -47,6 +48,7 @@ public class CommandOpen extends BaseCommand
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
gate.setOpen(true);
|
gate.setOpen(true);
|
||||||
|
GateBlockChangeSender.updateGateBlocks(gate);
|
||||||
sendMessage(ChatColor.GREEN + "The gate was opened.");
|
sendMessage(ChatColor.GREEN + "The gate was opened.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -18,6 +18,7 @@ package de.craftinc.gates.commands;
|
|||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import de.craftinc.gates.util.GateBlockChangeSender;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import de.craftinc.gates.Plugin;
|
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.");
|
sendMessage(ChatColor.GREEN + "The exit of gate '" + gate.getId() + "' is now where you stand.");
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
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());
|
Plugin.log(Level.WARNING, e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ package de.craftinc.gates.commands;
|
|||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import de.craftinc.gates.util.GateBlockChangeSender;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import de.craftinc.gates.Plugin;
|
import de.craftinc.gates.Plugin;
|
||||||
@ -46,6 +47,7 @@ public class CommandSetHidden extends BaseCommand
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
gate.setHidden(true);
|
gate.setHidden(true);
|
||||||
|
GateBlockChangeSender.updateGateBlocks(gate);
|
||||||
sendMessage(ChatColor.GREEN + "The gate '" + gate.getId() + "' is now hidden.");
|
sendMessage(ChatColor.GREEN + "The gate '" + gate.getId() + "' is now hidden.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -20,6 +20,7 @@ package de.craftinc.gates.commands;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import de.craftinc.gates.util.GateBlockChangeSender;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
@ -72,6 +73,8 @@ public class CommandSetLocation extends BaseLocationCommand
|
|||||||
Plugin.log(Level.WARNING, e.getMessage());
|
Plugin.log(Level.WARNING, e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GateBlockChangeSender.updateGateBlocks(gate);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user