Introduced Brigadier Command System. More Formatting Coming in next commit.
This commit is contained in:
@@ -3,7 +3,9 @@ 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.P;
|
||||
import com.massivecraft.factions.FactionsPlugin;
|
||||
import com.massivecraft.factions.cmd.CommandContext;
|
||||
import com.massivecraft.factions.cmd.CommandRequirements;
|
||||
import com.massivecraft.factions.cmd.FCommand;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
@@ -15,28 +17,18 @@ 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;
|
||||
|
||||
this.requirements = new CommandRequirements.Builder(Permission.MANAGE_WAR_ZONE)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
String worldName = argAsString(0);
|
||||
public void perform(CommandContext context) {
|
||||
String worldName = context.argAsString(0);
|
||||
World world = null;
|
||||
|
||||
if (worldName != null) {
|
||||
world = Bukkit.getWorld(worldName);
|
||||
}
|
||||
if (worldName != null) world = Bukkit.getWorld(worldName);
|
||||
|
||||
String id = Factions.getInstance().getWarZone().getId();
|
||||
|
||||
@@ -46,12 +38,9 @@ public class CmdWarunclaimall extends FCommand {
|
||||
Board.getInstance().unclaimAllInWorld(id, world);
|
||||
}
|
||||
|
||||
fme.msg(TL.COMMAND_WARUNCLAIMALL_SUCCESS);
|
||||
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
P.p.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
|
||||
}
|
||||
context.msg(TL.COMMAND_WARUNCLAIMALL_SUCCESS);
|
||||
if (Conf.logLandUnclaims)
|
||||
FactionsPlugin.getInstance().log(TL.COMMAND_WARUNCLAIMALL_LOG.format(context.fPlayer.getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,3 +49,4 @@ public class CmdWarunclaimall extends FCommand {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user