2011-07-18 22:06:02 +02:00
|
|
|
package com.massivecraft.factions.commands;
|
2011-05-29 23:28:29 +02:00
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
2011-07-18 22:06:02 +02:00
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
|
|
|
import com.massivecraft.factions.Factions;
|
2011-05-29 23:28:29 +02:00
|
|
|
|
|
|
|
public class FCommandWorldNoClaim extends FBaseCommand {
|
|
|
|
|
|
|
|
public FCommandWorldNoClaim() {
|
|
|
|
aliases.add("worldnoclaim");
|
|
|
|
|
|
|
|
helpDescription = "Disable claims in this world";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasPermission(CommandSender sender) {
|
|
|
|
return Factions.hasPermWorlds(sender);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
|
|
|
|
if( isLocked() ) {
|
|
|
|
sendLockMessage();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
String worldName = me.getPlayer().getWorld().getName();
|
|
|
|
|
|
|
|
if ( ! Conf.worldsNoClaiming.contains(worldName)) {
|
|
|
|
Conf.worldsNoClaiming.add(worldName);
|
|
|
|
me.sendMessage("Faction land claiming is now DISALLOWED in this world (\"" + worldName + "\").");
|
|
|
|
} else {
|
|
|
|
Conf.worldsNoClaiming.remove(worldName);
|
|
|
|
me.sendMessage("Faction land claiming is now ALLOWED in this world (\"" + worldName + "\").");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|