mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-05-28 10:07:33 +00:00
Fix stack overflow when disabling commands from other addons (#4680)
This commit is contained in:
parent
dc27af78bf
commit
dae519494e
1 changed files with 5 additions and 1 deletions
|
@ -749,7 +749,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||
if (getSettings().isCommandDisabled(commandLabel)) {
|
||||
if (getKnownCommandsProvider().getKnownCommands().containsKey(commandLabel)) {
|
||||
final Command newCmd = getKnownCommandsProvider().getKnownCommands().get(commandLabel);
|
||||
if (!(newCmd instanceof PluginIdentifiableCommand) || ((PluginIdentifiableCommand) newCmd).getPlugin() != this) {
|
||||
if (!(newCmd instanceof PluginIdentifiableCommand) || !isEssentialsPlugin(((PluginIdentifiableCommand) newCmd).getPlugin())) {
|
||||
return newCmd.execute(cSender, commandLabel, args);
|
||||
}
|
||||
}
|
||||
|
@ -824,6 +824,10 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isEssentialsPlugin(Plugin plugin) {
|
||||
return plugin.getDescription().getMain().contains("com.earth2me.essentials") || plugin.getDescription().getMain().contains("net.essentialsx");
|
||||
}
|
||||
|
||||
public void cleanupOpenInventories() {
|
||||
for (final User user : getOnlineUsers()) {
|
||||
if (user.isRecipeSee()) {
|
||||
|
|
Loading…
Reference in a new issue