java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at net.minecraft.container.ArrayPropertyDelegate.get(ArrayPropertyDelegate.java:12)
at io.github.cottonmc.cotton.gui.widget.WBar.paintBackground(WBar.java:73)
...
I tried to create peers for this WBar, as "properties" was probably empty, but it didn't worked
I'm probably missing something here, but even seeing some example code, I couldn't figure it out
public DistillerController(int syncId, PlayerInventory playerInventory, BlockContext block) {
super(RecipeType.SMELTING, syncId, playerInventory, getBlockInventory(block),
getBlockPropertyDelegate(block));
WPlainPanel panel = new WPlainPanel();
WItemSlot fuel = WItemSlot.of(blockInventory, 0);
WItemSlot plant = WItemSlot.of(blockInventory, 1);
WItemSlot water = WItemSlot.of(blockInventory, 2);
WItemSlot essence = WItemSlot.outputOf(blockInventory, 3);
panel.add(fuel, 0, 0);
panel.add(plant, 0, 0); // TODO Layout
panel.add(water, 0, 0);
panel.add(essence, 0, 0);
panel.add(new WLabel(new TranslatableText("block.withery.distiller"), WLabel.DEFAULT_TEXT_COLOR).setAlignment(Alignment.CENTER), 18 * 4, 0);
panel.add(new WLabel(new TranslatableText("container.inventory"), WLabel.DEFAULT_TEXT_COLOR), 0, 18 * 3 + 12);
panel.add(new WBar(new Identifier("withery:textures/gui/progress_bar_bg.png"),
new Identifier("withery:textures/gui/progress_bar.png"), 0, 1, WBar.Direction.RIGHT),
18 * 4, 18 * 4);
panel.add(this.createPlayerInventoryPanel(), 0, 18 * 4 + 6);
panel.validate(this);
setRootPanel(panel);
}