From 055adf2e9e8f38ef5afa1f98ced7436c51e035f5 Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Sun, 4 Mar 2018 16:46:17 -0800 Subject: [PATCH] Don't enable our own f top command if other plugin that handles it is enabled. Resolves #1066 --- src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java | 8 +++++++- src/main/resources/plugin.yml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java b/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java index 7c1ccb6b..9bc815fb 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java +++ b/src/main/java/com/massivecraft/factions/cmd/FCmdRoot.java @@ -3,8 +3,10 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Conf; import com.massivecraft.factions.P; import com.massivecraft.factions.zcore.util.TL; +import org.bukkit.Bukkit; import java.util.Collections; +import java.util.logging.Level; public class FCmdRoot extends FCommand { @@ -163,7 +165,6 @@ public class FCmdRoot extends FCommand { this.addSubCommand(this.cmdModifyPower); this.addSubCommand(this.cmdLogins); this.addSubCommand(this.cmdClaimLine); - this.addSubCommand(this.cmdTop); this.addSubCommand(this.cmdAHome); this.addSubCommand(this.cmdPerm); this.addSubCommand(this.cmdPromote); @@ -174,6 +175,11 @@ public class FCmdRoot extends FCommand { this.addSubCommand(this.cmdban); this.addSubCommand(this.cmdUnban); this.addSubCommand(this.cmdbanlist); + if (Bukkit.getServer().getPluginManager().isPluginEnabled("FactionsTop")) { + P.p.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command."); + } else { + this.addSubCommand(this.cmdTop); + } if (P.p.isHookedPlayervaults()) { P.p.log("Found playervaults hook, adding /f vault and /f setmaxvault commands."); this.addSubCommand(new CmdSetMaxVaults()); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 88aa2eeb..d3482df8 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,7 +2,7 @@ name: Factions version: ${project.version}-b${build.number} main: com.massivecraft.factions.P authors: [Olof Larsson, Brett Flannigan, drtshock] -softdepend: [PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap] +softdepend: [PlayerVaults, PlaceholderAPI, MVdWPlaceholderAPI, PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag, dynmap, FactionsTop] commands: factions: description: Reference command for Factions.