Open Sparky983 opened 1 year ago
Should we instead be exploring less ad-hoc ways of setting multiple slots?
A quick and simple approach would be:
interface {
slots(Slots slots, Button button) {
for (var slot : slots.for(gui)) {
slot(slot, button)
}
}
}
interface Slots {
Iterable<Slot> for(Gui gui);
}
Gui gui = Gui.chest()
.rows(6)
.build()
.slots(Slots.TOP, Button.of(ItemType.GRAY_STAINED_GLASS_PANE))
.slots(Slots.EMPTY, Button.of(ItemType.DIAMOND))
.slots(Slots.column(1), Button.of(ItemType.EMERALD))
.slots(Slots.rows(4, 5), Button.of(ItemType.GOLD_INGOT));
Represents something with a border.
Bordered
:border(Border) -> Set<Border>
Bordered.Builder
border(Border, Button) -> Bordered.Builder
border(Set<Border>, Button) -> Bordered.Builder