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
Module containing all settings (client side).
-
Field Summary
Fields inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModuleView
buildingView, colonyView -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(@NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Deserialize the data on the client side.net.minecraft.network.chat.ComponentgetDesc()Get the lang string for the title.net.minecraft.resources.ResourceLocationGet the resource location of the icon for the module view.<T extends ISetting<?>>
TgetSetting(ISettingKey<T> key) Get a specific setting.List<ISettingKey<? extends ISetting<?>>> Get the full settings map.com.ldtteam.blockui.views.BOWindowGet the matching window for the module.voidtrigger(ISettingKey<?> key) Trigger a setting of a specific key.voidupdateSetting(ISettingKey<?> settingKey, ISetting<?> value, net.minecraft.server.level.ServerPlayer sender) Update a given settings value.Methods inherited from class com.minecolonies.api.colony.buildings.modules.AbstractBuildingModuleView
canBeHiredAs, getBuildingView, getColony, getProducer, setBuildingView, setColonyView, setProducerMethods 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.IBuildingModuleView
getBuildingView, getColony, getIcon, getProducer, isPageVisible, setBuildingView, setColonyView, setProducer
-
Constructor Details
-
SettingsModuleView
public SettingsModuleView()
-
-
Method Details
-
deserialize
public void deserialize(@NotNull @NotNull net.minecraft.network.RegistryFriendlyByteBuf buf) Description copied from interface:IBuildingModuleViewDeserialize the data on the client side.- Specified by:
deserializein interfaceIBuildingModuleView- Parameters:
buf- the buffer to read it from.
-
getSettingsToShow
Get the full settings map.- Returns:
- the list of string key and ISetting value.
-
getSetting
Description copied from interface:ICommonSettingsModuleGet a specific setting.- Specified by:
getSettingin interfaceICommonSettingsModule- 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:IBuildingModuleViewGet the matching window for the module.- Specified by:
getWindowin interfaceIBuildingModuleView- Returns:
- the window.
-
getIconResourceLocation
public net.minecraft.resources.ResourceLocation getIconResourceLocation()Description copied from interface:IBuildingModuleViewGet the resource location of the icon for the module view.- Specified by:
getIconResourceLocationin interfaceIBuildingModuleView- Returns:
- the resource location.
-
getDesc
public net.minecraft.network.chat.Component getDesc()Description copied from interface:IBuildingModuleViewGet the lang string for the title.- Specified by:
getDescin interfaceIBuildingModuleView- Returns:
- the lang string.
-
trigger
Description copied from interface:ICommonSettingsModuleTrigger a setting of a specific key.- Specified by:
triggerin interfaceICommonSettingsModule- Parameters:
key- the settings key.
-
updateSetting
public void updateSetting(ISettingKey<?> settingKey, ISetting<?> value, net.minecraft.server.level.ServerPlayer sender) Description copied from interface:ICommonSettingsModuleUpdate a given settings value.- Specified by:
updateSettingin interfaceICommonSettingsModule- Parameters:
settingKey- the given key.value- the value.sender- the player that updated the setting.
-