Class Factories
java.lang.Object
net.dillon.dillonlib.factory.Factories
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.tags.TagKey<net.minecraft.world.entity.ai.attributes.Attribute> createAttributeTag(net.minecraft.resources.Identifier id) Registers aattributetag.static net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome> createBiomeTag(net.minecraft.resources.Identifier id) Registers abiometag.static net.minecraft.tags.BlockItemTagIdcreateBlockAndItemTag(net.minecraft.resources.Identifier id) Registers aBlockItemTagIdtag.static net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> createBlockTag(net.minecraft.resources.Identifier id) Registers ablocktag.static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.feature.ConfiguredFeature<?, ?>> createConfiguredFeatureTag(net.minecraft.resources.Identifier id) Registers aconfigured featuretag.static net.minecraft.tags.TagKey<net.minecraft.world.damagesource.DamageType> createDamageTypeTag(net.minecraft.resources.Identifier id) Registers adamage typetag.static net.minecraft.tags.TagKey<net.minecraft.world.level.Level> createDimensionTag(net.minecraft.resources.Identifier id) Registers adimensiontag.static net.minecraft.tags.TagKey<net.minecraft.world.level.dimension.DimensionType> createDimensionTypeTag(net.minecraft.resources.Identifier id) Registers adimension typetag.static net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> createEnchantmentTag(net.minecraft.resources.Identifier id) Registers aenchantmenttag.static net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> createEntityTypeTag(net.minecraft.resources.Identifier id) Registers aentity typetag.static net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> createFluidTag(net.minecraft.resources.Identifier id) Registers afluidtag.static net.minecraft.tags.TagKey<net.minecraft.world.item.Item> createItemTag(net.minecraft.resources.Identifier id) Registers aitemtag.static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.placement.PlacedFeature> createPlacedFeatureTag(net.minecraft.resources.Identifier id) Registers aplaced featuretag.static net.minecraft.tags.TagKey<net.minecraft.world.item.alchemy.Potion> createPotionTag(net.minecraft.resources.Identifier id) Registers apotiontag.static <T> net.minecraft.tags.TagKey<T> createRegisterableTag(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> registerable, net.minecraft.resources.Identifier id) Registers anyTagKeyobject ofRegistries.static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.StructureSet> createStructureSetTag(net.minecraft.resources.Identifier id) Registers astructure settag.static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.Structure> createStructureTag(net.minecraft.resources.Identifier id) Registers astructuretag.static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool> createTemplatePoolTag(net.minecraft.resources.Identifier id) Registers atemplate pooltag.static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.TradeSet> createTradeSetTag(net.minecraft.resources.Identifier id) Registers atrade settag.static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.VillagerTrade> createVillagerTradeTag(net.minecraft.resources.Identifier id) Registers avillager tradetag.static voidfactorItemLikeIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, net.minecraft.world.level.ItemLike itemLike) Adds aItemLiketo a specificCreativeModeTab.static voidfactorItemLikesIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, List<net.minecraft.world.level.ItemLike> items) static voidfactorItemLikesIntoCreativeTabs(List<net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab>> tabs, List<net.minecraft.world.level.ItemLike> items) static voidfactorItemStackIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, Supplier<net.minecraft.world.item.ItemStack> item) Adds anItemStackto a specificCreativeModeTab.static voidfactorItemStacksIntoCreativeTab(net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab> tab, Supplier<List<net.minecraft.world.item.ItemStack>> items) static voidfactorItemStacksIntoCreativeTabs(List<net.minecraft.resources.ResourceKey<net.minecraft.world.item.CreativeModeTab>> tabs, Supplier<List<net.minecraft.world.item.ItemStack>> items) static voidi_()Initializes this class.static voidregisterBoatDispenserBehavior(List<Map<net.minecraft.world.item.Item, net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.vehicle.boat.AbstractBoat>>> boats) Safely registersBoatDispenseItemBehaviorfor 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 aboat entity factoryinto 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 voidregisterFlintAndSteelDispenserBehavior(List<net.minecraft.world.item.Item> flintAndSteels) Safely registersFlintAndSteelDispenseItemBehaviorfor a list ofIgnitableFactory.FlintAndSteels.static voidregisterShearDispenserBehavior(List<net.minecraft.world.item.Item> shears) Safely registersShearsDispenseItemBehaviorfor a list ofShearsFactorys.static voidregisterSimpleItemGroupFactory(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 voidregisterSimpleItemGroupFactory(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.SoundEventregisterSoundEvent(net.minecraft.resources.Identifier id) Registers asound event.
-
Field Details
-
BOATS
-
-
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 aboat entity factoryinto the game.- Parameters:
id- theIdentifierfor the boat entitydropItem- the item that is dropped from the boat, and also registers dispenser behavior.chest- determines if the boat is achest 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 registersBoatDispenseItemBehaviorfor 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
Safely registersShearsDispenseItemBehaviorfor a list ofShearsFactorys.- 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 registersFlintAndSteelDispenseItemBehaviorfor a list ofIgnitableFactory.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- theIdentifierfor your item group (used to create the translation key)icon- the icon for your item groupentries- the list ofItemLikes 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- theIdentifierfor your item group (used to create the translation key)icon- the icon for your item groupentries- 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 anItemStackto a specificCreativeModeTab. Should be called in your mod's initialization stage.- Parameters:
tab- the tab you want to modifyitem- 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 aItemLiketo a specificCreativeModeTab. Should be called in your mod's initialization stage.- Parameters:
tab- the tab you want to modifyitemLike- 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 aListofItemLikes to a specificCreativeModeTab. Should be called in your mod's initialization stage.- Parameters:
tab- the tab you want to modifyitems- 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 aListofItemStacks to a specificCreativeModeTab. Should be called in your mod's initialization stage.- Parameters:
tab- the tab you want to modifyitems- 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 aListofItemLikes to multipleCreativeModeTabs. Should be called in your mod's initialization stage.- Parameters:
tabs- the list of tabs that you want to modifyitems- 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 aListofItemStacks to multipleCreativeModeTabs. Should be called in your mod's initialization stage.- Parameters:
tabs- the list of tabs that you want to modifyitems- 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 asound event. -
createBlockTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> createBlockTag(net.minecraft.resources.Identifier id) Registers ablocktag. -
createBlockAndItemTag
public static net.minecraft.tags.BlockItemTagId createBlockAndItemTag(net.minecraft.resources.Identifier id) Registers aBlockItemTagIdtag. -
createItemTag
public static net.minecraft.tags.TagKey<net.minecraft.world.item.Item> createItemTag(net.minecraft.resources.Identifier id) Registers aitemtag. -
createPotionTag
public static net.minecraft.tags.TagKey<net.minecraft.world.item.alchemy.Potion> createPotionTag(net.minecraft.resources.Identifier id) Registers apotiontag. -
createEnchantmentTag
public static net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> createEnchantmentTag(net.minecraft.resources.Identifier id) Registers aenchantmenttag. -
createFluidTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> createFluidTag(net.minecraft.resources.Identifier id) Registers afluidtag. -
createStructureTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.Structure> createStructureTag(net.minecraft.resources.Identifier id) Registers astructuretag. -
createStructureSetTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.StructureSet> createStructureSetTag(net.minecraft.resources.Identifier id) Registers astructure settag. -
createTemplatePoolTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool> createTemplatePoolTag(net.minecraft.resources.Identifier id) Registers atemplate pooltag. -
createConfiguredFeatureTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.feature.ConfiguredFeature<?,?>> createConfiguredFeatureTag(net.minecraft.resources.Identifier id) Registers aconfigured featuretag. -
createPlacedFeatureTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.levelgen.placement.PlacedFeature> createPlacedFeatureTag(net.minecraft.resources.Identifier id) Registers aplaced featuretag. -
createBiomeTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome> createBiomeTag(net.minecraft.resources.Identifier id) Registers abiometag. -
createDimensionTypeTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.dimension.DimensionType> createDimensionTypeTag(net.minecraft.resources.Identifier id) Registers adimension typetag. -
createDimensionTag
public static net.minecraft.tags.TagKey<net.minecraft.world.level.Level> createDimensionTag(net.minecraft.resources.Identifier id) Registers adimensiontag. -
createVillagerTradeTag
public static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.VillagerTrade> createVillagerTradeTag(net.minecraft.resources.Identifier id) Registers avillager tradetag. -
createTradeSetTag
public static net.minecraft.tags.TagKey<net.minecraft.world.item.trading.TradeSet> createTradeSetTag(net.minecraft.resources.Identifier id) Registers atrade settag. -
createAttributeTag
public static net.minecraft.tags.TagKey<net.minecraft.world.entity.ai.attributes.Attribute> createAttributeTag(net.minecraft.resources.Identifier id) Registers aattributetag. -
createDamageTypeTag
public static net.minecraft.tags.TagKey<net.minecraft.world.damagesource.DamageType> createDamageTypeTag(net.minecraft.resources.Identifier id) Registers adamage typetag. -
createEntityTypeTag
public static net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> createEntityTypeTag(net.minecraft.resources.Identifier id) Registers aentity typetag. -
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 anyTagKeyobject ofRegistries. -
i_
public static void i_()Initializes this class.
-