From f303a4b497e6c9eb8fe0016a67fb925f8a3970c0 Mon Sep 17 00:00:00 2001 From: Driftay Date: Sat, 7 Sep 2019 10:40:03 -0400 Subject: [PATCH] Fixed NPE With Essentials for CMI users --- src/main/java/com/massivecraft/factions/P.java | 8 -------- .../com/massivecraft/factions/integration/Essentials.java | 5 ++--- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/P.java b/src/main/java/com/massivecraft/factions/P.java index a3087d3e..9316ab2f 100644 --- a/src/main/java/com/massivecraft/factions/P.java +++ b/src/main/java/com/massivecraft/factions/P.java @@ -2,14 +2,12 @@ package com.massivecraft.factions; import ch.njol.skript.Skript; import ch.njol.skript.SkriptAddon; -import com.earth2me.essentials.IEssentials; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.massivecraft.factions.cmd.CmdAutoHelp; import com.massivecraft.factions.cmd.FCmdRoot; import com.massivecraft.factions.cmd.chest.ChestLogsHandler; import com.massivecraft.factions.integration.Econ; -import com.massivecraft.factions.integration.Essentials; import com.massivecraft.factions.integration.Worldguard; import com.massivecraft.factions.integration.dynmap.EngineDynmap; import com.massivecraft.factions.listeners.*; @@ -267,12 +265,6 @@ public class P extends MPlugin { for (Listener eventListener : eventsListener) 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 getCommand(this.refCommand).setExecutor(this); getCommand(this.refCommand).setTabCompleter(this); diff --git a/src/main/java/com/massivecraft/factions/integration/Essentials.java b/src/main/java/com/massivecraft/factions/integration/Essentials.java index 73c44d5d..2c189919 100644 --- a/src/main/java/com/massivecraft/factions/integration/Essentials.java +++ b/src/main/java/com/massivecraft/factions/integration/Essentials.java @@ -19,12 +19,11 @@ public class Essentials { private static IEssentials essentials; - public static IEssentials setup() { + public static void setup() { Plugin ess = Bukkit.getPluginManager().getPlugin("Essentials"); if (ess != null) { - return Essentials.essentials = (IEssentials) ess; + essentials = (IEssentials) ess; } - return null; } public static boolean isOverBalCap(EconomyParticipator participator, double amount) {