Skip to content

Commit

Permalink
Fix error when no blocks required, only entities.
Browse files Browse the repository at this point in the history
Updated POM to use correct Level org.

May be related to
#28
  • Loading branch information
tastybento committed Nov 12, 2018
1 parent 263390d commit c70f5cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>bskyblock.addon</groupId>
<groupId>world.bentobox</groupId>
<artifactId>Level</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import bentobox.addon.challenges.commands.ChallengesCommand;
import bentobox.addon.challenges.database.object.Challenges;
import bentobox.addon.challenges.database.object.Challenges.ChallengeType;
import bentobox.addon.level.Level;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.util.Util;
import world.bentobox.level.Level;

/**
* Run when a user tries to complete a challenge
Expand Down Expand Up @@ -169,7 +169,7 @@ private ChallengeResult checkSurrounding() {
}
// Check for items or entities in the area
ChallengeResult result = searchForEntities(challenge.getRequiredEntities(), challenge.getSearchRadius());
if (result.meetsRequirements) {
if (result.meetsRequirements && !challenge.getRequiredBlocks().isEmpty()) {
// Search for items only if entities found
result = searchForBlocks(challenge.getRequiredBlocks(), challenge.getSearchRadius());
}
Expand Down

0 comments on commit c70f5cf

Please sign in to comment.