diff --git a/src/main/java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java b/src/main/java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java index 3944b95d..52e4e2cd 100644 --- a/src/main/java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java +++ b/src/main/java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java @@ -604,13 +604,16 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect { public List getEntities(Class eClass, IBeeGenome genome, IBeeHousing housing) { int[] area = genome.getTerritory(); - int[] offset = { -Math.round(area[0] / 2f), -Math.round(area[1] / 2f), -Math.round(area[2] / 2f) }; - int[] min = { housing.getCoordinates().posX + offset[0], housing.getCoordinates().posY + offset[1], - housing.getCoordinates().posZ + offset[2] }; - int[] max = { housing.getCoordinates().posX + offset[0] + area[0], - housing.getCoordinates().posY + offset[1] + area[1], - housing.getCoordinates().posZ + offset[2] + area[2] }; - AxisAlignedBB box = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]); + int offsetX = -Math.round(area[0] / 2f); + int offsetY = -Math.round(area[1] / 2f); + int offsetZ = -Math.round(area[2] / 2f); + int minX = housing.getCoordinates().posX + offsetX; + int minY = housing.getCoordinates().posY + offsetY; + int minZ = housing.getCoordinates().posZ + offsetZ; + int maxX = housing.getCoordinates().posX + offsetX + area[0]; + int maxY = housing.getCoordinates().posY + offsetY + area[1]; + int maxZ = housing.getCoordinates().posZ + offsetZ + area[2]; + AxisAlignedBB box = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); return housing.getWorld().getEntitiesWithinAABB(eClass, box); }