2011-10-09 21:57:43 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
2011-08-05 10:50:47 +02:00
|
|
|
|
|
|
|
import com.massivecraft.factions.Conf;
|
2011-10-09 18:35:39 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public class CmdBoom extends FCommand {
|
2014-08-05 17:17:27 +02:00
|
|
|
|
2014-04-04 20:55:21 +02:00
|
|
|
public CmdBoom() {
|
2014-07-01 22:10:18 +02:00
|
|
|
super();
|
|
|
|
this.aliases.add("noboom");
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
//this.requiredArgs.add("");
|
|
|
|
this.optionalArgs.put("on/off", "flip");
|
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
this.permission = Permission.NO_BOOM.node;
|
|
|
|
this.disableOnLock = true;
|
2014-04-04 20:55:21 +02:00
|
|
|
|
2014-07-01 22:10:18 +02:00
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = true;
|
|
|
|
senderMustBeAdmin = false;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
if (!myFaction.isPeaceful()) {
|
2014-07-01 22:10:18 +02:00
|
|
|
fme.msg("<b>This command is only usable by factions which are specially designated as peaceful.");
|
|
|
|
return;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
2014-07-01 22:10:18 +02:00
|
|
|
if (!payForCommand(Conf.econCostNoBoom, "to toggle explosions", "for toggling explosions")) {
|
|
|
|
return;
|
|
|
|
}
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
myFaction.setPeacefulExplosionsEnabled(this.argAsBool(0, !myFaction.getPeacefulExplosionsEnabled()));
|
|
|
|
|
|
|
|
String enabled = myFaction.noExplosionsInTerritory() ? "disabled" : "enabled";
|
|
|
|
|
|
|
|
// Inform
|
|
|
|
myFaction.msg("%s<i> has " + enabled + " explosions in your faction's territory.", fme.describeTo(myFaction));
|
|
|
|
}
|
2011-08-05 10:50:47 +02:00
|
|
|
}
|