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()
{
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());