package com.simibubi.create; import static com.simibubi.create.AllTags.forgeItemTag; import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS; import static com.simibubi.create.AllTags.AllItemTags.CRUSHED_RAW_MATERIALS; import static com.simibubi.create.AllTags.AllItemTags.PLATES; import static com.simibubi.create.Create.REGISTRATE; import static com.simibubi.create.foundation.data.recipe.CompatMetals.ALUMINUM; import static com.simibubi.create.foundation.data.recipe.CompatMetals.LEAD; import static com.simibubi.create.foundation.data.recipe.CompatMetals.NICKEL; import static com.simibubi.create.foundation.data.recipe.CompatMetals.OSMIUM; import static com.simibubi.create.foundation.data.recipe.CompatMetals.PLATINUM; import static com.simibubi.create.foundation.data.recipe.CompatMetals.QUICKSILVER; import static com.simibubi.create.foundation.data.recipe.CompatMetals.SILVER; import static com.simibubi.create.foundation.data.recipe.CompatMetals.TIN; import static com.simibubi.create.foundation.data.recipe.CompatMetals.URANIUM; import com.simibubi.create.AllTags.AllItemTags; import com.simibubi.create.content.contraptions.glue.SuperGlueItem; import com.simibubi.create.content.contraptions.minecart.MinecartCouplingItem; import com.simibubi.create.content.contraptions.mounted.MinecartContraptionItem; import com.simibubi.create.content.equipment.BuildersTeaItem; import com.simibubi.create.content.equipment.TreeFertilizerItem; import com.simibubi.create.content.equipment.armor.AllArmorMaterials; import com.simibubi.create.content.equipment.armor.BacktankItem; import com.simibubi.create.content.equipment.armor.BacktankItem.BacktankBlockItem; import com.simibubi.create.content.equipment.armor.DivingBootsItem; import com.simibubi.create.content.equipment.armor.DivingHelmetItem; import com.simibubi.create.content.equipment.blueprint.BlueprintItem; import com.simibubi.create.content.equipment.extendoGrip.ExtendoGripItem; import com.simibubi.create.content.equipment.goggles.GogglesItem; import com.simibubi.create.content.equipment.goggles.GogglesModel; import com.simibubi.create.content.equipment.potatoCannon.PotatoCannonItem; import com.simibubi.create.content.equipment.sandPaper.SandPaperItem; import com.simibubi.create.content.equipment.symmetryWand.SymmetryWandItem; import com.simibubi.create.content.equipment.wrench.WrenchItem; import com.simibubi.create.content.equipment.zapper.terrainzapper.WorldshaperItem; import com.simibubi.create.content.kinetics.belt.item.BeltConnectorItem; import com.simibubi.create.content.kinetics.gearbox.VerticalGearboxItem; import com.simibubi.create.content.legacy.ChromaticCompoundColor; import com.simibubi.create.content.legacy.ChromaticCompoundItem; import com.simibubi.create.content.legacy.RefinedRadianceItem; import com.simibubi.create.content.legacy.ShadowSteelItem; import com.simibubi.create.content.logistics.filter.FilterItem; import com.simibubi.create.content.materials.ExperienceNuggetItem; import com.simibubi.create.content.processing.burner.BlazeBurnerBlockItem; import com.simibubi.create.content.processing.sequenced.SequencedAssemblyItem; import com.simibubi.create.content.redstone.link.controller.LinkedControllerItem; import com.simibubi.create.content.schematics.SchematicAndQuillItem; import com.simibubi.create.content.schematics.SchematicItem; import com.simibubi.create.content.trains.schedule.ScheduleItem; import com.simibubi.create.foundation.data.AssetLookup; import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.data.recipe.CompatMetals; import com.simibubi.create.foundation.item.CombustibleItem; import com.simibubi.create.foundation.item.HiddenIngredientItem; import com.simibubi.create.foundation.item.ItemDescription; import com.simibubi.create.foundation.item.TagDependentIngredientItem; import com.tterrag.registrate.util.entry.ItemEntry; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.ArmorMaterials; import net.minecraft.world.item.Item; import net.minecraft.world.item.Rarity; import net.minecraftforge.common.Tags; public class AllItems { static { REGISTRATE.creativeModeTab(() -> AllCreativeModeTabs.BASE_CREATIVE_TAB); } public static final ItemEntry WHEAT_FLOUR = taggedIngredient("wheat_flour", forgeItemTag("flour/wheat"), forgeItemTag("flour")), DOUGH = taggedIngredient("dough", forgeItemTag("dough"), forgeItemTag("dough/wheat")), CINDER_FLOUR = ingredient("cinder_flour"), ROSE_QUARTZ = ingredient("rose_quartz"), POLISHED_ROSE_QUARTZ = ingredient("polished_rose_quartz"), POWDERED_OBSIDIAN = ingredient("powdered_obsidian"), STURDY_SHEET = taggedIngredient("sturdy_sheet", forgeItemTag("plates/obsidian"), PLATES.tag), PROPELLER = ingredient("propeller"), WHISK = ingredient("whisk"), BRASS_HAND = ingredient("brass_hand"), CRAFTER_SLOT_COVER = ingredient("crafter_slot_cover"), ELECTRON_TUBE = ingredient("electron_tube"); public static final ItemEntry INCOMPLETE_PRECISION_MECHANISM = sequencedIngredient("incomplete_precision_mechanism"), INCOMPLETE_REINFORCED_SHEET = sequencedIngredient("unprocessed_obsidian_sheet"), INCOMPLETE_TRACK = sequencedIngredient("incomplete_track"); public static final ItemEntry PRECISION_MECHANISM = ingredient("precision_mechanism"); public static final ItemEntry BLAZE_CAKE_BASE = REGISTRATE.item("blaze_cake_base", HiddenIngredientItem::new) .tag(AllItemTags.UPRIGHT_ON_BELT.tag) .register(); public static final ItemEntry BLAZE_CAKE = REGISTRATE.item("blaze_cake", CombustibleItem::new) .tag(AllItemTags.BLAZE_BURNER_FUEL_SPECIAL.tag, AllItemTags.UPRIGHT_ON_BELT.tag) .onRegister(i -> i.setBurnTime(6400)) .register(); public static final ItemEntry CREATIVE_BLAZE_CAKE = REGISTRATE.item("creative_blaze_cake", CombustibleItem::new) .properties(p -> p.rarity(Rarity.EPIC)) .tag(AllItemTags.UPRIGHT_ON_BELT.tag) .onRegister(i -> i.setBurnTime(Integer.MAX_VALUE)) .register(); public static final ItemEntry BAR_OF_CHOCOLATE = REGISTRATE.item("bar_of_chocolate", Item::new) .properties(p -> p.food(new FoodProperties.Builder().nutrition(6) .saturationMod(0.3F) .build())) .lang("Bar of Chocolate") .register(); public static final ItemEntry SWEET_ROLL = REGISTRATE.item("sweet_roll", Item::new) .properties(p -> p.food(new FoodProperties.Builder().nutrition(6) .saturationMod(0.8F) .build())) .register(); public static final ItemEntry CHOCOLATE_BERRIES = REGISTRATE.item("chocolate_glazed_berries", Item::new) .properties(p -> p.food(new FoodProperties.Builder().nutrition(7) .saturationMod(0.8F) .build())) .register(); public static final ItemEntry HONEYED_APPLE = REGISTRATE.item("honeyed_apple", Item::new) .properties(p -> p.food(new FoodProperties.Builder().nutrition(8) .saturationMod(0.8F) .build())) .register(); public static final ItemEntry BUILDERS_TEA = REGISTRATE.item("builders_tea", BuildersTeaItem::new) .tag(AllItemTags.UPRIGHT_ON_BELT.tag) .properties(p -> p.stacksTo(16)) .lang("Builder's Tea") .register(); public static final ItemEntry RAW_ZINC = taggedIngredient("raw_zinc", forgeItemTag("raw_materials/zinc"), forgeItemTag("raw_materials")); public static final ItemEntry ANDESITE_ALLOY = taggedIngredient("andesite_alloy", CREATE_INGOTS.tag), ZINC_INGOT = taggedIngredient("zinc_ingot", forgeItemTag("ingots/zinc"), CREATE_INGOTS.tag), BRASS_INGOT = taggedIngredient("brass_ingot", forgeItemTag("ingots/brass"), CREATE_INGOTS.tag); public static final ItemEntry CHROMATIC_COMPOUND = REGISTRATE.item("chromatic_compound", ChromaticCompoundItem::new) .properties(p -> p.rarity(Rarity.UNCOMMON)) .model(AssetLookup.existingItemModel()) .color(() -> ChromaticCompoundColor::new) .register(); public static final ItemEntry SHADOW_STEEL = REGISTRATE.item("shadow_steel", ShadowSteelItem::new) .properties(p -> p.rarity(Rarity.UNCOMMON)) .register(); public static final ItemEntry REFINED_RADIANCE = REGISTRATE.item("refined_radiance", RefinedRadianceItem::new) .properties(p -> p.rarity(Rarity.UNCOMMON)) .register(); public static final ItemEntry COPPER_NUGGET = taggedIngredient("copper_nugget", forgeItemTag("nuggets/copper"), Tags.Items.NUGGETS), ZINC_NUGGET = taggedIngredient("zinc_nugget", forgeItemTag("nuggets/zinc"), Tags.Items.NUGGETS), BRASS_NUGGET = taggedIngredient("brass_nugget", forgeItemTag("nuggets/brass"), Tags.Items.NUGGETS); public static final ItemEntry EXP_NUGGET = REGISTRATE.item("experience_nugget", ExperienceNuggetItem::new) .tag(Tags.Items.NUGGETS) .properties(p -> p.rarity(Rarity.UNCOMMON)) .lang("Nugget of Experience") .register(); public static final ItemEntry COPPER_SHEET = taggedIngredient("copper_sheet", forgeItemTag("plates/copper"), PLATES.tag), BRASS_SHEET = taggedIngredient("brass_sheet", forgeItemTag("plates/brass"), PLATES.tag), IRON_SHEET = taggedIngredient("iron_sheet", forgeItemTag("plates/iron"), PLATES.tag), GOLDEN_SHEET = taggedIngredient("golden_sheet", forgeItemTag("plates/gold"), PLATES.tag, ItemTags.PIGLIN_LOVED), CRUSHED_IRON = taggedIngredient("crushed_raw_iron", CRUSHED_RAW_MATERIALS.tag), CRUSHED_GOLD = taggedIngredient("crushed_raw_gold", CRUSHED_RAW_MATERIALS.tag, ItemTags.PIGLIN_LOVED), CRUSHED_COPPER = taggedIngredient("crushed_raw_copper", CRUSHED_RAW_MATERIALS.tag), CRUSHED_ZINC = taggedIngredient("crushed_raw_zinc", CRUSHED_RAW_MATERIALS.tag); public static final ItemEntry CRUSHED_OSMIUM = compatCrushedOre(OSMIUM), CRUSHED_PLATINUM = compatCrushedOre(PLATINUM), CRUSHED_SILVER = compatCrushedOre(SILVER), CRUSHED_TIN = compatCrushedOre(TIN), CRUSHED_LEAD = compatCrushedOre(LEAD), CRUSHED_QUICKSILVER = compatCrushedOre(QUICKSILVER), CRUSHED_BAUXITE = compatCrushedOre(ALUMINUM), CRUSHED_URANIUM = compatCrushedOre(URANIUM), CRUSHED_NICKEL = compatCrushedOre(NICKEL); // Kinetics public static final ItemEntry BELT_CONNECTOR = REGISTRATE.item("belt_connector", BeltConnectorItem::new) .lang("Mechanical Belt") .register(); public static final ItemEntry VERTICAL_GEARBOX = REGISTRATE.item("vertical_gearbox", VerticalGearboxItem::new) .model(AssetLookup.customBlockItemModel("gearbox", "item_vertical")) .register(); public static final ItemEntry EMPTY_BLAZE_BURNER = REGISTRATE.item("empty_blaze_burner", BlazeBurnerBlockItem::empty) .model(AssetLookup.customBlockItemModel("blaze_burner", "block")) .register(); public static final ItemEntry GOGGLES = REGISTRATE.item("goggles", GogglesItem::new) .properties(p -> p.stacksTo(1)) .onRegister(CreateRegistrate.itemModel(() -> GogglesModel::new)) .lang("Engineer's Goggles") .register(); public static final ItemEntry SUPER_GLUE = REGISTRATE.item("super_glue", SuperGlueItem::new) .properties(p -> p.stacksTo(1) .durability(99)) .register(); public static final ItemEntry MINECART_COUPLING = REGISTRATE.item("minecart_coupling", MinecartCouplingItem::new) .register(); public static final ItemEntry CRAFTING_BLUEPRINT = REGISTRATE.item("crafting_blueprint", BlueprintItem::new) .register(); // wrapped by COPPER_BACKTANK for block placement uses. // must be registered as of 1.18.2 public static final ItemEntry COPPER_BACKTANK_PLACEABLE = REGISTRATE .item("copper_backtank_placeable", p -> new BacktankBlockItem(AllBlocks.COPPER_BACKTANK.get(), AllItems.COPPER_BACKTANK::get, p)) .model((c, p) -> p.withExistingParent(c.getName(), p.mcLoc("item/barrier"))) .register(); // wrapped by NETHERITE_BACKTANK for block placement uses. // must be registered as of 1.18.2 public static final ItemEntry NETHERITE_BACKTANK_PLACEABLE = REGISTRATE .item("netherite_backtank_placeable", p -> new BacktankBlockItem(AllBlocks.NETHERITE_BACKTANK.get(), AllItems.NETHERITE_BACKTANK::get, p)) .model((c, p) -> p.withExistingParent(c.getName(), p.mcLoc("item/barrier"))) .register(); public static final ItemEntry COPPER_BACKTANK = REGISTRATE .item("copper_backtank", p -> new BacktankItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving"), COPPER_BACKTANK_PLACEABLE)) .model(AssetLookup.customGenericItemModel("_", "item")) .tag(AllItemTags.PRESSURIZED_AIR_SOURCES.tag) .tag(forgeItemTag("armors/chestplates")) .register(), NETHERITE_BACKTANK = REGISTRATE .item("netherite_backtank", p -> new BacktankItem.Layered(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving"), NETHERITE_BACKTANK_PLACEABLE)) .model(AssetLookup.customGenericItemModel("_", "item")) .properties(p -> p.fireResistant()) .tag(AllItemTags.PRESSURIZED_AIR_SOURCES.tag) .tag(forgeItemTag("armors/chestplates")) .register(); public static final ItemEntry COPPER_DIVING_HELMET = REGISTRATE .item("copper_diving_helmet", p -> new DivingHelmetItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving"))) .tag(forgeItemTag("armors/helmets")) .register(), NETHERITE_DIVING_HELMET = REGISTRATE .item("netherite_diving_helmet", p -> new DivingHelmetItem(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving"))) .properties(p -> p.fireResistant()) .tag(forgeItemTag("armors/helmets")) .register(); public static final ItemEntry COPPER_DIVING_BOOTS = REGISTRATE .item("copper_diving_boots", p -> new DivingBootsItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving"))) .tag(forgeItemTag("armors/boots")) .register(), NETHERITE_DIVING_BOOTS = REGISTRATE .item("netherite_diving_boots", p -> new DivingBootsItem(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving"))) .properties(p -> p.fireResistant()) .tag(forgeItemTag("armors/boots")) .register(); public static final ItemEntry SAND_PAPER = REGISTRATE.item("sand_paper", SandPaperItem::new) .tag(AllTags.AllItemTags.SANDPAPER.tag) .register(); public static final ItemEntry RED_SAND_PAPER = REGISTRATE.item("red_sand_paper", SandPaperItem::new) .tag(AllTags.AllItemTags.SANDPAPER.tag) .onRegister(s -> ItemDescription.referKey(s, SAND_PAPER)) .register(); public static final ItemEntry WRENCH = REGISTRATE.item("wrench", WrenchItem::new) .properties(p -> p.stacksTo(1)) .model(AssetLookup.itemModelWithPartials()) .tag(AllItemTags.WRENCH.tag) .register(); public static final ItemEntry MINECART_CONTRAPTION = REGISTRATE.item("minecart_contraption", MinecartContraptionItem::rideable) .register(); public static final ItemEntry FURNACE_MINECART_CONTRAPTION = REGISTRATE.item("furnace_minecart_contraption", MinecartContraptionItem::furnace) .register(); public static final ItemEntry CHEST_MINECART_CONTRAPTION = REGISTRATE.item("chest_minecart_contraption", MinecartContraptionItem::chest) .register(); // Curiosities public static final ItemEntry LINKED_CONTROLLER = REGISTRATE.item("linked_controller", LinkedControllerItem::new) .properties(p -> p.stacksTo(1)) .model(AssetLookup.itemModelWithPartials()) .register(); public static final ItemEntry POTATO_CANNON = REGISTRATE.item("potato_cannon", PotatoCannonItem::new) .model(AssetLookup.itemModelWithPartials()) .register(); public static final ItemEntry EXTENDO_GRIP = REGISTRATE.item("extendo_grip", ExtendoGripItem::new) .properties(p -> p.rarity(Rarity.UNCOMMON)) .model(AssetLookup.itemModelWithPartials()) .register(); public static final ItemEntry WAND_OF_SYMMETRY = REGISTRATE.item("wand_of_symmetry", SymmetryWandItem::new) .properties(p -> p.stacksTo(1) .rarity(Rarity.UNCOMMON)) .model(AssetLookup.itemModelWithPartials()) .register(); public static final ItemEntry WORLDSHAPER = REGISTRATE.item("handheld_worldshaper", WorldshaperItem::new) .properties(p -> p.rarity(Rarity.EPIC)) .lang("Creative Worldshaper") .model(AssetLookup.itemModelWithPartials()) .register(); public static final ItemEntry TREE_FERTILIZER = REGISTRATE.item("tree_fertilizer", TreeFertilizerItem::new) .register(); // Logistics public static final ItemEntry FILTER = REGISTRATE.item("filter", FilterItem::regular) .lang("List Filter") .register(), ATTRIBUTE_FILTER = REGISTRATE.item("attribute_filter", FilterItem::attribute) .register(); public static final ItemEntry SCHEDULE = REGISTRATE.item("schedule", ScheduleItem::new) .lang("Train Schedule") .register(); // Schematics public static final ItemEntry EMPTY_SCHEMATIC = REGISTRATE.item("empty_schematic", Item::new) .properties(p -> p.stacksTo(1)) .register(); public static final ItemEntry SCHEMATIC_AND_QUILL = REGISTRATE.item("schematic_and_quill", SchematicAndQuillItem::new) .properties(p -> p.stacksTo(1)) .register(); public static final ItemEntry SCHEMATIC = REGISTRATE.item("schematic", SchematicItem::new) .properties(p -> p.stacksTo(1)) .register(); // Shortcuts private static ItemEntry ingredient(String name) { return REGISTRATE.item(name, Item::new) .register(); } private static ItemEntry sequencedIngredient(String name) { return REGISTRATE.item(name, SequencedAssemblyItem::new) .register(); } // private static ItemEntry hiddenIngredient(String name) { // return REGISTRATE.item(name, HiddenIngredientItem::new) // .register(); // } @SafeVarargs private static ItemEntry taggedIngredient(String name, TagKey... tags) { return REGISTRATE.item(name, Item::new) .tag(tags) .register(); } private static ItemEntry compatCrushedOre(CompatMetals metal) { String metalName = metal.getName(); return REGISTRATE .item("crushed_raw_" + metalName, props -> new TagDependentIngredientItem(props, AllTags.forgeItemTag("ores/" + metalName))) .tag(CRUSHED_RAW_MATERIALS.tag) .register(); } // Load this class public static void register() {} }