From af5d2c2fcac0df91ebcd94f13dc2540205a76478 Mon Sep 17 00:00:00 2001 From: Ali Moghnieh Date: Thu, 4 May 2017 13:52:59 +0100 Subject: [PATCH] Remove Supervisor support. This reverts commit 442d97a1b17fbffbccc8dd8148ea6ad78b1d0c8c, fcbd3deb6b84507a0a7387ee93caf1120b754594, and 6231a254138cfaf50bdba6cf89971623aca18a5d. Due to the lack of proper dependency deployment and availability users are unable to build EssentialsX without doing some manual installations. Until issue is resolved Supervisor support is dropped. --- Essentials/pom.xml | 16 --- .../com/earth2me/essentials/Essentials.java | 5 - .../src/com/earth2me/essentials/UserData.java | 4 - .../supervisor/EssentialsReportContext.java | 98 ------------------- Essentials/src/plugin.yml | 4 +- 5 files changed, 2 insertions(+), 125 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/supervisor/EssentialsReportContext.java diff --git a/Essentials/pom.xml b/Essentials/pom.xml index 46702a90b..c2e2b8480 100644 --- a/Essentials/pom.xml +++ b/Essentials/pom.xml @@ -133,27 +133,11 @@ - - com.supaham.supervisor - supervisor-bukkit - 1.3-SNAPSHOT - provided - - - org.spigotmc - spigot-api - - - vault-repo http://nexus.hc.to/content/repositories/pub_releases - - ender-zone-repo - http://ci.ender.zone/plugin/repository/everything/ - diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 4612c8f11..38c1633a5 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -24,7 +24,6 @@ import com.earth2me.essentials.register.payment.Methods; import com.earth2me.essentials.signs.SignBlockListener; import com.earth2me.essentials.signs.SignEntityListener; import com.earth2me.essentials.signs.SignPlayerListener; -import com.earth2me.essentials.supervisor.EssentialsReportContext; import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.SimpleTextInput; @@ -258,10 +257,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials { // Failed to submit the stats :-( } - if (getServer().getPluginManager().getPlugin("Supervisor") != null) { - EssentialsReportContext.load(this); - } - final String timeroutput = execTimer.end(); if (getSettings().isDebug()) { LOGGER.log(Level.INFO, "Essentials load {0}", timeroutput); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index d06c7145d..22d1e29b8 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -928,8 +928,4 @@ public abstract class UserData extends PlayerExtension implements IConf { public void stopTransaction() { config.stopTransaction(); } - - public EssentialsUserConf getConfig() { - return config; - } } diff --git a/Essentials/src/com/earth2me/essentials/supervisor/EssentialsReportContext.java b/Essentials/src/com/earth2me/essentials/supervisor/EssentialsReportContext.java deleted file mode 100644 index 1b7cd25f4..000000000 --- a/Essentials/src/com/earth2me/essentials/supervisor/EssentialsReportContext.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.earth2me.essentials.supervisor; - -import com.earth2me.essentials.Essentials; -import com.earth2me.essentials.User; -import com.earth2me.essentials.UserMap; -import com.supaham.supervisor.bukkit.SupervisorPlugin; -import com.supaham.supervisor.report.AbstractReportContextEntry; -import com.supaham.supervisor.report.ReportContext; -import com.supaham.supervisor.report.ReportContextEntry; -import com.supaham.supervisor.report.ReportSpecifications; -import com.supaham.supervisor.report.ReportSpecifications.ReportLevel; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Map; - -import javax.annotation.Nonnull; - -public class EssentialsReportContext extends ReportContext { - - private static final Method getNamesMethod; - - private final Essentials ess; - - static { - try { - getNamesMethod = UserMap.class.getDeclaredMethod("getNames"); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - } - - public static void load(Essentials ess) { - SupervisorPlugin.get().registerContext(ess, new EssentialsReportContext(ess)); - } - - public EssentialsReportContext(Essentials ess) { - super("essentialsx", "EssentialsX", "1"); - this.ess = ess; - } - - @Override - public ReportContextEntry createEntry(@Nonnull ReportSpecifications specs) { - return new EssentialsContext(this, specs); - } - - private final class EssentialsContext extends AbstractReportContextEntry { - - public EssentialsContext(@Nonnull ReportContext parentContext, @Nonnull ReportSpecifications reportSpecifications) { - super(parentContext, reportSpecifications); - } - - @Override - public void run() { - append("users_count", ess.getUserMap().getUniqueUsers()); - uuidMapCount(); - - if (getReportLevel() >= ReportLevel.NORMAL) { - userdata(); - } - - if (getReportLevel() > ReportLevel.BRIEF) { - config(); - } - } - - private void uuidMapCount() { - try { - getNamesMethod.setAccessible(true); - append("uuidmap_count", ((Map) getNamesMethod.invoke(ess.getUserMap())).size()); - getNamesMethod.setAccessible(false); - } catch (IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); - } - } - - private void userdata() { - for (User user : ess.getOnlineUsers()) { - File file = user.getConfig().getFile(); - try { - createPlainTextFile("userdata/" + file.getName(), user.getName() + " data").appendFile(file); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - private void config() { - try { - createPlainTextFile("config.yml", "Essentials Configuration file").appendFile(new File(ess.getDataFolder(), "config.yml")); - } catch (IOException e) { - e.printStackTrace(); - } - } - } -} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index aa7340728..5b4304971 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -5,8 +5,8 @@ main: com.earth2me.essentials.Essentials version: ${project.version}-b${build.number} website: http://tiny.cc/EssentialsCommands description: Provides an essential, core set of commands for Bukkit. -softdepend: [Vault, Supervisor] -authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Iaccidentally, drtshock, vemacs, SupaHam] +softdepend: [Vault] +authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Iaccidentally, drtshock, vemacs] commands: afk: description: Marks you as away-from-keyboard.