Fixed NPE With Essentials for CMI users

This commit is contained in:
Driftay 2019-09-07 10:40:03 -04:00
parent e1158ac370
commit f303a4b497
2 changed files with 2 additions and 11 deletions

View File

@ -2,14 +2,12 @@ package com.massivecraft.factions;
import ch.njol.skript.Skript; import ch.njol.skript.Skript;
import ch.njol.skript.SkriptAddon; import ch.njol.skript.SkriptAddon;
import com.earth2me.essentials.IEssentials;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.massivecraft.factions.cmd.CmdAutoHelp; import com.massivecraft.factions.cmd.CmdAutoHelp;
import com.massivecraft.factions.cmd.FCmdRoot; import com.massivecraft.factions.cmd.FCmdRoot;
import com.massivecraft.factions.cmd.chest.ChestLogsHandler; import com.massivecraft.factions.cmd.chest.ChestLogsHandler;
import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.integration.Essentials;
import com.massivecraft.factions.integration.Worldguard; import com.massivecraft.factions.integration.Worldguard;
import com.massivecraft.factions.integration.dynmap.EngineDynmap; import com.massivecraft.factions.integration.dynmap.EngineDynmap;
import com.massivecraft.factions.listeners.*; import com.massivecraft.factions.listeners.*;
@ -267,12 +265,6 @@ public class P extends MPlugin {
for (Listener eventListener : eventsListener) for (Listener eventListener : eventsListener)
getServer().getPluginManager().registerEvents(eventListener, this); getServer().getPluginManager().registerEvents(eventListener, this);
IEssentials ess = Essentials.setup();
if (ess != null && Conf.removeHomesOnLeave) {
getServer().getPluginManager().registerEvents(new EssentialsHomeHandler(ess), this);
}
// since some other plugins execute commands directly through this command interface, provide it // since some other plugins execute commands directly through this command interface, provide it
getCommand(this.refCommand).setExecutor(this); getCommand(this.refCommand).setExecutor(this);
getCommand(this.refCommand).setTabCompleter(this); getCommand(this.refCommand).setTabCompleter(this);

View File

@ -19,12 +19,11 @@ public class Essentials {
private static IEssentials essentials; private static IEssentials essentials;
public static IEssentials setup() { public static void setup() {
Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials"); Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials");
if (ess != null) { if (ess != null) {
return Essentials.essentials = (IEssentials) ess; essentials = (IEssentials) ess;
} }
return null;
} }
public static boolean isOverBalCap(EconomyParticipator participator, double amount) { public static boolean isOverBalCap(EconomyParticipator participator, double amount) {