mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-28 05:35:28 +01:00
Don't consider the current file as a candidate for conflicting version.
This commit is contained in:
parent
14f667e2b9
commit
2a8dc4ad22
@ -283,12 +283,15 @@ public class ProtocolLibrary extends JavaPlugin {
|
|||||||
MinecraftVersion currentVersion = new MinecraftVersion(this.getDescription().getVersion());
|
MinecraftVersion currentVersion = new MinecraftVersion(this.getDescription().getVersion());
|
||||||
MinecraftVersion newestVersion = null;
|
MinecraftVersion newestVersion = null;
|
||||||
|
|
||||||
|
// Skip the file that contains this current instance however
|
||||||
|
File loadedFile = getFile();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Scan the plugin folder for newer versions of ProtocolLib
|
// Scan the plugin folder for newer versions of ProtocolLib
|
||||||
File pluginFolder = new File("plugins/");
|
File pluginFolder = new File("plugins/");
|
||||||
|
|
||||||
for (File candidate : pluginFolder.listFiles()) {
|
for (File candidate : pluginFolder.listFiles()) {
|
||||||
if (candidate.isFile()) {
|
if (candidate.isFile() && !candidate.equals(loadedFile)) {
|
||||||
Matcher match = ourPlugin.matcher(candidate.getName());
|
Matcher match = ourPlugin.matcher(candidate.getName());
|
||||||
|
|
||||||
if (match.matches()) {
|
if (match.matches()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user