Class Cleanup for easier navigation
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
package com.massivecraft.factions.cmd.claim;
|
||||
|
||||
import com.massivecraft.factions.Board;
|
||||
import com.massivecraft.factions.Conf;
|
||||
import com.massivecraft.factions.Factions;
|
||||
import com.massivecraft.factions.SaberFactions;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
public class CmdWarunclaimall extends FCommand {
|
||||
|
||||
public CmdWarunclaimall() {
|
||||
this.aliases.add("warunclaimall");
|
||||
this.aliases.add("wardeclaimall");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("world", "all");
|
||||
|
||||
this.permission = Permission.MANAGE_WAR_ZONE.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = false;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeModerator = false;
|
||||
senderMustBeAdmin = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
String worldName = argAsString(0);
|
||||
World world = null;
|
||||
|
||||
if (worldName != null) {
|
||||
world = Bukkit.getWorld(worldName);
|
||||
}
|
||||
|
||||
String id = Factions.getInstance().getWarZone().getId();
|
||||
|
||||
if (world == null) {
|
||||
Board.getInstance().unclaimAll(id);
|
||||
} else {
|
||||
Board.getInstance().unclaimAllInWorld(id, world);
|
||||
}
|
||||
|
||||
fme.msg(TL.COMMAND_WARUNCLAIMALL_SUCCESS);
|
||||
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SaberFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TL getUsageTranslation() {
|
||||
return TL.COMMAND_WARUNCLAIMALL_DESCRIPTION;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user