[Changes] Updated Recipe Categories

This commit is contained in:
Frank 2023-04-12 18:31:20 +02:00
parent 939df8fdb2
commit 4b3b30d21e
4 changed files with 54 additions and 53 deletions

View file

@ -10,6 +10,7 @@ import org.betterx.worlds.together.tag.v3.CommonItemTags;
import org.betterx.worlds.together.tag.v3.CommonPoiTags;
import org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
@ -268,175 +269,176 @@ public class WoodenComplexMaterial extends ComplexMaterial {
Block log = getBlock(BLOCK_LOG);
Block bark = getBlock(BLOCK_BARK);
BCLRecipeBuilder.crafting(id, planks)
.checkConfig(config)
.setOutputCount(4)
.shapeless()
.addMaterial('#', log, bark, log_stripped, bark_stripped)
.setGroup(receipGroupPrefix + "_planks")
.setGroup("planks")
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("stairs", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_STAIRS))
.checkConfig(config)
.setOutputCount(4)
.setShape("# ", "## ", "###")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_planks_stairs")
.setGroup("stairs")
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("slab", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_SLAB))
.checkConfig(config)
.setOutputCount(6)
.setShape("###")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_planks_slabs")
.setGroup("slab")
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("fence", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_FENCE))
.checkConfig(config)
.setOutputCount(3)
.setShape("#I#", "#I#")
.addMaterial('#', planks)
.addMaterial('I', Items.STICK)
.setGroup(receipGroupPrefix + "_planks_fences")
.setGroup("fence")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
addRecipeEntry(new RecipeEntry("gate", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_GATE))
.checkConfig(config)
.setShape("I#I", "I#I")
.addMaterial('#', planks)
.addMaterial('I', Items.STICK)
.setGroup(receipGroupPrefix + "_planks_gates")
.setGroup("gate")
.setCategory(RecipeCategory.REDSTONE)
.build();
}));
addRecipeEntry(new RecipeEntry("button", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_BUTTON))
.checkConfig(config)
.shapeless()
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_planks_buttons")
.setGroup("button")
.setCategory(RecipeCategory.REDSTONE)
.build();
}));
addRecipeEntry(new RecipeEntry("pressure_plate", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_PRESSURE_PLATE))
.checkConfig(config)
.setShape("##")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_planks_plates")
.setGroup("pressure_plate")
.setCategory(RecipeCategory.REDSTONE)
.build();
}));
addRecipeEntry(new RecipeEntry("trapdoor", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_TRAPDOOR))
.checkConfig(config)
.setOutputCount(2)
.setShape("###", "###")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_trapdoors")
.setGroup("trapdoor")
.setCategory(RecipeCategory.REDSTONE)
.build();
}));
addRecipeEntry(new RecipeEntry("door", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_DOOR))
.checkConfig(config)
.setOutputCount(3)
.setShape("##", "##", "##")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_doors")
.setGroup("door")
.setCategory(RecipeCategory.REDSTONE)
.build();
}));
addRecipeEntry(new RecipeEntry("crafting_table", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_CRAFTING_TABLE))
.checkConfig(config)
.setShape("##", "##")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_tables")
.setGroup("table")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
addRecipeEntry(new RecipeEntry("ladder", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_LADDER))
.checkConfig(config)
.setOutputCount(3)
.setShape("I I", "I#I", "I I")
.addMaterial('#', planks)
.addMaterial('I', Items.STICK)
.setGroup(receipGroupPrefix + "_ladders")
.setGroup("ladder")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
addRecipeEntry(new RecipeEntry("sign", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_SIGN))
.checkConfig(config)
.setOutputCount(3)
.setShape("###", "###", " I ")
.addMaterial('#', planks)
.addMaterial('I', Items.STICK)
.setGroup(receipGroupPrefix + "_signs")
.setGroup("sign")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
addRecipeEntry(new RecipeEntry("chest", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_CHEST))
.checkConfig(config)
.setShape("###", "# #", "###")
.addMaterial('#', planks)
.setGroup(receipGroupPrefix + "_chests")
.setGroup("chest")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
addRecipeEntry(new RecipeEntry("barrel", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_BARREL))
.checkConfig(config)
.setShape("#S#", "# #", "#S#")
.addMaterial('#', planks)
.addMaterial('S', getBlock(BLOCK_SLAB))
.setGroup(receipGroupPrefix + "_barrels")
.setGroup("barrel")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
addRecipeEntry(new RecipeEntry("bookshelf", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_BOOKSHELF))
.checkConfig(config)
.setShape("###", "PPP", "###")
.addMaterial('#', planks)
.addMaterial('P', Items.BOOK)
.setGroup(receipGroupPrefix + "_bookshelves")
.setGroup("bookshelf")
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("bark", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_BARK))
.checkConfig(config)
.setShape("##", "##")
.addMaterial('#', getBlock(BLOCK_LOG))
.setOutputCount(3)
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("log", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_LOG))
.checkConfig(config)
.setShape("##", "##")
.addMaterial('#', getBlock(BLOCK_BARK))
.setOutputCount(3)
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("stripped_bark", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_STRIPPED_BARK))
.checkConfig(config)
.setShape("##", "##")
.addMaterial('#', getBlock(BLOCK_STRIPPED_LOG))
.setOutputCount(3)
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("stripped_log", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_STRIPPED_LOG))
.checkConfig(config)
.setShape("##", "##")
.addMaterial('#', getBlock(BLOCK_STRIPPED_BARK))
.setOutputCount(3)
.setCategory(RecipeCategory.BUILDING_BLOCKS)
.build();
}));
addRecipeEntry(new RecipeEntry("composter", (material, config, id) -> {
BCLRecipeBuilder.crafting(id, getBlock(BLOCK_COMPOSTER))
.checkConfig(config)
.setShape("# #", "# #", "###")
.addMaterial('#', getBlock(BLOCK_SLAB))
.setGroup("composter")
.setCategory(RecipeCategory.DECORATIONS)
.build();
}));
}

