Interface ISettingsModule
- All Superinterfaces:
IBuildingModule,ICommonSettingsModule,IHasDirty
- All Known Implementing Classes:
SettingsModule
Settings module interface.
-
Method Summary
Modifier and TypeMethodDescriptiongetOptionalSetting(ISettingKey<T> key) Get a specific setting.<S,T extends ISetting<S>>
SgetSettingValueOrDefault(ISettingKey<T> key, S def) Get setting value or default.with(ISettingKey<?> key, ISetting<?> setting) Register a new setting.Methods inherited from interface com.minecolonies.api.colony.buildings.modules.IBuildingModule
getBuilding, getProducer, serializeToView, serializeToView, setBuilding, setProducerMethods inherited from interface com.minecolonies.api.colony.buildings.modules.ICommonSettingsModule
getSetting, trigger, updateSettingMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirty
-
Method Details
-
with
Register a new setting.- Parameters:
key- the key of the setting.setting- the setting.- Returns:
- the instance of the module.
-
getOptionalSetting
Get a specific setting.- Type Parameters:
T- the type of setting.- Parameters:
key- the key of the setting.- Returns:
- the setting, if it exists and is active.
-
getSettingValueOrDefault
Get setting value or default.- Type Parameters:
T- the type of setting.S- the setting value type.- Parameters:
key- the key of the setting.def- the default.- Returns:
- the setting value or the default.
-