Class SettingsModuleView

java.lang.Object
com.minecolonies.api.colony.buildings.modules.AbstractBuildingModuleView
com.minecolonies.core.colony.buildings.moduleviews.SettingsModuleView
All Implemented Interfaces:
IBuildingModuleView, ICommonSettingsModule, ISettingsModuleView
Direct Known Subclasses:
TownHallSettingsModuleView

public class SettingsModuleView extends AbstractBuildingModuleView implements ISettingsModuleView
Module containing all settings (client side).
  • Constructor Details

    • SettingsModuleView

      public SettingsModuleView()
  • Method Details

    • deserialize

      public void deserialize(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf)
      Description copied from interface: IBuildingModuleView
      Deserialize the data on the client side.
      Specified by:
      deserialize in interface IBuildingModuleView
      Parameters:
      buf - the buffer to read it from.
    • getSettingsToShow

      public List<ISettingKey<? extends ISetting<?>>> getSettingsToShow()
      Get the full settings map.
      Returns:
      the list of string key and ISetting value.
    • getSetting

      @Nullable public <T extends ISetting<?>> T getSetting(ISettingKey<T> key)
      Description copied from interface: ICommonSettingsModule
      Get a specific setting.
      Specified by:
      getSetting in interface ICommonSettingsModule
      Type Parameters:
      T - the type of setting.
      Parameters:
      key - the key of the setting.
      Returns:
      the setting.
    • getWindow

      public com.ldtteam.blockui.views.BOWindow getWindow()
      Description copied from interface: IBuildingModuleView
      Get the matching window for the module.
      Specified by:
      getWindow in interface IBuildingModuleView
      Returns:
      the window.
    • getIconResourceLocation

      public net.minecraft.resources.ResourceLocation getIconResourceLocation()
      Description copied from interface: IBuildingModuleView
      Get the resource location of the icon for the module view.
      Specified by:
      getIconResourceLocation in interface IBuildingModuleView
      Returns:
      the resource location.
    • getDesc

      public net.minecraft.network.chat.Component getDesc()
      Description copied from interface: IBuildingModuleView
      Get the lang string for the title.
      Specified by:
      getDesc in interface IBuildingModuleView
      Returns:
      the lang string.
    • trigger

      public void trigger(ISettingKey<?> key)
      Description copied from interface: ICommonSettingsModule
      Trigger a setting of a specific key.
      Specified by:
      trigger in interface ICommonSettingsModule
      Parameters:
      key - the settings key.
    • updateSetting

      public void updateSetting(ISettingKey<?> settingKey, ISetting<?> value, net.minecraft.server.level.ServerPlayer sender)
      Description copied from interface: ICommonSettingsModule
      Update a given settings value.
      Specified by:
      updateSetting in interface ICommonSettingsModule
      Parameters:
      settingKey - the given key.
      value - the value.
      sender - the player that updated the setting.