From 485cf8f417e73eb0be1b1066e54d516029265fb4 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 7 May 2021 10:48:12 +0200 Subject: [PATCH] Simplify Region.inRegion --- .../src/de/steamwar/bausystem/region/Region.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index b8478b6c..c0271d06 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -195,9 +195,12 @@ public class Region { } private boolean inRegion(Location location, Point minPoint, Point maxPoint) { - return location.getBlockX() >= minPoint.getX() && location.getBlockX() <= maxPoint.getX() && - location.getBlockY() >= minPoint.getY() && location.getBlockY() <= maxPoint.getY() && - location.getBlockZ() >= minPoint.getZ() && location.getBlockZ() <= maxPoint.getZ(); + int blockX = location.getBlockX(); + int blockY = location.getBlockY(); + int blockZ = location.getBlockZ(); + return blockX >= minPoint.getX() && blockX <= maxPoint.getX() && + blockY >= minPoint.getY() && blockY <= maxPoint.getY() && + blockZ >= minPoint.getZ() && blockZ <= maxPoint.getZ(); } public boolean hasType(RegionType regionType) {