Skip to content

Commit 2439ac0

Browse files
WunderoWundero
Wundero
authored and
Wundero
committed
Final fix + 4.3
Gonna push this update now. Should fix the current issues. From what I can tell version checking does NOT work on in-IDE eclipse server testing, but it seems to work just fine on my local test server so hopefully it doesn't break anything. Not that it's used other than in the statistics placeholder so whatever.
1 parent 9d940ee commit 2439ac0

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = 'me.rojo8399.placeholderapi'
7-
version = '4.2'
7+
version = '4.3'
88
description = 'An API for all of your placeholders.'
99

1010
compileJava.options.encoding = 'UTF-8'

src/main/java/me/rojo8399/placeholderapi/impl/PlaceholderAPIPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class PlaceholderAPIPlugin {
8888
private static PlaceholderAPIPlugin instance;
8989
public static final String PLUGIN_ID = "placeholderapi";
9090
public static final String PLUGIN_NAME = "PlaceholderAPI";
91-
public static final String PLUGIN_VERSION = "4.2";
91+
public static final String PLUGIN_VERSION = "4.3";
9292

9393
public static PlaceholderAPIPlugin getInstance() {
9494
return instance;

src/main/java/me/rojo8399/placeholderapi/impl/utils/Version.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@ private static class SubVersion implements Comparable<SubVersion> {
3636
private int intVal;
3737

3838
public SubVersion(String val) {
39-
this.intVal = Integer.parseInt(val);
39+
try {
40+
this.intVal = Integer.parseInt(val);
41+
} catch (Exception e) {
42+
String top = "";
43+
for (Character c : val.toCharArray()) {
44+
if (c.charValue() < 48 || c.charValue() > 57) {
45+
break;
46+
}
47+
top += c.charValue();
48+
}
49+
this.intVal = Integer.parseInt(top);
50+
}
4051
}
4152

4253
@Override
@@ -70,8 +81,8 @@ public int compareTo(Version o) {
7081
}
7182
}
7283
if (svx.size() > subs.size()) {
73-
for(int i = subs.size(); i < svx.size();i++) {
74-
if(svx.get(i).intVal!=0) {
84+
for (int i = subs.size(); i < svx.size(); i++) {
85+
if (svx.get(i).intVal != 0) {
7586
return -svx.get(i).intVal;
7687
}
7788
}

0 commit comments

Comments
 (0)