Class Factories

java.lang.Object
net.dillon.dillonlib.factory.Factories

public class Factories extends Object
Stores and registers different factories for specific Minecraft registries.

See net.dillon.dillonlib.factory.item for more item-specific factories.

Since:
1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Set<BoatData>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.tags.TagKey<net.minecraft.world.entity.ai.attributes.Attribute>
    createAttributeTag(net.minecraft.resources.Identifier id)
    Registers a attribute tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>
    createBiomeTag(net.minecraft.resources.Identifier id)
    Registers a biome tag.
    static net.minecraft.tags.BlockItemTagId
    createBlockAndItemTag(net.minecraft.resources.Identifier id)
    Registers a BlockItemTagId tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>
    createBlockTag(net.minecraft.resources.Identifier id)
    Registers a block tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.feature.ConfiguredFeature<?,?>>
    createConfiguredFeatureTag(net.minecraft.resources.Identifier id)
    Registers a configured feature tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.damagesource.DamageType>
    createDamageTypeTag(net.minecraft.resources.Identifier id)
    Registers a damage type tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.Level>
    createDimensionTag(net.minecraft.resources.Identifier id)
    Registers a dimension tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.dimension.DimensionType>
    createDimensionTypeTag(net.minecraft.resources.Identifier id)
    Registers a dimension type tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment>
    createEnchantmentTag(net.minecraft.resources.Identifier id)
    Registers a enchantment tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>>
    createEntityTypeTag(net.minecraft.resources.Identifier id)
    Registers a entity type tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>
    createFluidTag(net.minecraft.resources.Identifier id)
    Registers a fluid tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.item.Item>
    createItemTag(net.minecraft.resources.Identifier id)
    Registers a item tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.placement.PlacedFeature>
    createPlacedFeatureTag(net.minecraft.resources.Identifier id)
    Registers a placed feature tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.item.alchemy.Potion>
    createPotionTag(net.minecraft.resources.Identifier id)
    Registers a potion tag.
    static <T> net.minecraft.tags.TagKey<T>
    createRegisterableTag(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> registerable, net.minecraft.resources.Identifier id)
    Registers any TagKey object of Registries.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.StructureSet>
    createStructureSetTag(net.minecraft.resources.Identifier id)
    Registers a structure set tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.Structure>
    createStructureTag(net.minecraft.resources.Identifier id)
    Registers a structure tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool>
    createTemplatePoolTag(net.minecraft.resources.Identifier id)
    Registers a template pool tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.TradeSet>
    createTradeSetTag(net.minecraft.resources.Identifier id)
    Registers a trade set tag.
    static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.VillagerTrade>
    createVillagerTradeTag(net.minecraft.resources.Identifier id)
    Registers a villager trade tag.
    static void
    factorItemLikeIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, net.minecraft.world.level.ItemLike itemLike)
    Adds a ItemLike to a specific CreativeModeTab.
    static void
    factorItemLikesIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, List<net.minecraft.world.level.ItemLike> items)
    Adds a List of ItemLikes to a specific CreativeModeTab.
    static void
    factorItemLikesIntoCreativeTabs(List<net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab>> tabs, List<net.minecraft.world.level.ItemLike> items)
    Adds a List of ItemLikes to multiple CreativeModeTabs.
    static void
    factorItemStackIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, Supplier<net.minecraft.world.item.ItemStack> item)
    Adds an ItemStack to a specific CreativeModeTab.
    static void
    factorItemStacksIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, Supplier<List<net.minecraft.world.item.ItemStack>> items)
    Adds a List of ItemStacks to a specific CreativeModeTab.
    static void
    factorItemStacksIntoCreativeTabs(List<net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab>> tabs, Supplier<List<net.minecraft.world.item.ItemStack>> items)
    Adds a List of ItemStacks to multiple CreativeModeTabs.
    static void
    i_()
    Initializes this class.
    static void
    registerBoatDispenserBehavior(List<Map<net.minecraft.world.item.Item, net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.vehicle.boat.AbstractBoat>>> boats)
    Safely registers BoatDispenseItemBehavior for a list of boats and boat items.
    static <T extends net.minecraft.world.entity.vehicle.boat.AbstractBoat>
    net.minecraft.world.entity.EntityType<T>
    registerBoatFactory(net.minecraft.resources.Identifier id, Supplier<net.minecraft.world.item.Item> dropItem, boolean chest)
    Registers a boat entity factory into the game.
    static <T extends net.minecraft.world.entity.vehicle.boat.AbstractBoat>
    net.minecraft.world.entity.EntityType<T>
    registerBoatFactory(net.minecraft.resources.Identifier id, net.minecraft.world.entity.EntityType.EntityFactory<T> factory, boolean chest)
    Registers a custom-factory boat entity into the game.
    static <T extends net.minecraft.world.entity.Entity>
    net.minecraft.world.entity.EntityType<T>
    registerEntityType(net.minecraft.resources.ResourceKey<net.minecraft.world.entity.EntityType<?>> key, net.minecraft.world.entity.EntityType.Builder<T> type)
    Helper method for registering entity types.
    static void
    registerFlintAndSteelDispenserBehavior(List<net.minecraft.world.item.Item> flintAndSteels)
    Safely registers FlintAndSteelDispenseItemBehavior for a list of IgnitableFactory.FlintAndSteels.
    static void
    registerShearDispenserBehavior(List<net.minecraft.world.item.Item> shears)
    Safely registers ShearsDispenseItemBehavior for a list of ShearsFactorys.
    static void
    registerSimpleItemGroupFactory(net.minecraft.resources.Identifier id, net.minecraft.world.level.ItemLike icon, Supplier<List<net.minecraft.world.item.ItemStack>> entries)
    Creates a simple item group with a custom supplier for your items.
    static void
    registerSimpleItemGroupFactory(net.minecraft.resources.Identifier id, net.minecraft.world.level.ItemLike icon, List<net.minecraft.world.level.ItemLike> entries)
    Creates a simple item group with basic items.
    static net.minecraft.sounds.SoundEvent
    registerSoundEvent(net.minecraft.resources.Identifier id)
    Registers a sound event.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Factories

      public Factories()
  • Method Details

    • registerBoatFactory

      public static <T extends net.minecraft.world.entity.vehicle.boat.AbstractBoat> net.minecraft.world.entity.EntityType<T> registerBoatFactory(net.minecraft.resources.Identifier id, Supplier<net.minecraft.world.item.Item> dropItem, boolean chest)
      Registers a boat entity factory into the game.
      Parameters:
      id - the Identifier for the boat entity
      dropItem - the item that is dropped from the boat, and also registers dispenser behavior.
      chest - determines if the boat is a chest boat
      Returns:
      the registered boat entity type
    • registerBoatFactory

      public static <T extends net.minecraft.world.entity.vehicle.boat.AbstractBoat> net.minecraft.world.entity.EntityType<T> registerBoatFactory(net.minecraft.resources.Identifier id, net.minecraft.world.entity.EntityType.EntityFactory<T> factory, boolean chest)
      Registers a custom-factory boat entity into the game.
      Parameters:
      factory - the custom factory for the boat.
      Returns:
      the custom-factory registered boat entity.
    • registerBoatDispenserBehavior

      public static void registerBoatDispenserBehavior(List<Map<net.minecraft.world.item.Item, net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.vehicle.boat.AbstractBoat>>> boats)
      Safely registers BoatDispenseItemBehavior for a list of boats and boat items.
      Parameters:
      boats - a map of items and entity types to register your dispenser behavior. This should be called after both your entity types and items are initialized.
    • registerShearDispenserBehavior

      public static void registerShearDispenserBehavior(List<net.minecraft.world.item.Item> shears)
      Safely registers ShearsDispenseItemBehavior for a list of ShearsFactorys.
      Parameters:
      shears - a list of ShearFactories to be registered for dispenser behavior.
    • registerFlintAndSteelDispenserBehavior

      public static void registerFlintAndSteelDispenserBehavior(List<net.minecraft.world.item.Item> flintAndSteels)
      Safely registers FlintAndSteelDispenseItemBehavior for a list of IgnitableFactory.FlintAndSteels.
      Parameters:
      flintAndSteels - a list of IgnitableFactories to be registered for dispenser behavior.
    • registerEntityType

      public static <T extends net.minecraft.world.entity.Entity> net.minecraft.world.entity.EntityType<T> registerEntityType(net.minecraft.resources.ResourceKey<net.minecraft.world.entity.EntityType<?>> key, net.minecraft.world.entity.EntityType.Builder<T> type)
      Helper method for registering entity types.
    • registerSimpleItemGroupFactory

      public static void registerSimpleItemGroupFactory(net.minecraft.resources.Identifier id, net.minecraft.world.level.ItemLike icon, List<net.minecraft.world.level.ItemLike> entries)
      Creates a simple item group with basic items. Should be called in your mod's common initialization stage. This will register your item group on all platforms automatically (fabric x (neo)forge).
      Parameters:
      id - the Identifier for your item group (used to create the translation key)
      icon - the icon for your item group
      entries - the list of ItemLikes to be in your item group
    • registerSimpleItemGroupFactory

      public static void registerSimpleItemGroupFactory(net.minecraft.resources.Identifier id, net.minecraft.world.level.ItemLike icon, Supplier<List<net.minecraft.world.item.ItemStack>> entries)
      Creates a simple item group with a custom supplier for your items. Should be called in your mod's common initialization stage. This will register your item group on all platforms automatically (fabric x (neo)forge).
      Parameters:
      id - the Identifier for your item group (used to create the translation key)
      icon - the icon for your item group
      entries - the list of items to be in your item group
    • factorItemStackIntoCreativeTab

      public static void factorItemStackIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, Supplier<net.minecraft.world.item.ItemStack> item)
      Adds an ItemStack to a specific CreativeModeTab. Should be called in your mod's initialization stage.
      Parameters:
      tab - the tab you want to modify
      item - the item you want to add to the tab (as an item stack)
    • factorItemLikeIntoCreativeTab

      public static void factorItemLikeIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, net.minecraft.world.level.ItemLike itemLike)
      Adds a ItemLike to a specific CreativeModeTab. Should be called in your mod's initialization stage.
      Parameters:
      tab - the tab you want to modify
      itemLike - the item you want to add to the tab (as an item like)
    • factorItemLikesIntoCreativeTab

      public static void factorItemLikesIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, List<net.minecraft.world.level.ItemLike> items)
      Adds a List of ItemLikes to a specific CreativeModeTab. Should be called in your mod's initialization stage.
      Parameters:
      tab - the tab you want to modify
      items - the list of item likes that you want to add
    • factorItemStacksIntoCreativeTab

      public static void factorItemStacksIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, Supplier<List<net.minecraft.world.item.ItemStack>> items)
      Adds a List of ItemStacks to a specific CreativeModeTab. Should be called in your mod's initialization stage.
      Parameters:
      tab - the tab you want to modify
      items - the list of item stacks that you want to add
    • factorItemLikesIntoCreativeTabs

      public static void factorItemLikesIntoCreativeTabs(List<net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab>> tabs, List<net.minecraft.world.level.ItemLike> items)
      Adds a List of ItemLikes to multiple CreativeModeTabs. Should be called in your mod's initialization stage.
      Parameters:
      tabs - the list of tabs that you want to modify
      items - the list of item likes that you want to add to each tab
    • factorItemStacksIntoCreativeTabs

      public static void factorItemStacksIntoCreativeTabs(List<net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab>> tabs, Supplier<List<net.minecraft.world.item.ItemStack>> items)
      Adds a List of ItemStacks to multiple CreativeModeTabs. Should be called in your mod's initialization stage.
      Parameters:
      tabs - the list of tabs that you want to modify
      items - the list of item stacks that you want to add to each tab
    • registerSoundEvent

      public static net.minecraft.sounds.SoundEvent registerSoundEvent(net.minecraft.resources.Identifier id)
      Registers a sound event.
    • createBlockTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> createBlockTag(net.minecraft.resources.Identifier id)
      Registers a block tag.
    • createBlockAndItemTag

      public static net.minecraft.tags.BlockItemTagId createBlockAndItemTag(net.minecraft.resources.Identifier id)
      Registers a BlockItemTagId tag.
    • createItemTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.item.Item> createItemTag(net.minecraft.resources.Identifier id)
      Registers a item tag.
    • createPotionTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.item.alchemy.Potion> createPotionTag(net.minecraft.resources.Identifier id)
      Registers a potion tag.
    • createEnchantmentTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> createEnchantmentTag(net.minecraft.resources.Identifier id)
      Registers a enchantment tag.
    • createFluidTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> createFluidTag(net.minecraft.resources.Identifier id)
      Registers a fluid tag.
    • createStructureTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.Structure> createStructureTag(net.minecraft.resources.Identifier id)
      Registers a structure tag.
    • createStructureSetTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.StructureSet> createStructureSetTag(net.minecraft.resources.Identifier id)
      Registers a structure set tag.
    • createTemplatePoolTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool> createTemplatePoolTag(net.minecraft.resources.Identifier id)
      Registers a template pool tag.
    • createConfiguredFeatureTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.feature.ConfiguredFeature<?,?>> createConfiguredFeatureTag(net.minecraft.resources.Identifier id)
      Registers a configured feature tag.
    • createPlacedFeatureTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.placement.PlacedFeature> createPlacedFeatureTag(net.minecraft.resources.Identifier id)
      Registers a placed feature tag.
    • createBiomeTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome> createBiomeTag(net.minecraft.resources.Identifier id)
      Registers a biome tag.
    • createDimensionTypeTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.dimension.DimensionType> createDimensionTypeTag(net.minecraft.resources.Identifier id)
      Registers a dimension type tag.
    • createDimensionTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.level.Level> createDimensionTag(net.minecraft.resources.Identifier id)
      Registers a dimension tag.
    • createVillagerTradeTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.VillagerTrade> createVillagerTradeTag(net.minecraft.resources.Identifier id)
      Registers a villager trade tag.
    • createTradeSetTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.TradeSet> createTradeSetTag(net.minecraft.resources.Identifier id)
      Registers a trade set tag.
    • createAttributeTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.entity.ai.attributes.Attribute> createAttributeTag(net.minecraft.resources.Identifier id)
      Registers a attribute tag.
    • createDamageTypeTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.damagesource.DamageType> createDamageTypeTag(net.minecraft.resources.Identifier id)
      Registers a damage type tag.
    • createEntityTypeTag

      public static net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> createEntityTypeTag(net.minecraft.resources.Identifier id)
      Registers a entity type tag.
    • createRegisterableTag

      public static <T> net.minecraft.tags.TagKey<T> createRegisterableTag(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> registerable, net.minecraft.resources.Identifier id)
      Registers any TagKey object of Registries.
    • i_

      public static void i_()
      Initializes this class.