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