mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Added compareTo method for easier comparison in expasions.
This commit is contained in:
parent
9cc5a9678f
commit
efc6a6337b
@ -20,22 +20,27 @@
|
||||
*/
|
||||
package me.clip.placeholderapi.expansion;
|
||||
|
||||
public class Version {
|
||||
public final class Version {
|
||||
|
||||
private boolean isSpigot;
|
||||
|
||||
private String version;
|
||||
|
||||
public Version(String version, boolean isSpigot) {
|
||||
this.version = version;
|
||||
this.isSpigot = isSpigot;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version == null ? "unknown" : version;
|
||||
}
|
||||
|
||||
public boolean isSpigot() {
|
||||
return isSpigot;
|
||||
}
|
||||
|
||||
public boolean compareTo(String version) {
|
||||
return getVersion().equalsIgnoreCase(version);
|
||||
}
|
||||
|
||||
private boolean isSpigot;
|
||||
|
||||
private String version;
|
||||
|
||||
public Version(String version, boolean isSpigot) {
|
||||
this.version = version;
|
||||
this.isSpigot = isSpigot;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version == null ? "unknown" : version;
|
||||
}
|
||||
|
||||
public boolean isSpigot() {
|
||||
return isSpigot;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user