2011-07-18 22:06:02 +02:00
|
|
|
package com.massivecraft.factions.commands;
|
2011-05-10 19:18:35 +02:00
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
2011-07-18 22:06:02 +02:00
|
|
|
|
2011-10-08 22:03:44 +02:00
|
|
|
import com.massivecraft.factions.P;
|
2011-05-10 19:18:35 +02:00
|
|
|
|
2011-10-08 23:22:02 +02:00
|
|
|
public class FCommandLock extends FCommand {
|
2011-05-10 19:18:35 +02:00
|
|
|
|
|
|
|
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) {
|
2011-10-08 22:03:44 +02:00
|
|
|
return P.hasPermLock(sender);
|
2011-05-10 19:18:35 +02:00
|
|
|
}
|
|
|
|
|
2011-06-21 07:38:31 +02:00
|
|
|
@Override
|
2011-05-10 19:18:35 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|