From 9e8f0e7325e4f869b1f465b34c13452a2a1fb3d8 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 29 Dec 2021 16:44:41 +0000 Subject: [PATCH] Refactor: getVersionMin/MaxY -> versionMin/MaxY --- .../com/sk89q/worldedit/bukkit/BukkitServerInterface.java | 4 ++-- .../src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java | 4 ++-- .../com/fastasyncworldedit/core/regions/RegionWrapper.java | 4 ++-- .../com/sk89q/worldedit/extension/input/ParserContext.java | 4 ++-- .../java/com/sk89q/worldedit/extension/platform/Platform.java | 4 ++-- .../main/java/com/sk89q/worldedit/extent/OutputExtent.java | 4 ++-- .../java/com/sk89q/worldedit/function/mask/OffsetMask.java | 4 ++-- .../sk89q/worldedit/function/visitor/BreadthFirstSearch.java | 4 ++-- .../com/sk89q/worldedit/function/visitor/DownwardVisitor.java | 4 ++-- .../sk89q/worldedit/function/visitor/NonRisingVisitor.java | 4 ++-- .../sk89q/worldedit/function/visitor/RecursiveVisitor.java | 4 ++-- .../main/java/com/sk89q/worldedit/regions/AbstractRegion.java | 4 ++-- .../src/main/java/com/sk89q/worldedit/regions/Region.java | 4 ++-- .../main/java/com/sk89q/worldedit/world/AbstractWorld.java | 4 ++-- .../test/java/com/fastasyncworldedit/util/StubPlatform.java | 4 ++-- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 44414ffc4..602ec139b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -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 diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java index 0704d056b..e9a397b73 100644 --- a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java +++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIPlatform.java @@ -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; } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/regions/RegionWrapper.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/regions/RegionWrapper.java index 55a39eb21..e382583aa 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/regions/RegionWrapper.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/regions/RegionWrapper.java @@ -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 ); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java index 30ac850a5..cf3f7d753 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java @@ -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; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java index dd4012ebe..e904f1ef0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java @@ -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 } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java index df2e07723..d90bce937 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java @@ -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); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java index 2f83000b8..2c809ada4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask.java @@ -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() ); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index baab0e4c5..c1b36ef6b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -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 ); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java index 0ebeacce0..f8204b085 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/DownwardVisitor.java @@ -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 } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java index d206d84fe..90e8f01d9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/NonRisingVisitor.java @@ -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 } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java index c96e4b063..dd18f9d1f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RecursiveVisitor.java @@ -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 } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java index bfcb40400..4728271c8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/AbstractRegion.java @@ -228,7 +228,7 @@ public abstract class AbstractRegion extends AbstractSet 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 implement .getInstance() .getPlatformManager() .queryCapability(Capability.WORLD_EDITING) - .getVersionMaxY() : world.getMaxY(); + .versionMaxY() : world.getMaxY(); //FAWE end } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java index 339ea5763..407530eea 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -234,12 +234,12 @@ public interface Region extends Iterable, Cloneable, IBatchProcess .getPlatformManager() .queryCapability( Capability.WORLD_EDITING) - .getVersionMinY() + .versionMinY() && pos2.getBlockY() >= WorldEdit .getInstance() .getPlatformManager() .queryCapability(Capability.WORLD_EDITING) - .getVersionMaxY(); + .versionMaxY(); } default int getMinimumY() { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java index bee63181f..53b47bbae 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/AbstractWorld.java @@ -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 diff --git a/worldedit-core/src/test/java/com/fastasyncworldedit/util/StubPlatform.java b/worldedit-core/src/test/java/com/fastasyncworldedit/util/StubPlatform.java index 9d7ac96c2..6e9f81de8 100644 --- a/worldedit-core/src/test/java/com/fastasyncworldedit/util/StubPlatform.java +++ b/worldedit-core/src/test/java/com/fastasyncworldedit/util/StubPlatform.java @@ -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; }