Class IntSetting
java.lang.Object
com.minecolonies.core.colony.buildings.modules.settings.IntSetting
- Direct Known Subclasses:
DynamicTreesSetting
Stores an integer setting.
-
Constructor Summary
ConstructorsConstructorDescriptionIntSetting(int init) Create a new boolean setting.IntSetting(int value, int def) Create a new int setting. -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy value from another instance.intGet the default value.net.minecraft.resources.ResourceLocationGet the resource location of the view you want to use for this setting.getValue()Get the setting value.voidrender(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Update the handling (e.g update settings text).voidsetupHandler(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Add the handling of the specific setting to the box in the UI.voidsetValue(int value) Set a new int value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.minecolonies.api.colony.buildings.modules.settings.ISetting
getInactiveReason, getToolTipText, isActive, isActive, onUpdate, setHoverPane, shouldHideWhenInactive, trigger, updateSetting
-
Constructor Details
-
IntSetting
public IntSetting(int init) Create a new boolean setting.- Parameters:
init- the initial value.
-
IntSetting
public IntSetting(int value, int def) Create a new int setting.- Parameters:
value- the value.def- the default value.
-
-
Method Details
-
getValue
Get the setting value. -
getDefault
public int getDefault()Get the default value.- Returns:
- the default value.
-
getLayoutItem
public net.minecraft.resources.ResourceLocation getLayoutItem()Description copied from interface:ISettingGet the resource location of the view you want to use for this setting.- Specified by:
getLayoutItemin interfaceISetting<Integer>- Returns:
- the resource location indicating which view to use.
-
setupHandler
public void setupHandler(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Description copied from interface:ISettingAdd the handling of the specific setting to the box in the UI.- Specified by:
setupHandlerin interfaceISetting<Integer>- Parameters:
key- the key of the setting.pane- the pane of it.settingsModuleView- the module view that holds the setting.building- the building.window- the calling window.
-
render
public void render(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Description copied from interface:ISettingUpdate the handling (e.g update settings text). -
copyValue
Description copied from interface:ISettingCopy value from another instance. -
setValue
public void setValue(int value) Set a new int value.- Parameters:
value- the int to set.
-