2011-08-05 10:50:47 +02:00
|
|
|
package com.massivecraft.factions.commands;
|
|
|
|
|
|
|
|
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("");
|
|
|
|
this.optionalArgs.put("on/off", "flipp");
|
|
|
|
|
|
|
|
this.permission = Permission.COMMAND_NO_BOOM.node;
|
|
|
|
|
|
|
|
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( isLocked() )
|
|
|
|
{
|
2011-08-05 10:50:47 +02:00
|
|
|
sendLockMessage();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-10-09 18:35:39 +02:00
|
|
|
if ( ! myFaction.isPeaceful())
|
|
|
|
{
|
|
|
|
fme.sendMessageParsed("<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-09 18:35:39 +02:00
|
|
|
if ( ! payForCommand(Conf.econCostNoBoom)) 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-09 18:35:39 +02:00
|
|
|
myFaction.sendMessageParsed("%s<i> has "+enabled+" explosions in your faction's territory.", fme.getNameAndRelevant(myFaction));
|
2011-08-05 10:50:47 +02:00
|
|
|
}
|
|
|
|
}
|