From a01d41d143f5473e03b62f97b43a822c00e219f9 Mon Sep 17 00:00:00 2001 From: Etzelia Date: Wed, 24 Oct 2018 14:19:03 -0500 Subject: [PATCH] Cleanup for release Updated EtzCore to 1.0.5 Removed Maven annotations Updated Essentials/Dynmap interfaces Overwrite qol.png to hopefully stop seeing that stupid warning log --- pom.xml | 6 +--- src/main/java/xyz/etztech/qol/QoL.java | 30 ++++++++----------- .../listeners/CommandPreprocessListener.java | 2 +- .../xyz/etztech/qol/other/TPSRunnable.java | 2 +- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index cfe3f15..91c1ba3 100644 --- a/pom.xml +++ b/pom.xml @@ -37,26 +37,22 @@ xyz.etztech EtzCore - 1.0.4 - compile + 1.0.5 net.ess3 Essentials 2.14-SNAPSHOT - provided us.dynmap dynmap-api 1.9.4 - provided commons-lang commons-lang 2.6 - provided diff --git a/src/main/java/xyz/etztech/qol/QoL.java b/src/main/java/xyz/etztech/qol/QoL.java index 532936e..b731f2e 100644 --- a/src/main/java/xyz/etztech/qol/QoL.java +++ b/src/main/java/xyz/etztech/qol/QoL.java @@ -1,11 +1,12 @@ package xyz.etztech.qol; +import net.ess3.api.IEssentials; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; -import xyz.etztech.core.maven.MavenLibrary; -import xyz.etztech.core.maven.MavenPlugin; +import org.bukkit.plugin.java.JavaPlugin; +import org.dynmap.DynmapAPI; import xyz.etztech.qol.commands.*; import xyz.etztech.qol.listeners.*; import xyz.etztech.qol.other.LinkCommand; @@ -16,14 +17,11 @@ import java.util.List; import java.util.UUID; import java.util.logging.Logger; -@MavenLibrary(group = "net.ess3", artifact = "Essentials", version = "2.13.1", repository = "http://repo.ess3.net/content/groups/essentials") -@MavenLibrary(group = "us.dynmap", artifact = "dynmap-api", version = "1.9.4", repository = "http://repo.mikeprimm.com/") -@MavenLibrary(group = "commons-lang", artifact = "commons-lang", version = "2.6") -public class QoL extends MavenPlugin { +public class QoL extends JavaPlugin { private static QoL instance; - private Object essentials = null; - private Object dynmap = null; + private IEssentials essentials = null; + private DynmapAPI dynmap = null; public static FileConfiguration config; private Logger log = Logger.getLogger( "Minecraft" ); @@ -35,23 +33,22 @@ public class QoL extends MavenPlugin { private static List audits = new ArrayList<>(); private static List links = new ArrayList<>(); - @Override - public void enable() { + public void onEnable() { instance = this; saveDefaultConfig(); reloadConfig(); - saveResource("qol.png", false); + saveResource("qol.png", true); //Essentials hook if (Bukkit.getPluginManager().isPluginEnabled("Essentials")) { log("Hooked into Essentials for TPS alert."); - essentials = Bukkit.getPluginManager().getPlugin("Essentials"); + essentials = (IEssentials) Bukkit.getPluginManager().getPlugin("Essentials"); } //Dynmap hook if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) { log("Hooked into Dynmap."); - dynmap = Bukkit.getPluginManager().getPlugin("dynmap"); + dynmap = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap"); } if( isEnabled() ) { @@ -194,8 +191,7 @@ public class QoL extends MavenPlugin { } } - @Override - public void disable() { + public void onDisable() { } public void disablePlugin() { @@ -262,9 +258,9 @@ public class QoL extends MavenPlugin { return links; } - public Object getEssentials() { return essentials; } + public IEssentials getEssentials() { return essentials; } - public Object getDynmap() { return dynmap; } + public DynmapAPI getDynmap() { return dynmap; } private void runTask(final String command) { diff --git a/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java b/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java index 7cc97bd..91e1c11 100644 --- a/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java +++ b/src/main/java/xyz/etztech/qol/listeners/CommandPreprocessListener.java @@ -49,7 +49,7 @@ public class CommandPreprocessListener implements Listener { String base = command.split(" ")[0].substring(1).toLowerCase(); // Strip the slash Player sender = event.getPlayer(); - DynmapAPI dynmap = (DynmapAPI) plugin.getDynmap(); + DynmapAPI dynmap = plugin.getDynmap(); // Spec dynmap hide if (base.equals("spec") && sender.hasPermission("SafeSpectate.spectate") && dynmap != null) { diff --git a/src/main/java/xyz/etztech/qol/other/TPSRunnable.java b/src/main/java/xyz/etztech/qol/other/TPSRunnable.java index 18be712..e25e3fa 100644 --- a/src/main/java/xyz/etztech/qol/other/TPSRunnable.java +++ b/src/main/java/xyz/etztech/qol/other/TPSRunnable.java @@ -18,7 +18,7 @@ public class TPSRunnable implements Runnable { @Override public void run() { - IEssentials essentials = (IEssentials) plugin.getEssentials(); + IEssentials essentials = plugin.getEssentials(); if (essentials != null) { double tps = essentials.getTimer().getAverageTPS(); int threshold = plugin.getConfig().getInt("tps.threshold", 0);