diff --git a/plugin.yml b/plugin.yml
index d2f88fb..e7c79cb 100644
--- a/plugin.yml
+++ b/plugin.yml
@@ -1,5 +1,5 @@
name: AuxProtect
-version: 1.0.6
+version: 1.0.7
main: dev.heliosares.auxprotect.AuxProtect
description: A plugin designed to suplement CoreProtect in a few ways.
api-version: 1.13
diff --git a/pom.xml b/pom.xml
index e9203f1..a190481 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
AuxProtect
AuxProtect
- 1.0.6
+ 1.0.7
AuxProtect
${myPath}/plugins
diff --git a/src/dev/heliosares/auxprotect/AuxProtect.java b/src/dev/heliosares/auxprotect/AuxProtect.java
index f0663a1..0f5deab 100644
--- a/src/dev/heliosares/auxprotect/AuxProtect.java
+++ b/src/dev/heliosares/auxprotect/AuxProtect.java
@@ -69,6 +69,12 @@ public class AuxProtect extends JavaPlugin implements IAuxProtect {
long lastloaded;
+ private int SERVER_VERSION;
+
+ public int getCompatabilityVersion() {
+ return SERVER_VERSION;
+ }
+
@Override
public void onEnable() {
instance = this;
@@ -77,6 +83,11 @@ public class AuxProtect extends JavaPlugin implements IAuxProtect {
this.reloadConfig();
this.getConfig().options().copyDefaults(true);
+ debug = getConfig().getInt("debug", 0);
+
+ config = new APConfig(this.getConfig());
+ config.load();
+
YMLManager langManager = new YMLManager("en-us", this);
langManager.load(true);
lang = new Language(langManager.getData());
@@ -87,10 +98,14 @@ public class AuxProtect extends JavaPlugin implements IAuxProtect {
data.getData().set("lastloaded", System.currentTimeMillis());
data.save();
- config = new APConfig(this.getConfig());
- config.load();
-
- debug = getConfig().getInt("debug", 0);
+ try {
+ SERVER_VERSION = Integer.parseInt(Bukkit.getBukkitVersion().split("\\.")[1]);
+ } catch (Exception e) {
+ warning("Failed to parse version string: \"" + Bukkit.getBukkitVersion() + "\". Defaulting to 1.16");
+ SERVER_VERSION = 16;
+ e.printStackTrace();
+ }
+ debug("Compatability version: " + SERVER_VERSION, 1);
File sqliteFile = new File(getDataFolder(), "database/auxprotect.db");
if (!sqliteFile.getParentFile().exists()) {
@@ -153,9 +168,7 @@ public class AuxProtect extends JavaPlugin implements IAuxProtect {
if (System.currentTimeMillis() - lastPos > config.posInterval) {
lastPos = System.currentTimeMillis();
for (Player player : Bukkit.getOnlinePlayers()) {
- dbRunnable.add(new DbEntry("$" + player.getUniqueId().toString(), EntryAction.POS, false,
- player.getLocation(), "", "Y:" + Math.round(player.getLocation().getYaw()) + " P:"
- + Math.round(player.getLocation().getPitch())));
+ PlayerListener.logPos(AuxProtect.this, player, player.getLocation(), "");
}
}
}
diff --git a/src/dev/heliosares/auxprotect/command/XrayCommand.java b/src/dev/heliosares/auxprotect/command/XrayCommand.java
index 9e652de..07403c1 100644
--- a/src/dev/heliosares/auxprotect/command/XrayCommand.java
+++ b/src/dev/heliosares/auxprotect/command/XrayCommand.java
@@ -260,7 +260,9 @@ public class XrayCommand implements CommandExecutor {
actions.add(0);
List