mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 09:17:39 +00:00
Refactor: getVersionMin/MaxY -> versionMin/MaxY
This commit is contained in:
parent
f505828af1
commit
9e8f0e7325
@ -281,12 +281,12 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVersionMinY() {
|
||||
public int versionMinY() {
|
||||
return new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? -64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVersionMaxY() {
|
||||
public int versionMaxY() {
|
||||
return new MinecraftVersion().isEqualOrHigherThan(MinecraftVersion.CAVES_18) ? 319 : 255;
|
||||
}
|
||||
//FAWE end
|
||||
|
@ -171,12 +171,12 @@ class CLIPlatform extends AbstractPlatform {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVersionMinY() {
|
||||
public int versionMinY() {
|
||||
return dataVersion >= Constants.DATA_VERSION_MC_1_18 ? -64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVersionMaxY() {
|
||||
public int versionMaxY() {
|
||||
return dataVersion >= Constants.DATA_VERSION_MC_1_18 ? 319 : 255;
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@ public class RegionWrapper extends CuboidRegion {
|
||||
public RegionWrapper(final int minX, final int maxX, final int minZ, final int maxZ) {
|
||||
this(minX,
|
||||
maxX,
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY(),
|
||||
minZ,
|
||||
maxZ
|
||||
);
|
||||
|
@ -305,8 +305,8 @@ public class ParserContext {
|
||||
minY = extent.getMinY();
|
||||
maxY = extent.getMaxY();
|
||||
} else {
|
||||
minY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY();
|
||||
maxY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY();
|
||||
minY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY();
|
||||
maxY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY();
|
||||
}
|
||||
|
||||
return minY;
|
||||
|
@ -240,11 +240,11 @@ public interface Platform extends Keyed {
|
||||
/**
|
||||
* Get the default minimum Y value of worlds based on Minecraft version (inclusive).
|
||||
*/
|
||||
int getVersionMinY();
|
||||
int versionMinY();
|
||||
|
||||
/**
|
||||
* Get the default maximum Y value of worlds based on Minecraft version (inclusive).
|
||||
*/
|
||||
int getVersionMaxY();
|
||||
int versionMaxY();
|
||||
//FAWE end
|
||||
}
|
||||
|
@ -97,8 +97,8 @@ public interface OutputExtent {
|
||||
@Deprecated
|
||||
default boolean setBiome(BlockVector2 position, BiomeType biome) {
|
||||
boolean result = false;
|
||||
int minY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY();
|
||||
int maxY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY();
|
||||
int minY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY();
|
||||
int maxY = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY();
|
||||
for (int y = minY; y < maxY; y++) {
|
||||
result |= setBiome(position.toBlockVector3().mutY(y), biome);
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ public class OffsetMask extends AbstractMask {
|
||||
@Deprecated
|
||||
public OffsetMask(Mask mask, BlockVector3 offset) {
|
||||
this(mask, offset,
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY()
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -113,8 +113,8 @@ public abstract class BreadthFirstSearch implements Operation {
|
||||
public BreadthFirstSearch(RegionFunction function) {
|
||||
//FAWE start - int depth, min/max y
|
||||
this(function, Integer.MAX_VALUE,
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY(), null
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY(), null
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ public class DownwardVisitor extends RecursiveVisitor {
|
||||
public DownwardVisitor(Mask mask, RegionFunction function, int baseY) {
|
||||
//FAWE start - int depth, min/max y
|
||||
this(mask, function, baseY, Integer.MAX_VALUE, WorldEdit
|
||||
.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY(), null
|
||||
.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY(), null
|
||||
);
|
||||
//FAWE end
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ public class NonRisingVisitor extends RecursiveVisitor {
|
||||
public NonRisingVisitor(Mask mask, RegionFunction function) {
|
||||
//FAWE start - int depth, y min/max
|
||||
this(mask, function, Integer.MAX_VALUE, WorldEdit
|
||||
.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY(), null
|
||||
.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY(), null
|
||||
);
|
||||
//FAWE end
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ public class RecursiveVisitor extends BreadthFirstSearch {
|
||||
*/
|
||||
public RecursiveVisitor(Mask mask, RegionFunction function) {
|
||||
this(mask, function, Integer.MAX_VALUE, WorldEdit
|
||||
.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY(), null
|
||||
.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY(),
|
||||
WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY(), null
|
||||
);
|
||||
//FAWE end
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
||||
.getInstance()
|
||||
.getPlatformManager()
|
||||
.queryCapability(Capability.WORLD_EDITING)
|
||||
.getVersionMinY() : world.getMinY();
|
||||
.versionMinY() : world.getMinY();
|
||||
//FAWE end
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
||||
.getInstance()
|
||||
.getPlatformManager()
|
||||
.queryCapability(Capability.WORLD_EDITING)
|
||||
.getVersionMaxY() : world.getMaxY();
|
||||
.versionMaxY() : world.getMaxY();
|
||||
//FAWE end
|
||||
}
|
||||
|
||||
|
@ -234,12 +234,12 @@ public interface Region extends Iterable<BlockVector3>, Cloneable, IBatchProcess
|
||||
.getPlatformManager()
|
||||
.queryCapability(
|
||||
Capability.WORLD_EDITING)
|
||||
.getVersionMinY()
|
||||
.versionMinY()
|
||||
&& pos2.getBlockY() >= WorldEdit
|
||||
.getInstance()
|
||||
.getPlatformManager()
|
||||
.queryCapability(Capability.WORLD_EDITING)
|
||||
.getVersionMaxY();
|
||||
.versionMaxY();
|
||||
}
|
||||
|
||||
default int getMinimumY() {
|
||||
|
@ -68,12 +68,12 @@ public abstract class AbstractWorld implements World {
|
||||
|
||||
@Override
|
||||
public int getMinY() {
|
||||
return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMinY();
|
||||
return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMinY();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxY() {
|
||||
return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).getVersionMaxY();
|
||||
return WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING).versionMaxY();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -100,13 +100,13 @@ public class StubPlatform extends AbstractPlatform {
|
||||
|
||||
// Use most "extreme" value
|
||||
@Override
|
||||
public int getVersionMinY() {
|
||||
public int versionMinY() {
|
||||
return -64;
|
||||
}
|
||||
|
||||
// Use most "extreme" value
|
||||
@Override
|
||||
public int getVersionMaxY() {
|
||||
public int versionMaxY() {
|
||||
return 319;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user