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
master
Etzelia 2018-10-24 14:19:03 -05:00
parent 5ac54a96a9
commit a01d41d143
4 changed files with 16 additions and 24 deletions

View File

@ -37,26 +37,22 @@
<dependency> <dependency>
<groupId>xyz.etztech</groupId> <groupId>xyz.etztech</groupId>
<artifactId>EtzCore</artifactId> <artifactId>EtzCore</artifactId>
<version>1.0.4</version> <version>1.0.5</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.ess3</groupId> <groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId> <artifactId>Essentials</artifactId>
<version>2.14-SNAPSHOT</version> <version>2.14-SNAPSHOT</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>us.dynmap</groupId> <groupId>us.dynmap</groupId>
<artifactId>dynmap-api</artifactId> <artifactId>dynmap-api</artifactId>
<version>1.9.4</version> <version>1.9.4</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-lang</groupId> <groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId> <artifactId>commons-lang</artifactId>
<version>2.6</version> <version>2.6</version>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -1,11 +1,12 @@
package xyz.etztech.qol; package xyz.etztech.qol;
import net.ess3.api.IEssentials;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import xyz.etztech.core.maven.MavenLibrary; import org.bukkit.plugin.java.JavaPlugin;
import xyz.etztech.core.maven.MavenPlugin; import org.dynmap.DynmapAPI;
import xyz.etztech.qol.commands.*; import xyz.etztech.qol.commands.*;
import xyz.etztech.qol.listeners.*; import xyz.etztech.qol.listeners.*;
import xyz.etztech.qol.other.LinkCommand; import xyz.etztech.qol.other.LinkCommand;
@ -16,14 +17,11 @@ import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Logger; import java.util.logging.Logger;
@MavenLibrary(group = "net.ess3", artifact = "Essentials", version = "2.13.1", repository = "http://repo.ess3.net/content/groups/essentials") public class QoL extends JavaPlugin {
@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 {
private static QoL instance; private static QoL instance;
private Object essentials = null; private IEssentials essentials = null;
private Object dynmap = null; private DynmapAPI dynmap = null;
public static FileConfiguration config; public static FileConfiguration config;
private Logger log = Logger.getLogger( "Minecraft" ); private Logger log = Logger.getLogger( "Minecraft" );
@ -35,23 +33,22 @@ public class QoL extends MavenPlugin {
private static List<String> audits = new ArrayList<>(); private static List<String> audits = new ArrayList<>();
private static List<LinkCommand> links = new ArrayList<>(); private static List<LinkCommand> links = new ArrayList<>();
@Override public void onEnable() {
public void enable() {
instance = this; instance = this;
saveDefaultConfig(); saveDefaultConfig();
reloadConfig(); reloadConfig();
saveResource("qol.png", false); saveResource("qol.png", true);
//Essentials hook //Essentials hook
if (Bukkit.getPluginManager().isPluginEnabled("Essentials")) { if (Bukkit.getPluginManager().isPluginEnabled("Essentials")) {
log("Hooked into Essentials for TPS alert."); log("Hooked into Essentials for TPS alert.");
essentials = Bukkit.getPluginManager().getPlugin("Essentials"); essentials = (IEssentials) Bukkit.getPluginManager().getPlugin("Essentials");
} }
//Dynmap hook //Dynmap hook
if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) { if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) {
log("Hooked into Dynmap."); log("Hooked into Dynmap.");
dynmap = Bukkit.getPluginManager().getPlugin("dynmap"); dynmap = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap");
} }
if( isEnabled() ) { if( isEnabled() ) {
@ -194,8 +191,7 @@ public class QoL extends MavenPlugin {
} }
} }
@Override public void onDisable() {
public void disable() {
} }
public void disablePlugin() { public void disablePlugin() {
@ -262,9 +258,9 @@ public class QoL extends MavenPlugin {
return links; 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) { private void runTask(final String command) {

View File

@ -49,7 +49,7 @@ public class CommandPreprocessListener implements Listener {
String base = command.split(" ")[0].substring(1).toLowerCase(); // Strip the slash String base = command.split(" ")[0].substring(1).toLowerCase(); // Strip the slash
Player sender = event.getPlayer(); Player sender = event.getPlayer();
DynmapAPI dynmap = (DynmapAPI) plugin.getDynmap(); DynmapAPI dynmap = plugin.getDynmap();
// Spec dynmap hide // Spec dynmap hide
if (base.equals("spec") && sender.hasPermission("SafeSpectate.spectate") && dynmap != null) { if (base.equals("spec") && sender.hasPermission("SafeSpectate.spectate") && dynmap != null) {

View File

@ -18,7 +18,7 @@ public class TPSRunnable implements Runnable {
@Override @Override
public void run() { public void run() {
IEssentials essentials = (IEssentials) plugin.getEssentials(); IEssentials essentials = plugin.getEssentials();
if (essentials != null) { if (essentials != null) {
double tps = essentials.getTimer().getAverageTPS(); double tps = essentials.getTimer().getAverageTPS();
int threshold = plugin.getConfig().getInt("tps.threshold", 0); int threshold = plugin.getConfig().getInt("tps.threshold", 0);