private void updateContentsList() { List<ItemStack> items = tileEntity.getShowingItems(); if (itemList.getMaximum() == 0) { // We need to refresh. for (ItemStack stack : items) { if (stack != null) { String displayName = BlockInfo.getReadableName(stack, 0); Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout()); panel.addChild(new BlockRender(mc, this).setRenderItem(stack)); panel.addChild( new Label(mc, this) .setDynamic(true) .setText(displayName) .setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT)); itemList.addChild(panel); } } } }