From 2a8dc4ad223b1e9bc638b7afe1eb8d09aadce611 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Tue, 22 Jan 2013 03:27:26 +0100 Subject: [PATCH] Don't consider the current file as a candidate for conflicting version. --- .../main/java/com/comphenix/protocol/ProtocolLibrary.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java index 4717e674..9a5bd6ac 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java @@ -283,12 +283,15 @@ public class ProtocolLibrary extends JavaPlugin { MinecraftVersion currentVersion = new MinecraftVersion(this.getDescription().getVersion()); MinecraftVersion newestVersion = null; + // Skip the file that contains this current instance however + File loadedFile = getFile(); + try { // Scan the plugin folder for newer versions of ProtocolLib File pluginFolder = new File("plugins/"); for (File candidate : pluginFolder.listFiles()) { - if (candidate.isFile()) { + if (candidate.isFile() && !candidate.equals(loadedFile)) { Matcher match = ourPlugin.matcher(candidate.getName()); if (match.matches()) {