Use player BoundingBox to simplify code, instead of creating new boundingBox from player location.

This commit is contained in:
BONNe 2019-04-24 07:03:09 +03:00
parent f16417b630
commit 13faf478ee

View File

@ -696,15 +696,8 @@ public class TryToComplete
*/ */
private ChallengeResult checkSurrounding() private ChallengeResult checkSurrounding()
{ {
Location playerLocation = this.user.getLocation();
// Init location in player position. // Init location in player position.
BoundingBox boundingBox = new BoundingBox(playerLocation.getBlockX(), BoundingBox boundingBox = this.user.getPlayer().getBoundingBox().clone();
playerLocation.getBlockY(),
playerLocation.getBlockZ(),
playerLocation.getBlockX(),
playerLocation.getBlockY(),
playerLocation.getBlockZ());
// Expand position with search radius. // Expand position with search radius.
boundingBox.expand(this.challenge.getSearchRadius()); boundingBox.expand(this.challenge.getSearchRadius());