Class LangComponent
java.lang.Object
codechicken.lib.block.ModularBlock.Component
codechicken.lib.block.component.data.DataGenComponent
codechicken.lib.block.component.data.LangComponent
a data generator component for defining Localizations.
Created by covers1624 on 29/8/22.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionLangComponent(String key, String name) Constructs a newLangComponent.LangComponent(String locale, String key, String name) Constructs a newLangComponent.protectedLangComponent(String locale, Supplier<String> key, String name) LangComponent(net.minecraft.world.level.block.Block block, String name) Construct a newLangComponentusing the default description id of the provided block as the language key. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToProvider(net.minecraft.data.DataProvider provider) Add this component to the providedDataProvider.Methods inherited from class codechicken.lib.block.component.data.DataGenComponent
addAllToProvider, addToProviderMethods inherited from class codechicken.lib.block.ModularBlock.Component
getBlock
-
Constructor Details
-
LangComponent
Construct a newLangComponentusing the default description id of the provided block as the language key.This defaults to the
en_uslocale.- Parameters:
block- The block.name- The localization.
-
LangComponent
Constructs a newLangComponent.- Parameters:
key- The localization key.name- The localization value.
-
LangComponent
Constructs a newLangComponent.- Parameters:
locale- The locale of this LangComponent.key- The localization key.name- The localization value.
-
LangComponent
-
-
Method Details
-
addToProvider
protected void addToProvider(net.minecraft.data.DataProvider provider) Description copied from class:DataGenComponentAdd this component to the providedDataProvider.Implementors will need to filter for the correct
DataProviderimplementation.- Specified by:
addToProviderin classDataGenComponent- Parameters:
provider- The data provider to add to.
-