Sorting ores by most abundant first.
This commit is contained in:
@ -29,6 +29,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mixin(IGMineralTestingItem.class)
|
||||
public abstract class IGMineralTestingItemMixin extends IGGenericItem implements IGFlagItem {
|
||||
@ -110,6 +111,11 @@ public abstract class IGMineralTestingItemMixin extends IGGenericItem implements
|
||||
// Apply deposit threshold
|
||||
oreMap.values().removeIf(value -> value < Config.Server.geologistPickDepositThreshold.get());
|
||||
|
||||
// Sort ore map
|
||||
oreMap = oreMap.entrySet().stream()
|
||||
.sorted((k1, k2) -> -k1.getValue().compareTo(k2.getValue()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
|
||||
|
||||
Component message = getMessage(oreMap.keySet());
|
||||
|
||||
player.displayClientMessage(message, true);
|
||||
|
Reference in New Issue
Block a user