Refactor: getVersionMin/MaxY -> versionMin/MaxY

This commit is contained in:
dordsor21 2021-12-29 16:44:41 +00:00
parent f505828af1
commit 9e8f0e7325
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
15 changed files with 30 additions and 30 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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
);

View File

@ -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;

View File

@ -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
}

View File

@ -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);
}

View File

@ -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()
);
}

View File

@ -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
);
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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() {

View File

@ -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

View File

@ -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;
}