From 13faf478ee72958707ddba16a1bb65d666ae1a06 Mon Sep 17 00:00:00 2001 From: BONNe Date: Wed, 24 Apr 2019 07:03:09 +0300 Subject: [PATCH] Use player BoundingBox to simplify code, instead of creating new boundingBox from player location. --- .../world/bentobox/challenges/tasks/TryToComplete.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java index 2ce5956..314304d 100644 --- a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java @@ -696,15 +696,8 @@ public class TryToComplete */ private ChallengeResult checkSurrounding() { - Location playerLocation = this.user.getLocation(); - // Init location in player position. - BoundingBox boundingBox = new BoundingBox(playerLocation.getBlockX(), - playerLocation.getBlockY(), - playerLocation.getBlockZ(), - playerLocation.getBlockX(), - playerLocation.getBlockY(), - playerLocation.getBlockZ()); + BoundingBox boundingBox = this.user.getPlayer().getBoundingBox().clone(); // Expand position with search radius. boundingBox.expand(this.challenge.getSearchRadius());