Interface ImmersiveConfigScreenInfo
- All Known Implementing Classes:
ImmersiveConfigScreenInfoImpl
public interface ImmersiveConfigScreenInfo
An object that contains info for placing information on ImmersiveMC's config screen. You may return this from an
Immersive if you want config buttons to be placed on ImmersiveMC's config screen, or you may choose not to, and
instead handle configuration screens through some other method, or simply not have any.
It's recommended to get an instance of this interface using
It's recommended to get an instance of this interface using
ImmersiveMCClientRegistration.createConfigScreenInfoOneItem(String, String, Supplier, Component, Supplier, Consumer)
as it's easier to use. If you do implement this interface though, all methods should return the same value every
time it is called.-
Method Summary
Modifier and TypeMethodDescriptiongetModID()
Get the mod ID for the mod this Immersive is from.Set<net.minecraft.world.item.ItemStack>
Gets the ItemStacks representing this config.@Nullable net.minecraft.network.chat.Component
Get the Component representing the description of this option.Get the translation string for the button label, not including the enabled/disabled state.boolean
void
setEnabled
(boolean newValue) The method called to set the config value for enabling/disabling this Immersive.
-
Method Details
-
getModID
String getModID()Get the mod ID for the mod this Immersive is from. The mod name should be the name of the mod that provides the Immersive, not the mod that provides the Immersive itself. For example, for the support for Lootr blocks that ImmersiveMC provides, the mod returned here should be ImmersiveMC, NOT Lootr.- Returns:
- The mod name of the mod that implemented this Immersive.
-
getOptionTranslation
String getOptionTranslation()Get the translation string for the button label, not including the enabled/disabled state.
For example, as of writing, the Furnace Immersive returns "config.immersivemc.furnace", which becomes "Use Furnace Immersion" when the language is set to U.S. English.- Returns:
- The String for a translation key for the title of this option.
-
getOptionItems
Set<net.minecraft.world.item.ItemStack> getOptionItems()Gets the ItemStacks representing this config. As of writing, this currently goes unused in ImmersiveMC, but is planned to be used in the future. If there are no good items representing the Immersive, you may return an empty set here.- Returns:
- A set of ItemStacks that best represents this Immersive, or an empty set if none such ItemStack exists.
-
getOptionTooltip
@Nullable @Nullable net.minecraft.network.chat.Component getOptionTooltip()Get the Component representing the description of this option.- Returns:
- The description of this option, or null if no description should be shown.
-
isEnabled
boolean isEnabled()- Returns:
- Whether the config file currently has this Immersive enabled.
-
setEnabled
void setEnabled(boolean newValue) The method called to set the config value for enabling/disabling this Immersive.- Parameters:
newValue
- Whether the Immersive is now enabled.
-