Fix error when no blocks required, only entities.

Updated POM to use correct Level org.

May be related to
https://github.com/BentoBoxWorld/addon-challenges/issues/28
This commit is contained in:
tastybento 2018-11-12 09:55:42 -08:00
parent 263390deb7
commit c70f5cf2f3
2 changed files with 3 additions and 3 deletions

View File

@ -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>

View File

@ -20,10 +20,10 @@ import bentobox.addon.challenges.ChallengesManager;
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
@ -169,7 +169,7 @@ public class TryToComplete {
}
// 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());
}