mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-26 20:45:53 +01:00
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:
parent
263390deb7
commit
c70f5cf2f3
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user