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

    Constructors
    Constructor
    Description
    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)
    Creates an instance of a ImmersiveConfigScreenInfoImpl record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    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
    Returns a hash code value for this object.
    boolean
     
    Returns the value of the isEnabledSupplier record component.
    Returns the value of the modID record component.
    Supplier<Set<net.minecraft.world.item.ItemStack>>
    Returns the value of the optionItem record component.
    @Nullable net.minecraft.network.chat.Component
    Returns the value of the optionTooltip record component.
    Returns the value of the optionTranslation record component.
    void
    setEnabled(boolean newValue)
    The method called to set the config value for enabling/disabling this Immersive.
    Returns the value of the setEnabledConsumer record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a ImmersiveConfigScreenInfoImpl record class.
      Parameters:
      modID - the value for the modID record component
      optionTranslation - the value for the optionTranslation record component
      optionItem - the value for the optionItem record component
      optionTooltip - the value for the optionTooltip record component
      isEnabledSupplier - the value for the isEnabledSupplier record component
      setEnabledConsumer - the value for the setEnabledConsumer record component
  • Method Details

    • getModID

      public String 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 interface ImmersiveConfigScreenInfo
      Returns:
      The mod name of the mod that implemented this Immersive.
    • getOptionTranslation

      public String 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 interface ImmersiveConfigScreenInfo
      Returns:
      The String for a translation key for the title of this option.
    • getOptionItems

      public Set<net.minecraft.world.item.ItemStack> 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 interface ImmersiveConfigScreenInfo
      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 interface ImmersiveConfigScreenInfo
      Returns:
      The description of this option, or null if no description should be shown.
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface ImmersiveConfigScreenInfo
      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 interface ImmersiveConfigScreenInfo
      Parameters:
      newValue - Whether the Immersive is now enabled.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • modID

      public String modID()
      Returns the value of the modID record component.
      Returns:
      the value of the modID record component
    • optionTranslation

      public String optionTranslation()
      Returns the value of the optionTranslation record component.
      Returns:
      the value of the optionTranslation record component
    • optionItem

      public Supplier<Set<net.minecraft.world.item.ItemStack>> optionItem()
      Returns the value of the optionItem record component.
      Returns:
      the value of the optionItem record component
    • optionTooltip

      @Nullable public @Nullable net.minecraft.network.chat.Component optionTooltip()
      Returns the value of the optionTooltip record component.
      Returns:
      the value of the optionTooltip record component
    • isEnabledSupplier

      public Supplier<Boolean> isEnabledSupplier()
      Returns the value of the isEnabledSupplier record component.
      Returns:
      the value of the isEnabledSupplier record component
    • setEnabledConsumer

      public Consumer<Boolean> setEnabledConsumer()
      Returns the value of the setEnabledConsumer record component.
      Returns:
      the value of the setEnabledConsumer record component