From 2e386ea391f5d796f92f6abd4b53c79b71906f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= <43724816+Aurelien30000@users.noreply.github.com> Date: Mon, 3 Oct 2022 11:20:53 +0200 Subject: [PATCH] Fix region restrictions with methods non-overriden (#1948) Fix region registrictions with methods non-overriden See https://github.com/IntellectualSites/fastasyncvoxelsniper/issues/195 for context --- .../core/extent/FaweRegionExtent.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java index ce49569ad..6fa2767e0 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java @@ -96,13 +96,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc @Override public BiomeType getBiome(BlockVector3 position) { - if (!contains(position)) { - if (!limit.MAX_FAILS()) { - WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); - } - return null; - } - return super.getBiome(position); + return getBiomeType(position.getX(), position.getY(), position.getZ()); } @Override @@ -118,24 +112,34 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc @Override public BaseBlock getFullBlock(BlockVector3 position) { - if (!contains(position)) { + return getFullBlock(position.getX(), position.getY(), position.getZ()); + } + + @Override + public BaseBlock getFullBlock(int x, int y, int z) { + if (!contains(x, y, z)) { if (!limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return BlockTypes.AIR.getDefaultState().toBaseBlock(); } - return super.getFullBlock(position); + return super.getFullBlock(x, y, z); } @Override public BlockState getBlock(BlockVector3 position) { - if (!contains(position)) { + return getBlock(position.getX(), position.getY(), position.getZ()); + } + + @Override + public BlockState getBlock(int x, int y, int z) { + if (!contains(x, y, z)) { if (!limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return BlockTypes.AIR.getDefaultState(); } - return super.getBlock(position); + return super.getBlock(x, y, z); } @Nullable