View file

@ -5,6 +5,7 @@ import org.betterx.bclib.recipes.BCLRecipeBuilder;
import org.betterx.bclib.recipes.CraftingRecipeBuilder;
import org.betterx.bclib.registry.ItemRegistry;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.*;
@ -36,7 +37,8 @@ public class EquipmentDescription<I extends Item> {
final ItemLike ingot = repairItems[0].getItem();
var builder = BCLRecipeBuilder.crafting(id, tool)
.addMaterial('#', ingot);
.addMaterial('#', ingot)
.setCategory(RecipeCategory.TOOLS);
if (buildRecipe(tool, stick, builder)) return;
builder

View file

@ -1,7 +1,6 @@
package org.betterx.bclib.recipes;
import org.betterx.bclib.BCLib;
import org.betterx.bclib.config.PathConfig;
import net.minecraft.advancements.CriterionTriggerInstance;
import net.minecraft.data.recipes.FinishedRecipe;
@ -158,6 +157,7 @@ public class CraftingRecipeBuilder extends AbstractBaseRecipeBuilder<CraftingRec
}
builder.group(group);
builder.save(cc, id);
}
@ -215,11 +215,8 @@ public class CraftingRecipeBuilder extends AbstractBaseRecipeBuilder<CraftingRec
builder.pattern(row);
}
builder.group(group);
builder.showNotification(showNotification);
builder.save(cc, id);
}
public CraftingRecipeBuilder checkConfig(PathConfig config) {
return this;
}
}

View file

@ -1,9 +1,9 @@
package org.betterx.bclib.recipes;
import org.betterx.bclib.BCLib;
import org.betterx.bclib.config.Configs;
import org.betterx.worlds.together.tag.v3.CommonItemTags;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Blocks;
@ -14,18 +14,18 @@ public class CraftingRecipes {
.setShape("II", "##", "##")
.addMaterial('#', ItemTags.PLANKS)
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.DECORATIONS)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_cauldron"), Blocks.CAULDRON)
.setShape("I I", "I I", "III")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.BREWING)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_hopper"), Blocks.HOPPER)
.setShape("I I", "ICI", " I ")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.addMaterial('C', CommonItemTags.CHEST)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.REDSTONE)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_piston"), Blocks.PISTON)
.setShape("WWW", "CIC", "CDC")
@ -33,49 +33,49 @@ public class CraftingRecipes {
.addMaterial('D', Items.REDSTONE)
.addMaterial('C', Items.COBBLESTONE)
.addMaterial('W', ItemTags.PLANKS)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.REDSTONE)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_rail"), Blocks.RAIL)
.setOutputCount(16)
.setShape("I I", "ISI", "I I")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.addMaterial('S', Items.STICK)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.TRANSPORTATION)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_stonecutter"), Blocks.STONECUTTER)
.setShape(" I ", "SSS")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.addMaterial('S', Items.STONE)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.DECORATIONS)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_compass"), Items.COMPASS)
.setShape(" I ", "IDI", " I ")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.addMaterial('D', Items.REDSTONE)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.TOOLS)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_bucket"), Items.BUCKET)
.setShape("I I", " I ")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.MISC)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_minecart"), Items.MINECART)
.setShape("I I", "III")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.TRANSPORTATION)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_shield"), Items.SHIELD)
.setShape("WIW", "WWW", " W ")
.addMaterial('I', CommonItemTags.IRON_INGOTS)
.addMaterial('W', ItemTags.PLANKS)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.COMBAT)
.build();
BCLRecipeBuilder.crafting(BCLib.makeID("tag_shulker_box"), Blocks.SHULKER_BOX)
.setShape("S", "C", "S")
.addMaterial('S', Items.SHULKER_SHELL)
.addMaterial('C', CommonItemTags.CHEST)
.checkConfig(Configs.RECIPE_CONFIG)
.setCategory(RecipeCategory.DECORATIONS)
.build();
}
}