Interface ICheckboxWidget
- All Known Implementing Classes:
WidgetCheckBox,WidgetKeybindCheckBox
public interface ICheckboxWidget
Represents a checkbox widget which can have a key bound to toggle it; use this to create a checkbox to toggle
a toggleable upgrade on & off.
Do not implement this class yourself; you can create & retrieve instances of it via
IPneumaticHelmetRegistry.makeKeybindingCheckBox(ResourceLocation, int, int, int, Consumer). This would
typically be done in IOptionPage.populateGui(IGuiScreen).
-
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.client.gui.components.AbstractWidgetasWidget()Convenience method to cast this to a Widget, suitable for passing toIGuiScreen.addWidget(AbstractWidget), or calling other Widget methods on it.default net.minecraft.resources.ResourceLocationGet the upgrade ID for this checkbox; the upgrade that is toggled when the checkbox is clicked.booleanIs this checkbox currently checked?default ICheckboxWidgetwithOwnerUpgradeID(net.minecraft.resources.ResourceLocation owningId) Set the upgrade ID of the owning upgrade.
-
Method Details
-
isChecked
boolean isChecked()Is this checkbox currently checked?- Returns:
- true if checked, false if not
-
asWidget
default net.minecraft.client.gui.components.AbstractWidget asWidget()Convenience method to cast this to a Widget, suitable for passing toIGuiScreen.addWidget(AbstractWidget), or calling other Widget methods on it.- Returns:
- this checkbox as a Widget
-
getUpgradeId
default net.minecraft.resources.ResourceLocation getUpgradeId()Get the upgrade ID for this checkbox; the upgrade that is toggled when the checkbox is clicked.- Returns:
- the upgrade ID
-
withOwnerUpgradeID
Set the upgrade ID of the owning upgrade. Use this for sub-controls, e.g. the builder mode setting on jet boots.- Parameters:
owningId- the upgrade ID of the owning upgrade- Returns:
- this widget, for fluency
-