use of com.almuradev.almura.feature.exchange.Exchange in project Almura by AlmuraDev.
the class ClientExchangeManager method handleForSaleItems.
public void handleForSaleItems(final String id, @Nullable final List<ForSaleItem> forSaleItems, int preLimitCount) {
checkNotNull(id);
final Exchange axs = this.getExchange(id);
if (axs == null) {
return;
}
final GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (currentScreen instanceof ExchangeScreen) {
if (axs != ((ExchangeScreen) currentScreen).getExchange()) {
return;
}
if (forSaleItems == null) {
axs.putForSaleItems(null);
} else {
axs.putForSaleItems(forSaleItems.stream().collect(Collectors.groupingBy(k -> k.getListItem().getSeller(), ConcurrentHashMap::new, Collectors.toCollection(ArrayList::new))));
}
((ExchangeScreen) currentScreen).refreshForSaleItemResults(forSaleItems, preLimitCount);
}
}
Aggregations