Record Class ImmersiveConfigScreenInfoImpl
java.lang.Object
java.lang.Record
com.hammy275.immersivemc.client.api_impl.ImmersiveConfigScreenInfoImpl
- All Implemented Interfaces:
ImmersiveConfigScreenInfo
public record ImmersiveConfigScreenInfoImpl(String modID, String optionTranslation, Supplier<Set<net.minecraft.world.item.ItemStack>> optionItem, @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer)
extends Record
implements ImmersiveConfigScreenInfo
-
Constructor Summary
ConstructorsConstructorDescriptionImmersiveConfigScreenInfoImpl(String modID, String optionTranslation, Supplier<Set<net.minecraft.world.item.ItemStack>> optionItem, @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Creates an instance of aImmersiveConfigScreenInfoImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getModID()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.ComponentGet the Component representing the description of this option.Get the translation string for the button label, not including the enabled/disabled state.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisEnabledSupplierrecord component.modID()Returns the value of themodIDrecord component.Returns the value of theoptionItemrecord component.@Nullable net.minecraft.network.chat.ComponentReturns the value of theoptionTooltiprecord component.Returns the value of theoptionTranslationrecord component.voidsetEnabled(boolean newValue) The method called to set the config value for enabling/disabling this Immersive.Returns the value of thesetEnabledConsumerrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ImmersiveConfigScreenInfoImpl
public ImmersiveConfigScreenInfoImpl(String modID, String optionTranslation, Supplier<Set<net.minecraft.world.item.ItemStack>> optionItem, @Nullable @Nullable net.minecraft.network.chat.Component optionTooltip, Supplier<Boolean> isEnabledSupplier, Consumer<Boolean> setEnabledConsumer) Creates an instance of aImmersiveConfigScreenInfoImplrecord class.- Parameters:
modID- the value for themodIDrecord componentoptionTranslation- the value for theoptionTranslationrecord componentoptionItem- the value for theoptionItemrecord componentoptionTooltip- the value for theoptionTooltiprecord componentisEnabledSupplier- the value for theisEnabledSupplierrecord componentsetEnabledConsumer- the value for thesetEnabledConsumerrecord component
-
-
Method Details
-
getModID
Description copied from interface:ImmersiveConfigScreenInfoGet 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.- Specified by:
getModIDin interfaceImmersiveConfigScreenInfo- Returns:
- The mod name of the mod that implemented this Immersive.
-
getOptionTranslation
Description copied from interface:ImmersiveConfigScreenInfoGet 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.- Specified by:
getOptionTranslationin interfaceImmersiveConfigScreenInfo- Returns:
- The String for a translation key for the title of this option.
-
getOptionItems
Description copied from interface:ImmersiveConfigScreenInfoGets 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.- Specified by:
getOptionItemsin interfaceImmersiveConfigScreenInfo- Returns:
- A set of ItemStacks that best represents this Immersive, or an empty set if none such ItemStack exists.
-
getOptionTooltip
@Nullable public @Nullable net.minecraft.network.chat.Component getOptionTooltip()Description copied from interface:ImmersiveConfigScreenInfoGet the Component representing the description of this option.- Specified by:
getOptionTooltipin interfaceImmersiveConfigScreenInfo- Returns:
- The description of this option, or null if no description should be shown.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceImmersiveConfigScreenInfo- Returns:
- Whether the config file currently has this Immersive enabled.
-
setEnabled
public void setEnabled(boolean newValue) Description copied from interface:ImmersiveConfigScreenInfoThe method called to set the config value for enabling/disabling this Immersive.- Specified by:
setEnabledin interfaceImmersiveConfigScreenInfo- Parameters:
newValue- Whether the Immersive is now enabled.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
modID
Returns the value of themodIDrecord component.- Returns:
- the value of the
modIDrecord component
-
optionTranslation
Returns the value of theoptionTranslationrecord component.- Returns:
- the value of the
optionTranslationrecord component
-
optionItem
Returns the value of theoptionItemrecord component.- Returns:
- the value of the
optionItemrecord component
-
optionTooltip
@Nullable public @Nullable net.minecraft.network.chat.Component optionTooltip()Returns the value of theoptionTooltiprecord component.- Returns:
- the value of the
optionTooltiprecord component
-
isEnabledSupplier
Returns the value of theisEnabledSupplierrecord component.- Returns:
- the value of the
isEnabledSupplierrecord component
-
setEnabledConsumer
Returns the value of thesetEnabledConsumerrecord component.- Returns:
- the value of the
setEnabledConsumerrecord component
-