All Implemented Interfaces:
ISetting<String>, IStringSetting<String>

public class GuardTaskSetting extends StringSettingWithDesc
Stores a guard task setting.
  • Field Details

  • Constructor Details

    • GuardTaskSetting

      public GuardTaskSetting()
      Create a new guard task list setting.
    • GuardTaskSetting

      public GuardTaskSetting(String... list)
      Create a new guard task list setting.
    • GuardTaskSetting

      public GuardTaskSetting(List<String> settings, int currentIndex)
      Create a new string list setting.
      Parameters:
      settings - the overall list of settings.
      currentIndex - the current selected index.
  • Method Details

    • 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<String>
      Overrides:
      getLayoutItem in class StringSetting
      Returns:
      the resource location indicating which view to use.
    • onUpdate

      public void onUpdate(IBuilding building, net.minecraft.server.level.ServerPlayer sender)
      Description copied from interface: ISetting
      Called when updated.
      Parameters:
      building - the building its updated for.
      sender - the player triggering the update.
    • 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<String>
      Overrides:
      setupHandler in class StringSetting
      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<String>
      Overrides:
      render in class StringSetting
      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.
    • getButtonWidth

      protected int getButtonWidth(ISettingsModuleView settingsModuleView)
      Description copied from class: StringSetting
      Get the width to render the button at. This can be at most 145, to leave adequate spacing.
      Overrides:
      getButtonWidth in class StringSetting
      Parameters:
      settingsModuleView - the module view that holds the setting.
      Returns:
      the width.