java.lang.Object
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig<C,I>
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfigForge<BlockConfig,net.minecraft.world.level.block.Block>
org.cyclops.cyclopscore.config.extendedconfig.BlockConfig
All Implemented Interfaces:
Comparable<ExtendedConfig<BlockConfig,net.minecraft.world.level.block.Block>>, IModelProviderConfig

public abstract class BlockConfig extends ExtendedConfigForge<BlockConfig,net.minecraft.world.level.block.Block> implements IModelProviderConfig
Config for blocks.
See Also:
  • Field Details

    • dynamicBlockVariantLocation

      public net.minecraft.client.resources.model.ModelResourceLocation dynamicBlockVariantLocation
    • dynamicItemVariantLocation

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

    • BlockConfig

      public BlockConfig(ModBase mod, String namedId, Function<BlockConfig,? extends net.minecraft.world.level.block.Block> blockConstructor, @Nullable BiFunction<BlockConfig,net.minecraft.world.level.block.Block,? extends net.minecraft.world.item.Item> itemConstructor)
  • Method Details

    • getDefaultItemConstructor

      protected static BiFunction<BlockConfig,net.minecraft.world.level.block.Block,? extends net.minecraft.world.item.BlockItem> getDefaultItemConstructor(ModBase mod)
    • getDefaultItemConstructor

      protected static BiFunction<BlockConfig,net.minecraft.world.level.block.Block,? extends net.minecraft.world.item.BlockItem> getDefaultItemConstructor(ModBase mod, @Nullable Function<net.minecraft.world.item.Item.Properties,net.minecraft.world.item.Item.Properties> itemPropertiesModifier)
    • getItemConstructor

      @Nullable public BiFunction<BlockConfig,net.minecraft.world.level.block.Block,? extends net.minecraft.world.item.Item> getItemConstructor()
    • getItemInstance

      @Nullable public net.minecraft.world.item.Item getItemInstance()
    • setItemInstance

      public void setItemInstance(@Nullable net.minecraft.world.item.Item itemInstance)
    • 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<BlockConfig,net.minecraft.world.level.block.Block>
      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<BlockConfig,net.minecraft.world.level.block.Block>
      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<BlockConfig,net.minecraft.world.level.block.Block>
      Returns:
      the type of the configurable to where the config belongs
    • registerDynamicModel

      public org.apache.commons.lang3.tuple.Pair<net.minecraft.client.resources.model.ModelResourceLocation,net.minecraft.client.resources.model.ModelResourceLocation> registerDynamicModel()
      Register default block and item models for this block. This should only be used when registering dynamic models.
      Returns:
      The pair of block resource location and 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<BlockConfig,net.minecraft.world.level.block.Block>
    • defaultCreativeTabEntries

      protected Collection<net.minecraft.world.item.ItemStack> defaultCreativeTabEntries()
    • 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<BlockConfig,net.minecraft.world.level.block.Block>
    • getRegistry

      public net.minecraft.core.Registry<? super net.minecraft.world.level.block.Block> getRegistry()
      Specified by:
      getRegistry in class ExtendedConfigForge<BlockConfig,net.minecraft.world.level.block.Block>
      Returns:
      The registry in which this should be registered.
    • getBlockColorHandler

      @Nullable public net.minecraft.client.color.block.BlockColor getBlockColorHandler()
      Returns:
      An optional color handler for the block instance.