diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..59b11d1 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml b/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml deleted file mode 100644 index f3f3738..0000000 --- a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_10.xml b/.idea/libraries/Maven__junit_junit_4_10.xml deleted file mode 100644 index ed8bf5f..0000000 --- a/.idea/libraries/Maven__junit_junit_4_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_13_SNAPSHOT.xml b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_15_SNAPSHOT.xml similarity index 54% rename from .idea/libraries/Maven__net_md_5_bungeecord_chat_1_13_SNAPSHOT.xml rename to .idea/libraries/Maven__net_md_5_bungeecord_chat_1_15_SNAPSHOT.xml index 3b9f067..a3b6e08 100644 --- a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_13_SNAPSHOT.xml +++ b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_15_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml deleted file mode 100644 index acdf443..0000000 --- a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_13_2_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_15_2_R0_1_SNAPSHOT.xml similarity index 52% rename from .idea/libraries/Maven__org_spigotmc_spigot_api_1_13_2_R0_1_SNAPSHOT.xml rename to .idea/libraries/Maven__org_spigotmc_spigot_api_1_15_2_R0_1_SNAPSHOT.xml index 7fc6743..9a1f762 100644 --- a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_13_2_R0_1_SNAPSHOT.xml +++ b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_15_2_R0_1_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml b/.idea/libraries/Maven__org_yaml_snakeyaml_1_25.xml similarity index 69% rename from .idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml rename to .idea/libraries/Maven__org_yaml_snakeyaml_1_25.xml index 7e63769..495fc06 100644 --- a/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml +++ b/.idea/libraries/Maven__org_yaml_snakeyaml_1_25.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1cfb342..62889be 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ org.spigotmc spigot-api - 1.13.2-R0.1-SNAPSHOT + 1.15.2-R0.1-SNAPSHOT provided diff --git a/src/main/java/me/kyllian/xRay/XRayPlugin.java b/src/main/java/me/kyllian/xRay/XRayPlugin.java index 91de5e9..59be0aa 100644 --- a/src/main/java/me/kyllian/xRay/XRayPlugin.java +++ b/src/main/java/me/kyllian/xRay/XRayPlugin.java @@ -7,6 +7,7 @@ import me.kyllian.xRay.handlers.XRayHandler; import me.kyllian.xRay.listeners.PlayerMoveListener; import me.kyllian.xRay.listeners.PlayerQuitListener; +import me.kyllian.xRay.tasks.TaskType; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -26,9 +27,12 @@ public class XRayPlugin extends JavaPlugin { @Override public void onEnable() { - if (Bukkit.getPluginManager().getPlugin("ProtocolLib") == null) { - Bukkit.getLogger().warning("xRay has been disabled, please download Protocollib!"); - Bukkit.getPluginManager().disablePlugin(this); + initializeConfig(); + if (Bukkit.getPluginManager().getPlugin("ProtocolLib") == null && + TaskType.valueOf(getConfig().getString("Settings.Mode")) == TaskType.CHUNK) { + Bukkit.getLogger().warning("ProtocolLib not found, changing mode to BLOCK"); + getConfig().set("Settings.Mode", "BLOCK"); + saveConfig(); return; } @@ -38,7 +42,7 @@ public void onEnable() { initializeHandlers(); initializeListeners(); - initializeConfig(); + } @Override @@ -65,7 +69,8 @@ public void initializeConfig() { Map tempData = new HashMap<>(); for (String block : getConfig().getStringList("Settings.xRayBlocks")) { - if (Bukkit.getVersion().contains("1.8") || Bukkit.getVersion().contains("1.7")) tempData.put(block, WrappedBlockData.createData(Material.valueOf(block), 1)); + if (Bukkit.getVersion().contains("1.8") || Bukkit.getVersion().contains("1.7")) + tempData.put(block, WrappedBlockData.createData(Material.valueOf(block), 1)); else tempData.put(block, WrappedBlockData.createData(Material.valueOf(block))); } data = Collections.unmodifiableMap(tempData); diff --git a/src/main/java/me/kyllian/xRay/threads/ChunkThread.java b/src/main/java/me/kyllian/xRay/threads/ChunkThread.java index 7e74d7b..3c484db 100644 --- a/src/main/java/me/kyllian/xRay/threads/ChunkThread.java +++ b/src/main/java/me/kyllian/xRay/threads/ChunkThread.java @@ -26,8 +26,9 @@ public ChunkThread(XRayPlugin plugin, Chunk chunk, Player player) { this.plugin = plugin; this.chunk = chunk; this.player = player; - barrierBlock = WrappedBlockData.createData(Material.BARRIER); - airBlock = WrappedBlockData.createData(Material.AIR); + boolean old = Bukkit.getVersion().contains("1.8") || Bukkit.getVersion().contains("1.7"); + barrierBlock = old ? WrappedBlockData.createData(Material.BARRIER, 1) : WrappedBlockData.createData(Material.BARRIER); + airBlock = old ? WrappedBlockData.createData(Material.AIR, 1) : WrappedBlockData.createData(Material.AIR); } public void startTask() { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4de23d6..19112c7 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,8 +1,8 @@ name: xRay -version: 3.11 +version: 3.12 main: me.kyllian.xRay.XRayPlugin description: A legit xRay -depend: [ProtocolLib] +softdepend: [ProtocolLib] api-version: 1.15 commands: diff --git a/xRay.iml b/xRay.iml index 388ab09..f5a63c0 100644 --- a/xRay.iml +++ b/xRay.iml @@ -17,15 +17,12 @@ - + - - - - - + +