diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index b7d011140..ce1c20a68 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -60,18 +60,14 @@ import lombok.NonNull; import lombok.Setter; import org.jetbrains.annotations.Nullable; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLConnection; -import java.nio.file.Files; import java.sql.SQLException; import java.util.ArrayDeque; import java.util.ArrayList; @@ -79,7 +75,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; -import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -1606,18 +1601,6 @@ import java.util.zip.ZipInputStream; } } Settings.load(configFile); - //Sets the version information for the settings.yml file - try (InputStream stream = getClass().getResourceAsStream("/plugin.properties")) { - try (BufferedReader br = new BufferedReader(new InputStreamReader(stream))) { - String versionString = br.readLine(); - String commitString = br.readLine(); - String dateString = br.readLine(); - this.version = PlotVersion.tryParse(versionString, commitString, dateString); - System.out.println("Version is " + this.version); - } - } catch (IOException throwable) { - throwable.printStackTrace(); - } Settings.save(configFile); config = YamlConfiguration.loadConfiguration(configFile); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java index ea533e598..d6abb880d 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java @@ -3,14 +3,6 @@ package com.github.intellectualsites.plotsquared.plot; public class PlotVersion { public final int year, month, day, hash, build; - public PlotVersion(int year, int month, int day, int hash, int build) { - this.year = year; - this.month = month; - this.day = day; - this.hash = hash; - this.build = build; - } - public PlotVersion(String version, String commit, String date) { String[] split = version.substring(version.indexOf('=') + 1).split("\\."); this.build = Integer.parseInt(split[1]); @@ -21,23 +13,8 @@ public class PlotVersion { this.day = Integer.parseInt(split1[2]); } - public static PlotVersion tryParse(String version, String commit, String date) { - try { - return new PlotVersion(version, commit, date); - } catch (Exception e) { - e.printStackTrace(); - return new PlotVersion(0, 0, 0, 0, 0); - } - } - - public String versionString() { - if (hash == 0 && build == 0) { - return "NoVer-SNAPSHOT"; - } else { - return "5." + build; - } - } - @Override public String toString() { + @Override + public String toString() { if (hash == 0 && build == 0) { return "PlotSquared-NoVer-SNAPSHOT"; } else {