Factions/src/org/mcteam/factions/commands/FCommandWorldNoClaim.java
Brettflan b490c5f196 Laundry list of changes for 1.2.0 release:
/f map now has a nifty faction name key  (LexManos)
There are now War Zones; these work similar to Safe Zones, except PvP is enabled and monsters are not blocked  (Brettflan)
Players now only regenerate power while actually online  (Brettflan)
New command available to prevent power loss in specific worlds  (Brettflan)
New command available to prevent faction land claims in specific worlds (doesn't affect safezone and warzone claims)  (Brettflan)
New command to unclaim all safezone areas  (Brettflan)
Players are now prevented from using /f home if an enemy is nearby, and the players isn't in a safezone or their own faction territory  (Brettflan)
New option to make membership default to closed for newly created factions  (Brettflan)
When an admin has bypass mode enabled (/f bypass), they can now unclaim any faction land they're standing on  (Brettflan)
2011-05-29 16:28:29 -05:00

40 lines
966 B
Java

package org.mcteam.factions.commands;
import org.bukkit.command.CommandSender;
import org.mcteam.factions.Conf;
import org.mcteam.factions.Factions;
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 + "\").");
}
}
}