Class Checkbox.Builder
- Enclosing class:
Checkbox
Builds a
Checkbox; from Checkbox.builder(String). Also has the options every entry has (Entry.Builder).-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the check box.A fixed label; seelabel(Supplier).The text to the right of the box, re-read on every refresh.Stores a new value when the player clicks; runs on the main thread.value(BooleanSupplier value) Reads whether the box is checked; re-read on every refresh.
-
Method Details
-
label
The text to the right of the box, re-read on every refresh. Required.- Parameters:
label- read on refresh- Returns:
- this builder
-
label
A fixed label; seelabel(Supplier).- Parameters:
label- the label- Returns:
- this builder
-
value
Reads whether the box is checked; re-read on every refresh. Required.- Parameters:
value- reads the mod's value- Returns:
- this builder
-
onChange
Stores a new value when the player clicks; runs on the main thread. Required. The box shows the new state only ifvaluereturns it afterwards.- Parameters:
onChange- receives the new value- Returns:
- this builder
-
build
Builds the check box.- Returns:
- the check box
- Throws:
IllegalStateException- iflabel,valueoronChangeis missing
-