2018-07-30 18:05:28 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
|
|
|
public class CmdStealth extends FCommand {
|
|
|
|
public CmdStealth() {
|
|
|
|
this.aliases.add("ninja");
|
|
|
|
this.aliases.add("stealth");
|
|
|
|
this.permission = Permission.STEALTH.node;
|
|
|
|
|
|
|
|
this.disableOnLock = true;
|
|
|
|
|
|
|
|
this.senderMustBePlayer = true;
|
|
|
|
this.senderMustBeMember = false;
|
|
|
|
this.senderMustBeModerator = false;
|
|
|
|
this.senderMustBeColeader = false;
|
|
|
|
this.senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void perform() {
|
2018-08-02 16:32:53 +02:00
|
|
|
if (myFaction != null && !myFaction.isWilderness() && !myFaction.isSafeZone() && !myFaction.isWarZone() && myFaction.isNormal()) {
|
2018-07-30 18:05:28 +02:00
|
|
|
fme.setStealth(!fme.isStealthEnabled());
|
2018-08-02 16:32:53 +02:00
|
|
|
// Sends Enable/Disable Message
|
2018-07-30 18:05:28 +02:00
|
|
|
fme.msg(fme.isStealthEnabled() ? TL.COMMAND_STEALTH_ENABLE : TL.COMMAND_STEALTH_DISABLE);
|
|
|
|
} else {
|
2018-08-02 16:32:53 +02:00
|
|
|
fme.msg(TL.COMMAND_STEALTH_MUSTBEMEMBER);
|
2018-07-30 18:05:28 +02:00
|
|
|
}
|
|
|
|
}
|
2018-08-02 16:32:53 +02:00
|
|
|
|
2018-07-30 18:05:28 +02:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_STEALTH_DESCRIPTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|