2011-05-10 19:18:35 +02:00
|
|
|
package org.mcteam.factions.commands;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.mcteam.factions.Factions;
|
|
|
|
|
|
|
|
public class FCommandLock extends FBaseCommand {
|
|
|
|
|
|
|
|
public FCommandLock() {
|
|
|
|
aliases.add("lock");
|
|
|
|
|
2011-06-10 21:22:29 +02:00
|
|
|
senderMustBePlayer = false;
|
|
|
|
|
2011-05-10 19:18:35 +02:00
|
|
|
optionalParameters.add("on|off");
|
|
|
|
|
|
|
|
helpDescription = "lock all write stuff";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasPermission(CommandSender sender) {
|
|
|
|
return Factions.hasPermLock(sender);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void perform() {
|
|
|
|
if( parameters.size() > 0 ) {
|
|
|
|
setLock( parseBool( parameters.get(0) ));
|
|
|
|
} else {
|
|
|
|
if( isLocked() ) {
|
2011-06-10 21:22:29 +02:00
|
|
|
sendMessage("Factions is locked");
|
2011-05-10 19:18:35 +02:00
|
|
|
} else {
|
2011-06-10 21:22:29 +02:00
|
|
|
sendMessage("Factions is not locked");
|
2011-05-10 19:18:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|