The commit was wrong. Protection range should not be decreased, as that would mean that max X and Z blocks are not included in island protection bounding box.
This change is the same as 3c65194dfb but was missed when it was fixed.

Relate to #473
This commit is contained in:
BONNe 2022-07-25 00:16:16 +03:00
parent a59697c14e
commit 64b4c43742
2 changed files with 8 additions and 1 deletions

View File

@ -811,7 +811,12 @@ public class Island implements DataObject, MetaDataAble {
* @since 1.5.2
*/
public BoundingBox getProtectionBoundingBox() {
return new BoundingBox(getMinProtectedX(), world.getMinHeight(), getMinProtectedZ(), getMaxProtectedX()-1.0D, world.getMaxHeight(), getMaxProtectedZ()-1.0D);
return new BoundingBox(this.getMinProtectedX(),
this.world.getMinHeight(),
this.getMinProtectedZ(),
this.getMaxProtectedX(),
this.world.getMaxHeight(),
this.getMaxProtectedZ());
}
/**

View File

@ -24,6 +24,7 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.block.Block;
import org.bukkit.util.Vector;
import org.eclipse.jdt.annotation.NonNull;
import org.junit.After;
import org.junit.Before;
@ -564,6 +565,7 @@ public class IslandTest {
public void testGetProtectionBoundingBox() {
i.setWorld(world);
assertNotNull(i.getProtectionBoundingBox());
assertEquals("BoundingBox [minX=-100.0, minY=0.0, minZ=-100.0, maxX=100.0, maxY=0.0, maxZ=100.0]", i.getProtectionBoundingBox().toString());
}
/**