2018-12-06 16:06:46 -06:00
package com.massivecraft.factions.cmd ;
import com.massivecraft.factions.Conf ;
2019-09-14 15:13:01 -04:00
import com.massivecraft.factions.FactionsPlugin ;
2019-07-01 14:23:55 -04:00
import com.massivecraft.factions.cmd.alts.CmdAlts ;
2019-12-28 04:58:33 -05:00
import com.massivecraft.factions.cmd.audit.CmdAudit ;
2019-09-08 01:25:19 -04:00
import com.massivecraft.factions.cmd.check.CmdCheck ;
import com.massivecraft.factions.cmd.check.CmdWeeWoo ;
2019-08-18 09:19:41 -04:00
import com.massivecraft.factions.cmd.chest.CmdChest ;
2019-07-01 14:23:55 -04:00
import com.massivecraft.factions.cmd.claim.* ;
import com.massivecraft.factions.cmd.econ.CmdMoney ;
2019-08-22 17:21:33 -04:00
import com.massivecraft.factions.cmd.grace.CmdGrace ;
2019-07-28 05:04:39 -04:00
import com.massivecraft.factions.cmd.logout.CmdLogout ;
2019-07-01 14:23:55 -04:00
import com.massivecraft.factions.cmd.points.CmdPoints ;
import com.massivecraft.factions.cmd.relational.CmdRelationAlly ;
import com.massivecraft.factions.cmd.relational.CmdRelationEnemy ;
import com.massivecraft.factions.cmd.relational.CmdRelationNeutral ;
import com.massivecraft.factions.cmd.relational.CmdRelationTruce ;
2019-12-31 02:56:45 -05:00
import com.massivecraft.factions.cmd.reserve.CmdReserve ;
2019-07-01 14:23:55 -04:00
import com.massivecraft.factions.cmd.roles.CmdDemote ;
import com.massivecraft.factions.cmd.roles.CmdPromote ;
2019-08-17 15:02:38 -04:00
import com.massivecraft.factions.cmd.tnt.CmdTnt ;
import com.massivecraft.factions.cmd.tnt.CmdTntFill ;
2019-12-16 18:46:38 -06:00
import com.massivecraft.factions.cmd.wild.CmdWild ;
2019-09-29 04:39:30 -04:00
import com.massivecraft.factions.discord.CmdInviteBot ;
import com.massivecraft.factions.discord.CmdSetGuild ;
2019-08-07 14:35:19 -04:00
import com.massivecraft.factions.missions.CmdMissions ;
2019-08-04 16:23:40 -04:00
import com.massivecraft.factions.shop.CmdShop ;
2018-12-06 16:06:46 -06:00
import com.massivecraft.factions.zcore.util.TL ;
2019-09-14 15:13:01 -04:00
import me.lucko.commodore.CommodoreProvider ;
2018-12-06 16:06:46 -06:00
import org.bukkit.Bukkit ;
2019-09-14 15:13:01 -04:00
import org.bukkit.command.Command ;
import org.bukkit.command.CommandExecutor ;
import org.bukkit.command.CommandSender ;
2018-12-06 16:06:46 -06:00
2019-09-14 15:13:01 -04:00
import java.util.ArrayList ;
import java.util.Arrays ;
2018-12-06 16:06:46 -06:00
import java.util.Collections ;
import java.util.logging.Level ;
2019-09-14 15:13:01 -04:00
public class FCmdRoot extends FCommand implements CommandExecutor {
2019-12-02 13:55:38 -05:00
/ * *
* @author FactionsUUID Team
* /
2019-12-16 13:32:12 -06:00
public static FCmdRoot instance ;
2019-09-15 05:19:06 -04:00
public BrigadierManager brigadierManager ;
public CmdAdmin cmdAdmin = new CmdAdmin ( ) ;
public CmdAutoClaim cmdAutoClaim = new CmdAutoClaim ( ) ;
public CmdBoom cmdBoom = new CmdBoom ( ) ;
public CmdBypass cmdBypass = new CmdBypass ( ) ;
public CmdChat cmdChat = new CmdChat ( ) ;
public CmdChatSpy cmdChatSpy = new CmdChatSpy ( ) ;
public CmdClaim cmdClaim = new CmdClaim ( ) ;
public CmdConfig cmdConfig = new CmdConfig ( ) ;
public CmdCreate cmdCreate = new CmdCreate ( ) ;
public CmdDeinvite cmdDeinvite = new CmdDeinvite ( ) ;
public CmdDescription cmdDescription = new CmdDescription ( ) ;
public CmdDisband cmdDisband = new CmdDisband ( ) ;
public CmdFocus cmdFocus = new CmdFocus ( ) ;
public CmdGrace cmdGrace = new CmdGrace ( ) ;
public CmdHelp cmdHelp = new CmdHelp ( ) ;
public CmdHome cmdHome = new CmdHome ( ) ;
public CmdInvite cmdInvite = new CmdInvite ( ) ;
public CmdJoin cmdJoin = new CmdJoin ( ) ;
public CmdKick cmdKick = new CmdKick ( ) ;
public CmdLeave cmdLeave = new CmdLeave ( ) ;
public CmdList cmdList = new CmdList ( ) ;
public CmdLock cmdLock = new CmdLock ( ) ;
public CmdMap cmdMap = new CmdMap ( ) ;
public CmdMod cmdMod = new CmdMod ( ) ;
public CmdMoney cmdMoney = new CmdMoney ( ) ;
public CmdOpen cmdOpen = new CmdOpen ( ) ;
public CmdOwner cmdOwner = new CmdOwner ( ) ;
public CmdOwnerList cmdOwnerList = new CmdOwnerList ( ) ;
public CmdPeaceful cmdPeaceful = new CmdPeaceful ( ) ;
public CmdPermanent cmdPermanent = new CmdPermanent ( ) ;
public CmdPermanentPower cmdPermanentPower = new CmdPermanentPower ( ) ;
public CmdPowerBoost cmdPowerBoost = new CmdPowerBoost ( ) ;
public CmdPower cmdPower = new CmdPower ( ) ;
public CmdRelationAlly cmdRelationAlly = new CmdRelationAlly ( ) ;
public CmdRelationEnemy cmdRelationEnemy = new CmdRelationEnemy ( ) ;
public CmdRelationNeutral cmdRelationNeutral = new CmdRelationNeutral ( ) ;
public CmdRelationTruce cmdRelationTruce = new CmdRelationTruce ( ) ;
public CmdReload cmdReload = new CmdReload ( ) ;
public CmdSafeunclaimall cmdSafeunclaimall = new CmdSafeunclaimall ( ) ;
public CmdSaveAll cmdSaveAll = new CmdSaveAll ( ) ;
public CmdSethome cmdSethome = new CmdSethome ( ) ;
public CmdShow cmdShow = new CmdShow ( ) ;
public CmdStatus cmdStatus = new CmdStatus ( ) ;
public CmdStealth cmdStealth = new CmdStealth ( ) ;
public CmdStuck cmdStuck = new CmdStuck ( ) ;
public CmdTag cmdTag = new CmdTag ( ) ;
public CmdTitle cmdTitle = new CmdTitle ( ) ;
2019-11-28 19:34:39 -06:00
public CmdPlayerTitleToggle cmdPlayerTitleToggle = new CmdPlayerTitleToggle ( ) ;
2019-09-15 05:19:06 -04:00
public CmdToggleAllianceChat cmdToggleAllianceChat = new CmdToggleAllianceChat ( ) ;
public CmdUnclaim cmdUnclaim = new CmdUnclaim ( ) ;
public CmdUnclaimall cmdUnclaimall = new CmdUnclaimall ( ) ;
public CmdVersion cmdVersion = new CmdVersion ( ) ;
public CmdWarunclaimall cmdWarunclaimall = new CmdWarunclaimall ( ) ;
public CmdSB cmdSB = new CmdSB ( ) ;
public CmdShowInvites cmdShowInvites = new CmdShowInvites ( ) ;
public CmdAnnounce cmdAnnounce = new CmdAnnounce ( ) ;
public CmdPaypalSet cmdPaypalSet = new CmdPaypalSet ( ) ;
public CmdPaypalSee cmdPaypalSee = new CmdPaypalSee ( ) ;
public CmdSeeChunk cmdSeeChunk = new CmdSeeChunk ( ) ;
public CmdConvert cmdConvert = new CmdConvert ( ) ;
public CmdFWarp cmdFWarp = new CmdFWarp ( ) ;
public CmdSetFWarp cmdSetFWarp = new CmdSetFWarp ( ) ;
public CmdDelFWarp cmdDelFWarp = new CmdDelFWarp ( ) ;
public CmdModifyPower cmdModifyPower = new CmdModifyPower ( ) ;
public CmdLogins cmdLogins = new CmdLogins ( ) ;
public CmdClaimLine cmdClaimLine = new CmdClaimLine ( ) ;
public CmdTop cmdTop = new CmdTop ( ) ;
public CmdAHome cmdAHome = new CmdAHome ( ) ;
public CmdPerm cmdPerm = new CmdPerm ( ) ;
public CmdPromote cmdPromote = new CmdPromote ( ) ;
public CmdDemote cmdDemote = new CmdDemote ( ) ;
public CmdSetDefaultRole cmdSetDefaultRole = new CmdSetDefaultRole ( ) ;
public CmdMapHeight cmdMapHeight = new CmdMapHeight ( ) ;
public CmdClaimAt cmdClaimAt = new CmdClaimAt ( ) ;
public CmdBan cmdban = new CmdBan ( ) ;
public CmdUnban cmdUnban = new CmdUnban ( ) ;
public CmdBanlist cmdbanlist = new CmdBanlist ( ) ;
public CmdRules cmdRules = new CmdRules ( ) ;
public CmdCheckpoint cmdCheckpoint = new CmdCheckpoint ( ) ;
public CmdTnt cmdTnt = new CmdTnt ( ) ;
public CmdNear cmdNear = new CmdNear ( ) ;
public CmdUpgrades cmdUpgrades = new CmdUpgrades ( ) ;
public CmdVault cmdVault = new CmdVault ( ) ;
public CmdGetVault cmdGetVault = new CmdGetVault ( ) ;
public CmdFly cmdFly = new CmdFly ( ) ;
public CmdColeader cmdColeader = new CmdColeader ( ) ;
public CmdBanner cmdBanner = new CmdBanner ( ) ;
public CmdTpBanner cmdTpBanner = new CmdTpBanner ( ) ;
public CmdKillHolograms cmdKillHolograms = new CmdKillHolograms ( ) ;
public CmdInspect cmdInspect = new CmdInspect ( ) ;
public CmdCoords cmdCoords = new CmdCoords ( ) ;
public CmdShowClaims cmdShowClaims = new CmdShowClaims ( ) ;
public CmdLowPower cmdLowPower = new CmdLowPower ( ) ;
public CmdTntFill cmdTntFill = new CmdTntFill ( ) ;
public CmdChest cmdChest = new CmdChest ( ) ;
public CmdSetBanner cmdSetBanner = new CmdSetBanner ( ) ;
public CmdAlts cmdAlts = new CmdAlts ( ) ;
public CmdCorner cmdCorner = new CmdCorner ( ) ;
public CmdInventorySee cmdInventorySee = new CmdInventorySee ( ) ;
public CmdFGlobal cmdFGlobal = new CmdFGlobal ( ) ;
public CmdViewChest cmdViewChest = new CmdViewChest ( ) ;
public CmdPoints cmdPoints = new CmdPoints ( ) ;
public CmdLogout cmdLogout = new CmdLogout ( ) ;
public CmdShop cmdShop = new CmdShop ( ) ;
public CmdMissions cmdMissions = new CmdMissions ( ) ;
public CmdStrikes cmdStrikes = new CmdStrikes ( ) ;
public CmdCheck cmdCheck = new CmdCheck ( ) ;
public CmdWeeWoo cmdWeeWoo = new CmdWeeWoo ( ) ;
2019-12-16 18:46:38 -06:00
public CmdWild cmdWild = new CmdWild ( ) ;
2019-09-16 07:36:42 -04:00
public CmdSpawnerLock cmdSpawnerLock = new CmdSpawnerLock ( ) ;
2019-09-21 13:02:51 -04:00
public CmdSetDiscord cmdSetDiscord = new CmdSetDiscord ( ) ;
public CmdSeeDiscord cmdSeeDiscord = new CmdSeeDiscord ( ) ;
2019-09-29 04:39:30 -04:00
public CmdInviteBot cmdInviteBot = new CmdInviteBot ( ) ;
public CmdSetGuild cmdSetGuild = new CmdSetGuild ( ) ;
2019-12-12 04:48:00 -06:00
public CmdDiscord cmdDiscord = new CmdDiscord ( ) ;
public CmdDebug cmdDebug = new CmdDebug ( ) ;
2019-12-22 18:21:17 -05:00
public CmdDrain cmdDrain = new CmdDrain ( ) ;
2019-12-24 09:19:43 -05:00
public CmdLookup cmdLookup = new CmdLookup ( ) ;
2019-12-28 04:58:33 -05:00
public CmdAudit cmdAudit = new CmdAudit ( ) ;
2019-12-31 02:56:45 -05:00
public CmdReserve cmdReserve = new CmdReserve ( ) ;
2020-03-25 00:56:39 -04:00
public CmdDelHome cmdDelHome = new CmdDelHome ( ) ;
public CmdClaimFill cmdClaimFill = new CmdClaimFill ( ) ;
2020-04-02 15:15:59 -04:00
public CmdNotifications cmdNotifications = new CmdNotifications ( ) ;
2020-04-06 15:10:37 -04:00
public CmdFriendlyFire cmdFriendlyFire = new CmdFriendlyFire ( ) ;
2020-04-02 15:15:59 -04:00
2019-12-16 13:32:12 -06:00
//Variables to know if we already setup certain sub commands
public Boolean discordEnabled = false ;
public Boolean checkEnabled = false ;
public Boolean missionsEnabled = false ;
public Boolean fShopEnabled = false ;
public Boolean invSeeEnabled = false ;
public Boolean fPointsEnabled = false ;
public Boolean fAltsEnabled = false ;
public Boolean fGraceEnabled = false ;
public Boolean fFocusEnabled = false ;
public Boolean fFlyEnabled = false ;
public Boolean fPayPalEnabled = false ;
public Boolean coreProtectEnabled = false ;
public Boolean internalFTOPEnabled = false ;
2019-12-16 18:46:38 -06:00
public Boolean fWildEnabled = false ;
2019-12-28 04:58:33 -05:00
public Boolean fAuditEnabled = false ;
2020-03-23 16:31:33 -04:00
public Boolean fStrikes = false ;
2019-05-19 16:09:00 -04:00
2019-09-15 05:19:06 -04:00
public FCmdRoot ( ) {
super ( ) ;
2019-12-16 13:32:12 -06:00
instance = this ;
2018-12-06 16:06:46 -06:00
2019-09-15 05:19:06 -04:00
if ( CommodoreProvider . isSupported ( ) ) brigadierManager = new BrigadierManager ( ) ;
2018-12-06 16:06:46 -06:00
2019-09-15 05:19:06 -04:00
this . aliases . addAll ( Conf . baseCommandAliases ) ;
this . aliases . removeAll ( Collections . < String > singletonList ( null ) ) ;
2018-12-06 16:06:46 -06:00
2019-09-15 05:19:06 -04:00
this . setHelpShort ( " The faction base command " ) ;
this . helpLong . add ( FactionsPlugin . getInstance ( ) . txt . parseTags ( " <i>This command contains all faction stuff. " ) ) ;
2018-12-06 16:06:46 -06:00
2019-09-15 05:19:06 -04:00
if ( CommodoreProvider . isSupported ( ) ) brigadierManager = new BrigadierManager ( ) ;
2018-12-06 16:06:46 -06:00
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdAdmin ) ;
this . addSubCommand ( this . cmdAutoClaim ) ;
this . addSubCommand ( this . cmdBoom ) ;
this . addSubCommand ( this . cmdBypass ) ;
this . addSubCommand ( this . cmdChat ) ;
this . addSubCommand ( this . cmdToggleAllianceChat ) ;
this . addSubCommand ( this . cmdChatSpy ) ;
this . addSubCommand ( this . cmdClaim ) ;
this . addSubCommand ( this . cmdConfig ) ;
this . addSubCommand ( this . cmdCreate ) ;
this . addSubCommand ( this . cmdDeinvite ) ;
this . addSubCommand ( this . cmdDescription ) ;
2020-03-25 00:56:39 -04:00
this . addSubCommand ( this . cmdDelHome ) ;
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdDisband ) ;
this . addSubCommand ( this . cmdHelp ) ;
this . addSubCommand ( this . cmdHome ) ;
this . addSubCommand ( this . cmdInvite ) ;
this . addSubCommand ( this . cmdJoin ) ;
this . addSubCommand ( this . cmdKick ) ;
this . addSubCommand ( this . cmdLeave ) ;
this . addSubCommand ( this . cmdList ) ;
this . addSubCommand ( this . cmdLock ) ;
this . addSubCommand ( this . cmdMap ) ;
this . addSubCommand ( this . cmdMod ) ;
this . addSubCommand ( this . cmdMoney ) ;
this . addSubCommand ( this . cmdOpen ) ;
this . addSubCommand ( this . cmdOwner ) ;
this . addSubCommand ( this . cmdOwnerList ) ;
this . addSubCommand ( this . cmdPeaceful ) ;
this . addSubCommand ( this . cmdPermanent ) ;
this . addSubCommand ( this . cmdPermanentPower ) ;
this . addSubCommand ( this . cmdPower ) ;
this . addSubCommand ( this . cmdPowerBoost ) ;
this . addSubCommand ( this . cmdRelationAlly ) ;
this . addSubCommand ( this . cmdRelationEnemy ) ;
this . addSubCommand ( this . cmdRelationNeutral ) ;
this . addSubCommand ( this . cmdRelationTruce ) ;
this . addSubCommand ( this . cmdReload ) ;
this . addSubCommand ( this . cmdSafeunclaimall ) ;
this . addSubCommand ( this . cmdSaveAll ) ;
this . addSubCommand ( this . cmdSethome ) ;
this . addSubCommand ( this . cmdShow ) ;
this . addSubCommand ( this . cmdStatus ) ;
this . addSubCommand ( this . cmdStealth ) ;
this . addSubCommand ( this . cmdStuck ) ;
this . addSubCommand ( this . cmdLogout ) ;
this . addSubCommand ( this . cmdTag ) ;
this . addSubCommand ( this . cmdTitle ) ;
2019-11-28 19:34:39 -06:00
this . addSubCommand ( this . cmdPlayerTitleToggle ) ;
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdUnclaim ) ;
this . addSubCommand ( this . cmdUnclaimall ) ;
this . addSubCommand ( this . cmdVersion ) ;
this . addSubCommand ( this . cmdWarunclaimall ) ;
this . addSubCommand ( this . cmdSB ) ;
this . addSubCommand ( this . cmdShowInvites ) ;
this . addSubCommand ( this . cmdAnnounce ) ;
this . addSubCommand ( this . cmdSeeChunk ) ;
this . addSubCommand ( this . cmdConvert ) ;
this . addSubCommand ( this . cmdFWarp ) ;
this . addSubCommand ( this . cmdSetFWarp ) ;
this . addSubCommand ( this . cmdDelFWarp ) ;
this . addSubCommand ( this . cmdModifyPower ) ;
this . addSubCommand ( this . cmdLogins ) ;
2020-03-25 00:56:39 -04:00
this . addSubCommand ( this . cmdClaimFill ) ;
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdClaimLine ) ;
this . addSubCommand ( this . cmdAHome ) ;
this . addSubCommand ( this . cmdPerm ) ;
this . addSubCommand ( this . cmdPromote ) ;
2019-12-12 04:48:00 -06:00
this . addSubCommand ( this . cmdDebug ) ;
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdDemote ) ;
this . addSubCommand ( this . cmdSetDefaultRole ) ;
this . addSubCommand ( this . cmdMapHeight ) ;
this . addSubCommand ( this . cmdClaimAt ) ;
this . addSubCommand ( this . cmdban ) ;
this . addSubCommand ( this . cmdUnban ) ;
this . addSubCommand ( this . cmdbanlist ) ;
this . addSubCommand ( this . cmdRules ) ;
this . addSubCommand ( this . cmdCheckpoint ) ;
this . addSubCommand ( this . cmdTnt ) ;
this . addSubCommand ( this . cmdNear ) ;
this . addSubCommand ( this . cmdUpgrades ) ;
this . addSubCommand ( this . cmdVault ) ;
this . addSubCommand ( this . cmdGetVault ) ;
this . addSubCommand ( this . cmdColeader ) ;
this . addSubCommand ( this . cmdBanner ) ;
this . addSubCommand ( this . cmdTpBanner ) ;
this . addSubCommand ( this . cmdKillHolograms ) ;
this . addSubCommand ( this . cmdCoords ) ;
this . addSubCommand ( this . cmdShowClaims ) ;
this . addSubCommand ( this . cmdLowPower ) ;
this . addSubCommand ( this . cmdTntFill ) ;
this . addSubCommand ( this . cmdChest ) ;
this . addSubCommand ( this . cmdSetBanner ) ;
this . addSubCommand ( this . cmdCorner ) ;
this . addSubCommand ( this . cmdFGlobal ) ;
this . addSubCommand ( this . cmdViewChest ) ;
2019-09-16 07:36:42 -04:00
this . addSubCommand ( this . cmdSpawnerLock ) ;
2019-12-22 18:21:17 -05:00
this . addSubCommand ( this . cmdDrain ) ;
2019-12-24 09:19:43 -05:00
this . addSubCommand ( this . cmdLookup ) ;
2020-04-02 15:15:59 -04:00
this . addSubCommand ( this . cmdNotifications ) ;
2020-04-06 15:10:37 -04:00
this . addSubCommand ( this . cmdFriendlyFire ) ;
2019-12-16 13:32:12 -06:00
addVariableCommands ( ) ;
if ( CommodoreProvider . isSupported ( ) ) brigadierManager . build ( ) ;
}
2019-05-22 20:12:46 -04:00
2019-12-16 13:32:12 -06:00
/ * *
* Add sub commands to the root if they are enabled
* /
public void addVariableCommands ( ) {
//Discord
2020-01-18 02:18:38 -05:00
if ( Conf . useDiscordSystem & & ! discordEnabled ) {
this . addSubCommand ( this . cmdInviteBot ) ;
this . addSubCommand ( this . cmdSetGuild ) ;
this . addSubCommand ( this . cmdSetDiscord ) ;
this . addSubCommand ( this . cmdSeeDiscord ) ;
this . addSubCommand ( this . cmdDiscord ) ;
discordEnabled = true ;
}
//Reserve
if ( Conf . useReserveSystem ) {
2019-12-31 02:56:45 -05:00
this . addSubCommand ( this . cmdReserve ) ;
}
2019-12-16 13:32:12 -06:00
//PayPal
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " fpaypal.Enabled " , false ) & & ! fPayPalEnabled ) {
this . addSubCommand ( this . cmdPaypalSet ) ;
this . addSubCommand ( this . cmdPaypalSee ) ;
fPayPalEnabled = true ;
2019-09-29 04:39:30 -04:00
}
2019-12-16 13:32:12 -06:00
//Check
if ( Conf . useCheckSystem & & ! checkEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdCheck ) ;
this . addSubCommand ( this . cmdWeeWoo ) ;
2019-12-16 13:32:12 -06:00
checkEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
//CoreProtect
if ( Bukkit . getServer ( ) . getPluginManager ( ) . getPlugin ( " CoreProtect " ) ! = null & & ! coreProtectEnabled ) {
FactionsPlugin . getInstance ( ) . log ( " Found CoreProtect, enabling Inspect " ) ;
this . addSubCommand ( this . cmdInspect ) ;
coreProtectEnabled = true ;
} else {
FactionsPlugin . getInstance ( ) . log ( " CoreProtect not found, disabling Inspect " ) ;
}
//FTOP
if ( ( Bukkit . getServer ( ) . getPluginManager ( ) . getPlugin ( " FactionsTop " ) ! = null | | Bukkit . getServer ( ) . getPluginManager ( ) . getPlugin ( " SavageFTOP " ) ! = null | | Bukkit . getServer ( ) . getPluginManager ( ) . getPlugin ( " SaberFTOP " ) ! = null ) & & ! internalFTOPEnabled ) {
FactionsPlugin . getInstance ( ) . log ( Level . INFO , " Found FactionsTop plugin. Disabling our own /f top command. " ) ;
} else {
FactionsPlugin . getInstance ( ) . log ( Level . INFO , " Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc. " ) ;
this . addSubCommand ( this . cmdTop ) ;
internalFTOPEnabled = true ;
}
2019-12-28 04:58:33 -05:00
2020-01-18 02:18:38 -05:00
if ( Conf . useAuditSystem ) {
2019-12-28 04:58:33 -05:00
this . addSubCommand ( cmdAudit ) ;
fAuditEnabled = true ;
}
2020-03-25 00:56:39 -04:00
if ( Conf . useStrikeSystem ) {
2020-03-23 16:31:33 -04:00
this . addSubCommand ( this . cmdStrikes ) ;
fStrikes = true ;
}
2019-12-16 13:32:12 -06:00
//Other
2019-12-16 18:46:38 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " Wild.Enabled " , false ) & & ! fWildEnabled ) {
this . addSubCommand ( this . cmdWild ) ;
fWildEnabled = true ;
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " Missions-Enabled " , false ) & & ! missionsEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdMissions ) ;
2019-12-16 13:32:12 -06:00
missionsEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " F-Shop.Enabled " , false ) & & ! fShopEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdShop ) ;
2019-12-16 13:32:12 -06:00
fShopEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " f-inventory-see.Enabled " , false ) & & ! invSeeEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdInventorySee ) ;
2019-12-16 13:32:12 -06:00
invSeeEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " f-points.Enabled " , false ) & & ! fPointsEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdPoints ) ;
2019-12-16 13:32:12 -06:00
fPointsEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " f-alts.Enabled " , false ) & & ! fAltsEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdAlts ) ;
2019-12-16 13:32:12 -06:00
fAltsEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " f-grace.Enabled " , false ) & & ! fGraceEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdGrace ) ;
2019-12-16 13:32:12 -06:00
fGraceEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " ffocus.Enabled " ) & & ! fFocusEnabled ) {
2019-09-15 05:19:06 -04:00
addSubCommand ( this . cmdFocus ) ;
2019-12-16 13:32:12 -06:00
fFocusEnabled = true ;
2019-09-15 05:19:06 -04:00
}
2019-12-16 13:32:12 -06:00
if ( FactionsPlugin . getInstance ( ) . getConfig ( ) . getBoolean ( " enable-faction-flight " , false ) & & ! fFlyEnabled ) {
2019-09-15 05:19:06 -04:00
this . addSubCommand ( this . cmdFly ) ;
2019-12-16 13:32:12 -06:00
fFlyEnabled = true ;
2020-04-04 18:41:13 -05:00
CmdFly . startFlyCheck ( ) ;
CmdFly . startParticles ( ) ;
2019-09-15 05:19:06 -04:00
}
}
2019-09-14 15:13:01 -04:00
2020-01-18 02:18:38 -05:00
public void rebuild ( ) {
if ( CommodoreProvider . isSupported ( ) ) brigadierManager . build ( ) ;
}
2019-12-16 13:32:12 -06:00
2019-09-15 05:19:06 -04:00
@Override
public void perform ( CommandContext context ) {
context . commandChain . add ( this ) ;
this . cmdHelp . execute ( context ) ;
}
2018-12-06 16:06:46 -06:00
2019-09-15 05:19:06 -04:00
@Override
public boolean onCommand ( CommandSender sender , Command command , String label , String [ ] args ) {
this . execute ( new CommandContext ( sender , new ArrayList < > ( Arrays . asList ( args ) ) , label ) ) ;
return true ;
}
2019-09-14 15:13:01 -04:00
2019-09-15 05:19:06 -04:00
@Override
public void addSubCommand ( FCommand subCommand ) {
super . addSubCommand ( subCommand ) ;
// People were getting NPE's as somehow CommodoreProvider#isSupported returned true on legacy versions.
if ( CommodoreProvider . isSupported ( ) ) {
brigadierManager . addSubCommand ( subCommand ) ;
}
}
2019-08-24 13:18:50 -04:00
2019-09-15 05:19:06 -04:00
@Override
public TL getUsageTranslation ( ) {
return TL . GENERIC_PLACEHOLDER ;
}
2018-12-06 16:06:46 -06:00
}