mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-26 20:45:53 +01:00
Fixes bug where no entities are required for surrounding challenge
https://github.com/BentoBoxWorld/addon-challenges/issues/8
This commit is contained in:
parent
44910200f5
commit
aa805c7c24
@ -194,7 +194,7 @@ public class TryToComplete {
|
||||
}
|
||||
|
||||
private ChallengeResult searchForEntities(Map<EntityType, Integer> map, int searchRadius) {
|
||||
Map<EntityType, Integer> entities = new EnumMap<>(map);
|
||||
Map<EntityType, Integer> entities = map.isEmpty() ? new EnumMap<>(EntityType.class) : new EnumMap<>(map);
|
||||
user.getPlayer().getNearbyEntities(searchRadius, searchRadius, searchRadius).forEach(entity -> {
|
||||
// Look through all the nearby Entities, filtering by type
|
||||
entities.computeIfPresent(entity.getType(), (reqEntity, amount) -> amount - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user