java.lang.Object
com.minecolonies.core.colony.buildings.modules.settings.IntSetting
All Implemented Interfaces:
ISetting<Integer>
Direct Known Subclasses:
DynamicTreesSetting

public class IntSetting extends Object implements ISetting<Integer>
Stores an integer setting.
  • 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

      public Integer getValue()
      Get the setting value.
      Specified by:
      getValue in interface ISetting<Integer>
      Returns:
      the set value.
    • getDefault

      public int getDefault()
      Get the default value.
      Returns:
      the default value.
    • getLayoutItem

      public net.minecraft.resources.ResourceLocation getLayoutItem()
      Description copied from interface: ISetting
      Get the resource location of the view you want to use for this setting.
      Specified by:
      getLayoutItem in interface ISetting<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: ISetting
      Add the handling of the specific setting to the box in the UI.
      Specified by:
      setupHandler in interface ISetting<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: ISetting
      Update the handling (e.g update settings text).
      Specified by:
      render in interface ISetting<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.
    • copyValue

      public void copyValue(ISetting<?> setting)
      Description copied from interface: ISetting
      Copy value from another instance.
      Specified by:
      copyValue in interface ISetting<Integer>
      Parameters:
      setting - the setting to copy from
    • setValue

      public void setValue(int value)
      Set a new int value.
      Parameters:
      value - the int to set.