Class RecipeSetting
java.lang.Object
com.minecolonies.core.colony.buildings.modules.settings.RecipeSetting
- All Implemented Interfaces:
ICraftingSetting,ISetting<IToken<?>>
Stores a recipe based setting.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRecipeSetting(IToken<?> selectedRecipe, String craftingModuleId) Create a new string list setting.RecipeSetting(String craftingModuleId) Create a new crafting setting. -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy value from another instance.net.minecraft.resources.ResourceLocationGet the resource location of the view you want to use for this setting.List<net.minecraft.world.item.ItemStack> getSettings(IBuilding building) Get the list of all settings.List<net.minecraft.world.item.ItemStack> getSettings(IBuildingView building) Get the list of all settings.IToken<?> getValue()Get the setting value.Get the setting value.getValue(IBuildingView building) Get the setting value.booleanisActive(ISettingsModule module) Check if this setting is active (providedISettingsModule.getOptionalSetting(ISettingKey)is used).booleanisActive(ISettingsModuleView module) Check if this setting is active (providedISettingsModule.getOptionalSetting(ISettingKey)is used).voidrender(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Update the handling (e.g update settings text).voidset(IRecipeStorage value) Set the setting to a specific index.voidsetupHandler(ISettingKey<?> key, com.ldtteam.blockui.Pane pane, ICommonSettingsModule settingsModuleView, IBuildingView building, com.ldtteam.blockui.views.BOWindow window) Add the handling of the specific setting to the box in the UI.booleanConfigures if this setting is inactive, whether it should show in the settings at all.Methods 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.settings.ISetting
getInactiveReason, getToolTipText, onUpdate, setHoverPane, trigger, updateSetting
-
Field Details
-
selectedRecipe
Current index of the setting. -
craftingModuleId
The specific crafting module.
-
-
Constructor Details
-
RecipeSetting
Create a new crafting setting.- Parameters:
craftingModuleId- the crafting module id.
-
RecipeSetting
Create a new string list setting.- Parameters:
selectedRecipe- the current selected recipe.craftingModuleId- the crafting module id.
-
-
Method Details
-
getValue
Description copied from interface:ICraftingSettingGet the setting value.- Specified by:
getValuein interfaceICraftingSetting- Returns:
- the current value.
-
getValue
Description copied from interface:ICraftingSettingGet the setting value.- Specified by:
getValuein interfaceICraftingSetting- Returns:
- the current value.
-
getSettings
Description copied from interface:ICraftingSettingGet the list of all settings.- Specified by:
getSettingsin interfaceICraftingSetting- Parameters:
building- server side building.- Returns:
- the list.
-
getSettings
Description copied from interface:ICraftingSettingGet the list of all settings.- Specified by:
getSettingsin interfaceICraftingSetting- Parameters:
building- client side building.- Returns:
- a copy of the list.
-
getLayoutItem
public net.minecraft.resources.ResourceLocation getLayoutItem()Description copied from interface:ISettingGet the resource location of the view you want to use for this setting.- Specified by:
getLayoutItemin interfaceISetting<IToken<?>>- 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:ISettingAdd the handling of the specific setting to the box in the UI.- Specified by:
setupHandlerin interfaceISetting<IToken<?>>- 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:ISettingUpdate the handling (e.g update settings text). -
set
Description copied from interface:ICraftingSettingSet the setting to a specific index.- Specified by:
setin interfaceICraftingSetting- Parameters:
value- the value to set.
-
isActive
Description copied from interface:ISettingCheck if this setting is active (providedISettingsModule.getOptionalSetting(ISettingKey)is used). -
isActive
Description copied from interface:ISettingCheck if this setting is active (providedISettingsModule.getOptionalSetting(ISettingKey)is used). -
getValue
Description copied from interface:ISettingGet the setting value. -
shouldHideWhenInactive
public boolean shouldHideWhenInactive()Description copied from interface:ISettingConfigures if this setting is inactive, whether it should show in the settings at all. This would default to false in most cases as we want to prevent not showing settings, but certain settings related to addon mods may want to be hidden if another mod is not loaded.- Specified by:
shouldHideWhenInactivein interfaceISetting<IToken<?>>- Returns:
- true if the inactive setting should be hidden.
-
copyValue
Description copied from interface:ISettingCopy value from another instance.
-