/f lock command can now be used through console; fix for /f reload command causing NPE if run from console
This commit is contained in:
parent
f9de4171d4
commit
2e1d7da50f
@ -236,9 +236,9 @@ public class FBaseCommand {
|
|||||||
|
|
||||||
public void setLock(boolean newLock) {
|
public void setLock(boolean newLock) {
|
||||||
if( newLock ) {
|
if( newLock ) {
|
||||||
me.sendMessage("Factions is now locked");
|
sendMessage("Factions is now locked");
|
||||||
} else {
|
} else {
|
||||||
me.sendMessage("Factions in now unlocked");
|
sendMessage("Factions in now unlocked");
|
||||||
}
|
}
|
||||||
|
|
||||||
lock = newLock;
|
lock = newLock;
|
||||||
|
@ -8,6 +8,8 @@ public class FCommandLock extends FBaseCommand {
|
|||||||
public FCommandLock() {
|
public FCommandLock() {
|
||||||
aliases.add("lock");
|
aliases.add("lock");
|
||||||
|
|
||||||
|
senderMustBePlayer = false;
|
||||||
|
|
||||||
optionalParameters.add("on|off");
|
optionalParameters.add("on|off");
|
||||||
|
|
||||||
helpDescription = "lock all write stuff";
|
helpDescription = "lock all write stuff";
|
||||||
@ -23,9 +25,9 @@ public class FCommandLock extends FBaseCommand {
|
|||||||
setLock( parseBool( parameters.get(0) ));
|
setLock( parseBool( parameters.get(0) ));
|
||||||
} else {
|
} else {
|
||||||
if( isLocked() ) {
|
if( isLocked() ) {
|
||||||
me.sendMessage("Factions is locked");
|
sendMessage("Factions is locked");
|
||||||
} else {
|
} else {
|
||||||
me.sendMessage("Factions is not locked");
|
sendMessage("Factions is not locked");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class FCommandReload extends FBaseCommand {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Factions.log("RELOAD CANCELLED - SPECIFIED FILE INVALID");
|
Factions.log("RELOAD CANCELLED - SPECIFIED FILE INVALID");
|
||||||
me.sendMessage("Invalid file specified. Valid files: conf, board, factions, players.");
|
sendMessage("Invalid file specified. Valid files: conf, board, factions, players.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class FCommandReload extends FBaseCommand {
|
|||||||
long timeReload = (System.currentTimeMillis()-timeInitStart);
|
long timeReload = (System.currentTimeMillis()-timeInitStart);
|
||||||
Factions.log("=== RELOAD DONE (Took "+timeReload+"ms) ===");
|
Factions.log("=== RELOAD DONE (Took "+timeReload+"ms) ===");
|
||||||
|
|
||||||
me.sendMessage("Factions file" + fileName + " reloaded from disk, took " + timeReload + "ms");
|
sendMessage("Factions file" + fileName + " reloaded from disk, took " + timeReload + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user