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-12-08 00:12:52 +01:00
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
2011-10-09 18:35:39 +02:00
|
|
|
|
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");
|
2016-01-02 04:05:02 +01:00
|
|
|
this.aliases.add("explosions");
|
|
|
|
this.aliases.add("toggleexplosions");
|
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;
|
2018-03-26 23:43:15 +02:00
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeColeader = true;
|
2014-07-01 22:10:18 +02:00
|
|
|
senderMustBeAdmin = false;
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
if (!myFaction.isPeaceful()) {
|
2014-12-08 00:12:52 +01:00
|
|
|
fme.msg(TL.COMMAND_BOOM_PEACEFULONLY);
|
2014-07-01 22:10:18 +02:00
|
|
|
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-12-08 00:12:52 +01:00
|
|
|
if (!payForCommand(Conf.econCostNoBoom, TL.COMMAND_BOOM_TOTOGGLE, TL.COMMAND_BOOM_FORTOGGLE)) {
|
2014-07-01 22:10:18 +02:00
|
|
|
return;
|
|
|
|
}
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
myFaction.setPeacefulExplosionsEnabled(this.argAsBool(0, !myFaction.getPeacefulExplosionsEnabled()));
|
|
|
|
|
2014-12-08 00:12:52 +01:00
|
|
|
String enabled = myFaction.noExplosionsInTerritory() ? TL.GENERIC_DISABLED.toString() : TL.GENERIC_ENABLED.toString();
|
2014-04-04 20:55:21 +02:00
|
|
|
|
|
|
|
// Inform
|
2014-12-11 17:05:04 +01:00
|
|
|
myFaction.msg(TL.COMMAND_BOOM_ENABLED, fme.describeTo(myFaction), enabled);
|
2014-04-04 20:55:21 +02:00
|
|
|
}
|
2015-01-22 00:58:33 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_BOOM_DESCRIPTION;
|
|
|
|
}
|
2011-08-05 10:50:47 +02:00
|
|
|
}
|