Bugfix: new gates do not work when opening them.
This commit is contained in:
parent
ea52e4d87e
commit
d24f0b8fd1
@ -46,8 +46,19 @@ public class CommandOpen extends BaseCommand
|
|||||||
public void perform()
|
public void perform()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
gate.setOpen(true);
|
boolean needsGateManagerUpdate = false;
|
||||||
|
|
||||||
|
if (gate.getGateBlockLocations().isEmpty()) {
|
||||||
|
needsGateManagerUpdate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
gate.setOpen(true);
|
||||||
GateBlockChangeSender.updateGateBlocks(gate);
|
GateBlockChangeSender.updateGateBlocks(gate);
|
||||||
|
|
||||||
|
if (needsGateManagerUpdate) {
|
||||||
|
Plugin.getPlugin().getGatesManager().handleGateLocationChange(gate, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
sendMessage(ChatColor.GREEN + "The gate was opened.");
|
sendMessage(ChatColor.GREEN + "The gate was opened.");
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user