From 27c21b9ab68d9c3e78a380aac6fa5f8745c6af31 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Tue, 30 Aug 2016 21:50:52 -0400 Subject: [PATCH] Fix #1321 --- .../main/java/com/plotsquared/sponge/SpongeMain.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java b/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java index 2e22f19b0..3e18a0bf9 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/SpongeMain.java @@ -170,9 +170,12 @@ public class SpongeMain implements IPlotMain { @Override public int[] getPluginVersion() { - String version = this.plugin.getVersion().orElse(""); - String[] split = version.split("\\."); - return new int[]{Integer.parseInt(split[0]), Integer.parseInt(split[1]), split.length == 3 ? Integer.parseInt(split[2]) : 0}; + String ver = this.plugin.getVersion().orElse(""); + if (ver.contains("-")) { + ver = ver.split("-")[0]; + } + String[] split = ver.split("\\."); + return new int[]{Integer.parseInt(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])}; } @Override public String getPluginVersionString() { @@ -262,10 +265,10 @@ public class SpongeMain implements IPlotMain { public boolean initWorldEdit() { try { Class.forName("com.sk89q.worldedit.WorldEdit"); - return true; } catch (ClassNotFoundException ignored) { return false; } + return true; } @Override