mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Default gen/build heights based on minecraft version
This commit is contained in:
parent
f7dd0c1d38
commit
fae95b758a
@ -238,6 +238,16 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
return this.version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int versionMinHeight() {
|
||||
return serverVersion()[1] >= 18 ? -64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int versionMaxHeight() {
|
||||
return serverVersion()[1] >= 18 ? 319 : 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String serverImplementation() {
|
||||
return Bukkit.getVersion();
|
||||
|
@ -98,6 +98,20 @@ public interface PlotPlatform<P> extends LocaleHolder {
|
||||
*/
|
||||
int[] serverVersion();
|
||||
|
||||
/**
|
||||
* Gets the default minimum world height for the version of Minecraft that the server is running.
|
||||
*
|
||||
* @return minimum world height
|
||||
*/
|
||||
int versionMinHeight();
|
||||
|
||||
/**
|
||||
* Gets the default maximum world height for the version of Minecraft that the server is running.
|
||||
*
|
||||
* @return maximum world height
|
||||
*/
|
||||
int versionMaxHeight();
|
||||
|
||||
/**
|
||||
* Gets the server implementation name and version
|
||||
*
|
||||
|
@ -142,10 +142,10 @@ public abstract class PlotArea {
|
||||
private boolean homeAllowNonmember = false;
|
||||
private BlockLoc nonmemberHome;
|
||||
private BlockLoc defaultHome;
|
||||
private int maxBuildHeight = 255;
|
||||
private int minBuildHeight = 1;
|
||||
private int maxGenHeight = 255;
|
||||
private int minGenHeight = 0;
|
||||
private int maxBuildHeight = PlotSquared.platform().versionMaxHeight();
|
||||
private int minBuildHeight = PlotSquared.platform().versionMinHeight() + 1;
|
||||
private int maxGenHeight = PlotSquared.platform().versionMaxHeight();
|
||||
private int minGenHeight = PlotSquared.platform().versionMinHeight();
|
||||
private GameMode gameMode = GameModes.CREATIVE;
|
||||
private Map<String, PlotExpression> prices = new HashMap<>();
|
||||
private List<String> schematics = new ArrayList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user