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) {
|
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 -> {
|
user.getPlayer().getNearbyEntities(searchRadius, searchRadius, searchRadius).forEach(entity -> {
|
||||||
// Look through all the nearby Entities, filtering by type
|
// Look through all the nearby Entities, filtering by type
|
||||||
entities.computeIfPresent(entity.getType(), (reqEntity, amount) -> amount - 1);
|
entities.computeIfPresent(entity.getType(), (reqEntity, amount) -> amount - 1);
|
||||||
|
|
Loading…
Reference in New Issue