use of com.almuradev.almura.feature.store.client.gui.StoreScreen in project Almura by AlmuraDev.
the class ClientStoreManager method handleBuyingItems.
public void handleBuyingItems(final String id, @Nullable final List<BuyingItem> items) {
checkNotNull(id);
// Ensure we have the store screen open
final GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (!(currentScreen instanceof StoreScreen)) {
return;
}
// Update our local store
final Store store = this.stores.stream().filter(s -> s.getId().equals(id)).findAny().orElse(null);
if (store != null) {
// Clear existing items
store.getBuyingItems().clear();
if (items != null) {
// Add new items
store.getBuyingItems().addAll(items);
}
// Refresh the screen and create controls
((StoreScreen) currentScreen).refresh(true);
} else {
// Refresh the screen
((StoreScreen) currentScreen).refresh(false);
}
}
use of com.almuradev.almura.feature.store.client.gui.StoreScreen in project Almura by AlmuraDev.
the class ClientStoreManager method handleSellingItems.
public void handleSellingItems(final String id, @Nullable final List<SellingItem> items) {
checkNotNull(id);
// Ensure we have the store screen open
final GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
if (!(currentScreen instanceof StoreScreen)) {
return;
}
// Update our local store
final Store store = this.stores.stream().filter(s -> s.getId().equals(id)).findAny().orElse(null);
if (store != null) {
// Clear existing items
store.getSellingItems().clear();
if (items != null) {
// Add new items
store.getSellingItems().addAll(items);
}
// Refresh the screen and create controls
((StoreScreen) currentScreen).refresh(true);
} else {
// Refresh the screen
((StoreScreen) currentScreen).refresh(false);
}
}
Aggregations