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
ConstructorDescriptionImmersiveConfigScreenInfoImpl
(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 aImmersiveConfigScreenInfoImpl
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates 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.Component
Get the Component representing the description of this option.Get the translation string for the button label, not including the enabled/disabled state.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theisEnabledSupplier
record component.modID()
Returns the value of themodID
record component.Returns the value of theoptionItem
record component.@Nullable net.minecraft.network.chat.Component
Returns the value of theoptionTooltip
record component.Returns the value of theoptionTranslation
record component.void
setEnabled
(boolean newValue) The method called to set the config value for enabling/disabling this Immersive.Returns the value of thesetEnabledConsumer
record component.final String
toString()
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 aImmersiveConfigScreenInfoImpl
record class.- Parameters:
modID
- the value for themodID
record componentoptionTranslation
- the value for theoptionTranslation
record componentoptionItem
- the value for theoptionItem
record componentoptionTooltip
- the value for theoptionTooltip
record componentisEnabledSupplier
- the value for theisEnabledSupplier
record componentsetEnabledConsumer
- the value for thesetEnabledConsumer
record component
-
-
Method Details
-
getModID
Description copied from interface:ImmersiveConfigScreenInfo
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.- Specified by:
getModID
in interfaceImmersiveConfigScreenInfo
- Returns:
- The mod name of the mod that implemented this Immersive.
-
getOptionTranslation
Description copied from interface:ImmersiveConfigScreenInfo
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.- Specified by:
getOptionTranslation
in interfaceImmersiveConfigScreenInfo
- Returns:
- The String for a translation key for the title of this option.
-
getOptionItems
Description copied from interface:ImmersiveConfigScreenInfo
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.- Specified by:
getOptionItems
in 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:ImmersiveConfigScreenInfo
Get the Component representing the description of this option.- Specified by:
getOptionTooltip
in interfaceImmersiveConfigScreenInfo
- Returns:
- The description of this option, or null if no description should be shown.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceImmersiveConfigScreenInfo
- Returns:
- Whether the config file currently has this Immersive enabled.
-
setEnabled
public void setEnabled(boolean newValue) Description copied from interface:ImmersiveConfigScreenInfo
The method called to set the config value for enabling/disabling this Immersive.- Specified by:
setEnabled
in 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 themodID
record component.- Returns:
- the value of the
modID
record component
-
optionTranslation
Returns the value of theoptionTranslation
record component.- Returns:
- the value of the
optionTranslation
record component
-
optionItem
Returns the value of theoptionItem
record component.- Returns:
- the value of the
optionItem
record component
-
optionTooltip
@Nullable public @Nullable net.minecraft.network.chat.Component optionTooltip()Returns the value of theoptionTooltip
record component.- Returns:
- the value of the
optionTooltip
record component
-
isEnabledSupplier
Returns the value of theisEnabledSupplier
record component.- Returns:
- the value of the
isEnabledSupplier
record component
-
setEnabledConsumer
Returns the value of thesetEnabledConsumer
record component.- Returns:
- the value of the
setEnabledConsumer
record component
-