mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Fix clipboards to allow proper heights by allowing extended CuboidRegion heights (#1624)
* Fix clipboards to allow proper heights by allowing extended CuboidRegion heights Fixes #1534 * Add @since * Fix javadoc comment Co-authored-by: Alex <mc.cache@web.de>
This commit is contained in:
@ -83,7 +83,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
Bukkit.getServer().shutdown();
|
||||
}
|
||||
|
||||
MinecraftVersion version = new MinecraftVersion();
|
||||
MinecraftVersion version = MinecraftVersion.getCurrent();
|
||||
|
||||
chunksStretched = version.isEqualOrHigherThan(MinecraftVersion.NETHER);
|
||||
|
||||
|
@ -13,6 +13,7 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
public static final MinecraftVersion NETHER = new MinecraftVersion(1, 16);
|
||||
public static final MinecraftVersion CAVES_17 = new MinecraftVersion(1, 17);
|
||||
public static final MinecraftVersion CAVES_18 = new MinecraftVersion(1, 18);
|
||||
private static MinecraftVersion current = null;
|
||||
|
||||
private final int major;
|
||||
private final int minor;
|
||||
@ -57,6 +58,29 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
this.release = Integer.parseInt(versionParts[2].substring(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the minecraft version that the server is currently running
|
||||
*
|
||||
* @since TODO
|
||||
*/
|
||||
public static MinecraftVersion getCurrent() {
|
||||
if (current == null) {
|
||||
return current = new MinecraftVersion();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return The package version.
|
||||
*/
|
||||
private static String getPackageVersion() {
|
||||
String fullPackagePath = Bukkit.getServer().getClass().getPackage().getName();
|
||||
return fullPackagePath.substring(fullPackagePath.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param other The other version to compare against.
|
||||
* @return {@code true} if this version is equal to the other version.
|
||||
@ -145,15 +169,4 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
|
||||
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.
|
||||
*
|
||||
* @return The package version.
|
||||
*/
|
||||
private static String getPackageVersion() {
|
||||
String fullPackagePath = Bukkit.getServer().getClass().getPackage().getName();
|
||||
return fullPackagePath.substring(fullPackagePath.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -282,12 +282,12 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser
|
||||
|
||||
@Override
|
||||
public int versionMinY() {
|
||||
return new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? -64 : 0;
|
||||
return MinecraftVersion.getCurrent().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? -64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int versionMaxY() {
|
||||
return new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? 319 : 255;
|
||||
return MinecraftVersion.getCurrent().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? 319 : 255;
|
||||
}
|
||||
//FAWE end
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class BukkitImplLoader {
|
||||
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private final List<String> adapterCandidates = new ArrayList<>();
|
||||
private final String minorMCVersion = String.valueOf(new MinecraftVersion().getMinor());
|
||||
private final String minorMCVersion = String.valueOf(MinecraftVersion.getCurrent().getMinor());
|
||||
private int zeroth = 0;
|
||||
private String customCandidate;
|
||||
|
||||
|
Reference in New Issue
Block a user