Class LangComponent


@Experimental public class LangComponent extends DataGenComponent
a data generator component for defining Localizations.

Created by covers1624 on 29/8/22.

See Also:
  • Constructor Details

    • LangComponent

      public LangComponent(net.minecraft.world.level.block.Block block, String name)
      Construct a new LangComponent using the default description id of the provided block as the language key.

      This defaults to the en_us locale.

      Parameters:
      block - The block.
      name - The localization.
    • LangComponent

      public LangComponent(String key, String name)
      Constructs a new LangComponent.
      Parameters:
      key - The localization key.
      name - The localization value.
    • LangComponent

      public LangComponent(String locale, String key, String name)
      Constructs a new LangComponent.
      Parameters:
      locale - The locale of this LangComponent.
      key - The localization key.
      name - The localization value.
    • LangComponent

      protected LangComponent(String locale, Supplier<String> key, String name)
  • Method Details

    • addToProvider

      protected void addToProvider(net.minecraft.data.DataProvider provider)
      Description copied from class: DataGenComponent
      Add this component to the provided DataProvider.

      Implementors will need to filter for the correct DataProvider implementation.

      Specified by:
      addToProvider in class DataGenComponent
      Parameters:
      provider - The data provider to add to.