use of mathax.client.gui.widgets.WItemWithLabel in project Client by MatHax.
the class ItemSettingScreen method initTable.
public void initTable() {
for (Item item : Registry.ITEM) {
if (setting.filter != null && !setting.filter.test(item))
continue;
if (item == Items.AIR)
continue;
WItemWithLabel itemLabel = theme.itemWithLabel(item.getDefaultStack(), Names.get(item));
if (!filterText.isEmpty() && !StringUtils.containsIgnoreCase(itemLabel.getLabelText(), filterText))
continue;
table.add(itemLabel);
WButton select = table.add(theme.button("Select")).expandCellX().right().widget();
select.action = () -> {
setting.set(item);
close();
};
table.row();
}
}
use of mathax.client.gui.widgets.WItemWithLabel in project Client by MatHax.
the class BlockSettingScreen method initTable.
private void initTable() {
for (Block block : Registry.BLOCK) {
if (setting.filter != null && !setting.filter.test(block))
continue;
if (skipValue(block))
continue;
WItemWithLabel item = theme.itemWithLabel(block.asItem().getDefaultStack(), Names.get(block));
if (!filterText.isEmpty() && !StringUtils.containsIgnoreCase(item.getLabelText(), filterText))
continue;
table.add(item);
WButton select = table.add(theme.button("Select")).expandCellX().right().widget();
select.action = () -> {
setting.set(block);
close();
};
table.row();
}
}
Aggregations