All Implemented Interfaces:
Comparable<ExtendedConfig<ItemConfig,net.minecraft.world.item.Item>>, IModelProviderConfig

public class ItemConfig extends ExtendedConfigForge<ItemConfig,net.minecraft.world.item.Item> implements IModelProviderConfig
Config for items.
See Also:
  • Field Details

    • dynamicItemVariantLocation

      public net.minecraft.client.resources.model.ModelResourceLocation dynamicItemVariantLocation
  • Constructor Details

    • ItemConfig

      public ItemConfig(ModBase mod, String namedId, Function<ItemConfig,? extends net.minecraft.world.item.Item> elementConstructor)
      Make a new instance.
      Parameters:
      mod - The mod instance.
      namedId - The unique name ID for the configurable.
      elementConstructor - The element constructor.
  • Method Details

    • getModelName

      public String getModelName(net.minecraft.world.item.ItemStack itemStack)
      Description copied from interface: IModelProviderConfig
      Get the model name for the given itemstack.
      Specified by:
      getModelName in interface IModelProviderConfig
      Parameters:
      itemStack - The item stack
      Returns:
      The model name.
    • getTranslationKey

      public String getTranslationKey()
      Description copied from class: ExtendedConfig
      Get the unlocalized name (must be unique!) for this configurable.
      Specified by:
      getTranslationKey in class ExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
      Returns:
      The unlocalized name.
    • getFullTranslationKey

      public String getFullTranslationKey()
      Description copied from class: ExtendedConfig
      Get the full unlocalized name for this configurable.
      Overrides:
      getFullTranslationKey in class ExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
      Returns:
      The unlocalized name.
    • getConfigurableType

      public ConfigurableType getConfigurableType()
      Description copied from class: ExtendedConfig
      Return the configurable type for which this config holds data
      Specified by:
      getConfigurableType in class ExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
      Returns:
      the type of the configurable to where the config belongs
    • registerDynamicModel

      public net.minecraft.client.resources.model.ModelResourceLocation registerDynamicModel()
      Register default item models for this item. This should only be used when registering dynamic models.
      Returns:
      The item resource location.
    • onRegistered

      public void onRegistered()
      Description copied from class: ExtendedConfig
      Overridable method that is called after the element of this config is fully registered, after the FMLCommonSetupEvent.
      Overrides:
      onRegistered in class ExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
    • getDefaultCreativeTabEntries

      protected Collection<net.minecraft.world.item.ItemStack> getDefaultCreativeTabEntries()
    • onForgeRegistered

      public void onForgeRegistered()
      Description copied from class: ExtendedConfig
      Overridable method that is immediately called after this element has been registered into a Forge registry.
      Overrides:
      onForgeRegistered in class ExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
    • getRegistry

      public net.minecraft.core.Registry<? super net.minecraft.world.item.Item> getRegistry()
      Specified by:
      getRegistry in class ExtendedConfigForge<ItemConfig,net.minecraft.world.item.Item>
      Returns:
      The registry in which this should be registered.
    • getItemColorHandler

      @Nullable public net.minecraft.client.color.item.ItemColor getItemColorHandler()
      Returns:
      The color handler for the item instance.