mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-04 13:53:29 +01:00
Fix PlotVersion when compiling with Maven
This commit is contained in:
parent
e4f6c39bb7
commit
90c3fac4fa
@ -13,14 +13,23 @@ public class PlotVersion {
|
|||||||
this.year = Integer.parseInt(date[0]);
|
this.year = Integer.parseInt(date[0]);
|
||||||
this.month = Integer.parseInt(date[1]);
|
this.month = Integer.parseInt(date[1]);
|
||||||
this.day = Integer.parseInt(date[2]);
|
this.day = Integer.parseInt(date[2]);
|
||||||
|
if(split[1].equals("SNAPSHOT")) { // fallback when compiling with Maven
|
||||||
|
this.hash = 0;
|
||||||
|
this.build = 0;
|
||||||
|
} else {
|
||||||
this.hash = Integer.parseInt(split[1], 16);
|
this.hash = Integer.parseInt(split[1], 16);
|
||||||
this.build = Integer.parseInt(split[2]);
|
this.build = Integer.parseInt(split[2]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
if(hash == 0 && build == 0) {
|
||||||
|
return "PlotSquared-" + year + "." + month + "." + day + "-SNAPSHOT";
|
||||||
|
} else {
|
||||||
return "PlotSquared-" + year + "." + month + "." + day + "-" + Integer.toHexString(hash) + "-" + build;
|
return "PlotSquared-" + year + "." + month + "." + day + "-" + Integer.toHexString(hash) + "-" + build;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isNewer(PlotVersion other) {
|
public boolean isNewer(PlotVersion other) {
|
||||||
return other.build < this.build;
|
return other.build < this.build;
|
||||||
|
Loading…
Reference in New Issue
Block a user