mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 12:33:54 +00:00
More precise method names in MinecraftVersion
- Also ensure correct comparisons are made in FaweBukkit and BukkitServerInterface - Fixes #1504
This commit is contained in:
@ -83,7 +83,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
Bukkit.getServer().shutdown();
|
||||
}
|
||||
|
||||
chunksStretched = new MinecraftVersion().isEqualOrLower(MinecraftVersion.NETHER);
|
||||
chunksStretched = new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.NETHER);
|
||||
|
||||
platformAdapter = new NMSAdapter();
|
||||
|
||||
|
@ -69,7 +69,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
* @param other The other version to compare against.
|
||||
* @return {@code true} if this version is higher or equal compared to the other version.
|
||||
*/
|
||||
public boolean isEqualOrHigher(MinecraftVersion other) {
|
||||
public boolean isEqualOrHigherThan(MinecraftVersion other) {
|
||||
return compareTo(other) >= 0;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
* @param other The other version to compare against.
|
||||
* @return {@code true} if this version is lower or equal compared to the other version.
|
||||
*/
|
||||
public boolean isEqualOrLower(MinecraftVersion other) {
|
||||
public boolean isEqualOrLowerThan(MinecraftVersion other) {
|
||||
return compareTo(other) <= 0;
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
* @param other The other version to compare against.
|
||||
* @return {@code true} if this version is higher than the other version.
|
||||
*/
|
||||
public boolean isHigher(MinecraftVersion other) {
|
||||
public boolean isHigherThan(MinecraftVersion other) {
|
||||
return compareTo(other) > 0;
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
* @param other The other version to compare against.
|
||||
* @return {@code true} if this version is lower than to the other version.
|
||||
*/
|
||||
public boolean isLower(MinecraftVersion other) {
|
||||
public boolean isLowerThan(MinecraftVersion other) {
|
||||
return compareTo(other) < 0;
|
||||
}
|
||||
|
||||
@ -140,6 +140,11 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
return getRelease() == that.getRelease();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return major + "." + minor + "." + release;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the server version based on the CraftBukkit package path, e.g. {@code org.bukkit.craftbukkit.v1_16_R3},
|
||||
* where v1_16_R3 is the resolved version.
|
||||
|
@ -282,12 +282,12 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser
|
||||
|
||||
@Override
|
||||
public int getVersionMinY() {
|
||||
return new MinecraftVersion().isEqualOrLower(MinecraftVersion.CAVES_18) ? -64 : 0;
|
||||
return new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? -64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVersionMaxY() {
|
||||
return new MinecraftVersion().isEqualOrLower(MinecraftVersion.CAVES_18) ? 319 : 255;
|
||||
return new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? 319 : 255;
|
||||
}
|
||||
//FAWE end
|
||||
}
|
||||
|
Reference in New Issue
Block a user