Grid recipes migration

This commit is contained in:
paulevsGitch 2021-06-17 20:30:39 +03:00
parent 2b033a2ef7
commit d81abe86ef
7 changed files with 291 additions and 366 deletions

View file

@ -12,8 +12,10 @@ import net.minecraft.world.item.DyeItem;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.recipes.GridRecipe;
import ru.bclib.util.BlocksHelper;
import ru.betterend.recipe.builders.GridRecipe;
import ru.betterend.BetterEnd;
import ru.betterend.config.Configs;
import ru.betterend.registry.EndBlocks;
public class ColoredMaterial {
@ -32,10 +34,10 @@ public class ColoredMaterial {
Block block = constructor.apply(FabricBlockSettings.copyOf(source).materialColor(MaterialColor.COLOR_BLACK));
EndBlocks.registerBlock(blockName, block);
if (craftEight) {
GridRecipe.make(blockName, block).setOutputCount(8).setShape("###", "#D#", "###").addMaterial('#', source).addMaterial('D', dyes.get(color)).build();
GridRecipe.make(BetterEnd.MOD_ID, blockName, block).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(8).setShape("###", "#D#", "###").addMaterial('#', source).addMaterial('D', dyes.get(color)).build();
}
else {
GridRecipe.make(blockName, block).setList("#D").addMaterial('#', source).addMaterial('D', dyes.get(color)).build();
GridRecipe.make(BetterEnd.MOD_ID, blockName, block).checkConfig(Configs.RECIPE_CONFIG).setList("#D").addMaterial('#', source).addMaterial('D', dyes.get(color)).build();
}
this.colors.put(color, block);
BlocksHelper.addBlockColor(block, color);

View file

@ -9,10 +9,12 @@ import ru.bclib.blocks.BaseRotatedPillarBlock;
import ru.bclib.blocks.BaseSlabBlock;
import ru.bclib.blocks.BaseStairsBlock;
import ru.bclib.blocks.BaseWallBlock;
import ru.bclib.recipes.GridRecipe;
import ru.bclib.util.TagHelper;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.EndPedestal;
import ru.betterend.config.Configs;
import ru.betterend.recipe.CraftingRecipes;
import ru.betterend.recipe.builders.GridRecipe;
import ru.betterend.registry.EndBlocks;
public class CrystalSubblocksMaterial {
@ -43,18 +45,18 @@ public class CrystalSubblocksMaterial {
brick_wall = EndBlocks.registerBlock(name + "_bricks_wall", new BaseWallBlock(bricks));
// Recipes //
GridRecipe.make(name + "_bricks", bricks).setOutputCount(4).setShape("##", "##").addMaterial('#', source).setGroup("end_bricks").build();
GridRecipe.make(name + "_polished", polished).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build();
GridRecipe.make(name + "_tiles", tiles).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build();
GridRecipe.make(name + "_pillar", pillar).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', source).setGroup("end_bricks").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar).checkConfig(Configs.RECIPE_CONFIG).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build();
GridRecipe.make(name + "_stairs", stairs).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', source).setGroup("end_stone_stairs").build();
GridRecipe.make(name + "_slab", slab).setOutputCount(6).setShape("###").addMaterial('#', source).setGroup("end_stone_slabs").build();
GridRecipe.make(name + "_bricks_stairs", brick_stairs).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build();
GridRecipe.make(name + "_bricks_slab", brick_slab).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', source).setGroup("end_stone_stairs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', source).setGroup("end_stone_slabs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brick_stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brick_slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build();
GridRecipe.make(name + "_wall", wall).setOutputCount(6).setShape("###", "###").addMaterial('#', source).setGroup("end_wall").build();
GridRecipe.make(name + "_bricks_wall", brick_wall).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', source).setGroup("end_wall").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brick_wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build();
CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar);

View file

@ -28,18 +28,20 @@ import ru.bclib.items.tool.BaseHoeItem;
import ru.bclib.items.tool.BasePickaxeItem;
import ru.bclib.items.tool.BaseShovelItem;
import ru.bclib.items.tool.BaseSwordItem;
import ru.bclib.recipes.GridRecipe;
import ru.bclib.util.TagHelper;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.BulbVineLanternBlock;
import ru.betterend.blocks.BulbVineLanternColoredBlock;
import ru.betterend.blocks.ChandelierBlock;
import ru.betterend.blocks.basis.EndAnvilBlock;
import ru.betterend.config.Configs;
import ru.betterend.item.EndAnvilItem;
import ru.betterend.item.EndArmorItem;
import ru.betterend.item.tool.EndHammerItem;
import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.recipe.builders.AnvilRecipe;
import ru.betterend.recipe.builders.FurnaceRecipe;
import ru.betterend.recipe.builders.GridRecipe;
import ru.betterend.recipe.builders.SmithingTableRecipe;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems;
@ -154,24 +156,24 @@ public class MetalMaterial {
}
// Basic recipes
GridRecipe.make(name + "_ingot_from_nuggets", ingot).setShape("###", "###", "###").addMaterial('#', nugget).setGroup("end_metal_ingots_nug").build();
GridRecipe.make(name + "_nuggets_from_ingot", nugget).setOutputCount(9).setList("#").addMaterial('#', ingot).setGroup("end_metal_nuggets_ing").build();
GridRecipe.make(name + "_block", block).setShape("###", "###", "###").addMaterial('#', ingot).setGroup("end_metal_blocks").build();
GridRecipe.make(name + "_ingot_from_block", ingot).setOutputCount(9).setList("#").addMaterial('#', block).setGroup("end_metal_ingots").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_nuggets", ingot).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', nugget).setGroup("end_metal_ingots_nug").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_nuggets_from_ingot", nugget).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', ingot).setGroup("end_metal_nuggets_ing").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_block", block).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', ingot).setGroup("end_metal_blocks").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_block", ingot).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', block).setGroup("end_metal_ingots").build();
// Block recipes
GridRecipe.make(name + "_tile", tile).setOutputCount(4).setShape("##", "##").addMaterial('#', block).setGroup("end_metal_tiles").build();
GridRecipe.make(name + "_bars", bars).setOutputCount(16).setShape("###", "###").addMaterial('#', ingot).setGroup("end_metal_bars").build();
GridRecipe.make(name + "_pressure_plate", pressurePlate).setShape("##").addMaterial('#', ingot).setGroup("end_metal_plates").build();
GridRecipe.make(name + "_door", door).setOutputCount(3).setShape("##", "##", "##").addMaterial('#', ingot).setGroup("end_metal_doors").build();
GridRecipe.make(name + "_trapdoor", trapdoor).setShape("##", "##").addMaterial('#', ingot).setGroup("end_metal_trapdoors").build();
GridRecipe.make(name + "_stairs", stairs).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', block, tile).setGroup("end_metal_stairs").build();
GridRecipe.make(name + "_slab", slab).setOutputCount(6).setShape("###").addMaterial('#', block, tile).setGroup("end_metal_slabs").build();
GridRecipe.make(name + "_chain", chain).setShape("N", "#", "N").addMaterial('#', ingot).addMaterial('N', nugget).setGroup("end_metal_chain").build();
GridRecipe.make(name + "_anvil", anvilBlock).setShape("###", " I ", "III").addMaterial('#', block, tile).addMaterial('I', ingot).setGroup("end_metal_anvil").build();
GridRecipe.make(name + "_bulb_lantern", bulb_lantern).setShape("C", "I", "#").addMaterial('C', chain).addMaterial('I', ingot).addMaterial('#', EndItems.GLOWING_BULB).build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_tile", tile).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', block).setGroup("end_metal_tiles").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bars", bars).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(16).setShape("###", "###").addMaterial('#', ingot).setGroup("end_metal_bars").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', ingot).setGroup("end_metal_plates").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("##", "##", "##").addMaterial('#', ingot).setGroup("end_metal_doors").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', ingot).setGroup("end_metal_trapdoors").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', block, tile).setGroup("end_metal_stairs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', block, tile).setGroup("end_metal_slabs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chain", chain).checkConfig(Configs.RECIPE_CONFIG).setShape("N", "#", "N").addMaterial('#', ingot).addMaterial('N', nugget).setGroup("end_metal_chain").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_anvil", anvilBlock).checkConfig(Configs.RECIPE_CONFIG).setShape("###", " I ", "III").addMaterial('#', block, tile).addMaterial('I', ingot).setGroup("end_metal_anvil").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bulb_lantern", bulb_lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("C", "I", "#").addMaterial('C', chain).addMaterial('I', ingot).addMaterial('#', EndItems.GLOWING_BULB).build();
GridRecipe.make(name + "_chandelier", chandelier).setShape("I#I", " # ").addMaterial('#', ingot).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chandelier", chandelier).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', ingot).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build();
// Tools & armor into nuggets
FurnaceRecipe.make(name + "_axe_nugget", axe, nugget).setGroup("end_nugget").buildWithBlasting();
@ -202,10 +204,10 @@ public class MetalMaterial {
SmithingTableRecipe.create(name + "_shovel").setResult(shovel).setBase(shovelHead).setAddition(Items.STICK).build();
// Armor crafting
GridRecipe.make(name + "_helmet", helmet).setShape("###", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_helmets").build();
GridRecipe.make(name + "_chestplate", chestplate).setShape("# #", "###", "###").addMaterial('#', forgedPlate).setGroup("end_metal_chestplates").build();
GridRecipe.make(name + "_leggings", leggings).setShape("###", "# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_leggings").build();
GridRecipe.make(name + "_boots", boots).setShape("# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_boots").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_helmet", helmet).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_helmets").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chestplate", chestplate).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "###", "###").addMaterial('#', forgedPlate).setGroup("end_metal_chestplates").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_leggings", leggings).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_leggings").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_boots", boots).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_boots").build();
TagHelper.addTag(BlockTags.ANVIL, anvilBlock);
TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, block);

View file

@ -15,11 +15,13 @@ import ru.bclib.blocks.BaseStairsBlock;
import ru.bclib.blocks.BaseStoneButtonBlock;
import ru.bclib.blocks.BaseWallBlock;
import ru.bclib.blocks.StonePressurePlateBlock;
import ru.bclib.recipes.GridRecipe;
import ru.bclib.util.TagHelper;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.EndPedestal;
import ru.betterend.blocks.basis.StoneLanternBlock;
import ru.betterend.config.Configs;
import ru.betterend.recipe.CraftingRecipes;
import ru.betterend.recipe.builders.GridRecipe;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems;
@ -65,23 +67,23 @@ public class StoneMaterial {
furnace = EndBlocks.registerBlock(name + "_furnace", new BaseFurnaceBlock(bricks));
// Recipes //
GridRecipe.make(name + "_bricks", bricks).setOutputCount(4).setShape("##", "##").addMaterial('#', stone).setGroup("end_bricks").build();
GridRecipe.make(name + "_polished", polished).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build();
GridRecipe.make(name + "_tiles", tiles).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build();
GridRecipe.make(name + "_pillar", pillar).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', stone).setGroup("end_bricks").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar).checkConfig(Configs.RECIPE_CONFIG).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build();
GridRecipe.make(name + "_stairs", stairs).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', stone).setGroup("end_stone_stairs").build();
GridRecipe.make(name + "_slab", slab).setOutputCount(6).setShape("###").addMaterial('#', stone).setGroup("end_stone_slabs").build();
GridRecipe.make(name + "_bricks_stairs", brick_stairs).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build();
GridRecipe.make(name + "_bricks_slab", brick_slab).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', stone).setGroup("end_stone_stairs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', stone).setGroup("end_stone_slabs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brick_stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brick_slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build();
GridRecipe.make(name + "_wall", wall).setOutputCount(6).setShape("###", "###").addMaterial('#', stone).setGroup("end_wall").build();
GridRecipe.make(name + "_bricks_wall", brick_wall).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', stone).setGroup("end_wall").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brick_wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build();
GridRecipe.make(name + "_button", button).setList("#").addMaterial('#', stone).setGroup("end_stone_buttons").build();
GridRecipe.make(name + "_pressure_plate", pressure_plate).setShape("##").addMaterial('#', stone).setGroup("end_stone_plates").build();
GridRecipe.make(name + "_lantern", lantern).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab, brick_slab).setGroup("end_stone_lanterns").build();
GridRecipe.make(name + "_furnace", furnace).setShape("###", "# #", "###").addMaterial('#', stone).setGroup("end_stone_furnaces").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', stone).setGroup("end_stone_buttons").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressure_plate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', stone).setGroup("end_stone_plates").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_lantern", lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab, brick_slab).setGroup("end_stone_lanterns").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_furnace", furnace).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', stone).setGroup("end_stone_furnaces").build();
CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar);

View file

@ -31,9 +31,10 @@ import ru.bclib.blocks.BaseTrapdoorBlock;
import ru.bclib.blocks.BaseWoodenButtonBlock;
import ru.bclib.blocks.StripableBarkBlock;
import ru.bclib.blocks.WoodenPressurePlateBlock;
import ru.bclib.recipes.GridRecipe;
import ru.bclib.util.TagHelper;
import ru.betterend.BetterEnd;
import ru.betterend.recipe.builders.GridRecipe;
import ru.betterend.config.Configs;
import ru.betterend.registry.EndBlocks;
public class WoodenMaterial {
@ -95,25 +96,25 @@ public class WoodenMaterial {
composter = EndBlocks.registerBlock(name + "_composter", new BaseComposterBlock(planks));
// Recipes //
GridRecipe.make(name + "_planks", planks).setOutputCount(4).setList("#").addMaterial('#', log, bark, log_stripped, bark_stripped).setGroup("end_planks").build();
GridRecipe.make(name + "_stairs", stairs).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', planks).setGroup("end_planks_stairs").build();
GridRecipe.make(name + "_slab", slab).setOutputCount(6).setShape("###").addMaterial('#', planks).setGroup("end_planks_slabs").build();
GridRecipe.make(name + "_fence", fence).setOutputCount(3).setShape("#I#", "#I#").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_planks_fences").build();
GridRecipe.make(name + "_gate", gate).setShape("I#I", "I#I").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_planks_gates").build();
GridRecipe.make(name + "_button", button).setList("#").addMaterial('#', planks).setGroup("end_planks_buttons").build();
GridRecipe.make(name + "_pressure_plate", pressurePlate).setShape("##").addMaterial('#', planks).setGroup("end_planks_plates").build();
GridRecipe.make(name + "_trapdoor", trapdoor).setOutputCount(2).setShape("###", "###").addMaterial('#', planks).setGroup("end_trapdoors").build();
GridRecipe.make(name + "_door", door).setOutputCount(3).setShape("##", "##", "##").addMaterial('#', planks).setGroup("end_doors").build();
GridRecipe.make(name + "_crafting_table", craftingTable).setShape("##", "##").addMaterial('#', planks).setGroup("end_tables").build();
GridRecipe.make(name + "_ladder", ladder).setOutputCount(3).setShape("I I", "I#I", "I I").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_ladders").build();
GridRecipe.make(name + "_sign", sign).setOutputCount(3).setShape("###", "###", " I ").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_signs").build();
GridRecipe.make(name + "_chest", chest).setShape("###", "# #", "###").addMaterial('#', planks).setGroup("end_chests").build();
GridRecipe.make(name + "_barrel", barrel).setShape("#S#", "# #", "#S#").addMaterial('#', planks).addMaterial('S', slab).setGroup("end_barrels").build();
GridRecipe.make(name + "_bookshelf", shelf).setShape("###", "PPP", "###").addMaterial('#', planks).addMaterial('P', Items.BOOK).setGroup("end_bookshelves").build();
GridRecipe.make(name + "_bark", bark).setShape("##", "##").addMaterial('#', log).setOutputCount(3).build();
GridRecipe.make(name + "_log", log).setShape("##", "##").addMaterial('#', bark).setOutputCount(3).build();
GridRecipe.make(name + "_composter", composter).setShape("# #", "# #", "###").addMaterial('#', slab).build();
GridRecipe.make(name + "_shulker", Items.SHULKER_BOX).setShape("S", "#", "S").addMaterial('S', Items.SHULKER_SHELL).addMaterial('#', chest).build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_planks", planks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', log, bark, log_stripped, bark_stripped).setGroup("end_planks").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', planks).setGroup("end_planks_stairs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', planks).setGroup("end_planks_slabs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_fence", fence).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("#I#", "#I#").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_planks_fences").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_gate", gate).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", "I#I").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_planks_gates").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', planks).setGroup("end_planks_buttons").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', planks).setGroup("end_planks_plates").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setShape("###", "###").addMaterial('#', planks).setGroup("end_trapdoors").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("##", "##", "##").addMaterial('#', planks).setGroup("end_doors").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_crafting_table", craftingTable).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', planks).setGroup("end_tables").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_ladder", ladder).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("I I", "I#I", "I I").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_ladders").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_sign", sign).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("###", "###", " I ").addMaterial('#', planks).addMaterial('I', Items.STICK).setGroup("end_signs").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chest", chest).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', planks).setGroup("end_chests").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_barrel", barrel).checkConfig(Configs.RECIPE_CONFIG).setShape("#S#", "# #", "#S#").addMaterial('#', planks).addMaterial('S', slab).setGroup("end_barrels").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bookshelf", shelf).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "PPP", "###").addMaterial('#', planks).addMaterial('P', Items.BOOK).setGroup("end_bookshelves").build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bark", bark).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', log).setOutputCount(3).build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_log", log).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', bark).setOutputCount(3).build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_composter", composter).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "# #", "###").addMaterial('#', slab).build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_shulker", Items.SHULKER_BOX).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('S', Items.SHULKER_SHELL).addMaterial('#', chest).build();
// Item Tags //
TagHelper.addTag(ItemTags.PLANKS, planks);

View file

@ -8,9 +8,10 @@ import net.minecraft.world.item.alchemy.Potions;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import ru.bclib.api.TagAPI;
import ru.bclib.recipes.GridRecipe;
import ru.betterend.BetterEnd;
import ru.betterend.config.Configs;
import ru.betterend.item.GuideBookItem;
import ru.betterend.recipe.builders.GridRecipe;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems;
@ -18,30 +19,34 @@ public class CraftingRecipes {
public static void register() {
if (BetterEnd.hasGuideBook()) {
GridRecipe.make("guide_book", GuideBookItem.GUIDE_BOOK)
.setShape("D", "B", "C")
.addMaterial('D', EndItems.ENDER_DUST)
.addMaterial('B', Items.BOOK)
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("D", "B", "C")
.addMaterial('D', EndItems.ENDER_DUST)
.addMaterial('B', Items.BOOK)
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
.build();
}
GridRecipe.make("ender_perl_to_block", EndBlocks.ENDER_BLOCK)
.setShape("OO", "OO")
.addMaterial('O', Items.ENDER_PEARL)
.build();
GridRecipe.make("ender_block_to_perl", Items.ENDER_PEARL)
.addMaterial('#', EndBlocks.ENDER_BLOCK)
.setOutputCount(4)
.setList("#")
.build();
GridRecipe.make(BetterEnd.MOD_ID, "ender_perl_to_block", EndBlocks.ENDER_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("OO", "OO")
.addMaterial('O', Items.ENDER_PEARL)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "ender_block_to_perl", Items.ENDER_PEARL)
.checkConfig(Configs.RECIPE_CONFIG)
.addMaterial('#', EndBlocks.ENDER_BLOCK)
.setOutputCount(4)
.setList("#")
.build();
GridRecipe.make("end_stone_smelter", EndBlocks.END_STONE_SMELTER)
.setShape("T#T", "V V", "T#T")
.addMaterial('#', Blocks.END_STONE_BRICKS)
.addMaterial('T', EndBlocks.THALLASIUM.ingot)
.addMaterial('V', TagAPI.FURNACES)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "end_stone_smelter", EndBlocks.END_STONE_SMELTER)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("T#T", "V V", "T#T")
.addMaterial('#', Blocks.END_STONE_BRICKS)
.addMaterial('T', EndBlocks.THALLASIUM.ingot)
.addMaterial('V', TagAPI.FURNACES)
.build();
registerPedestal("andesite_pedestal", EndBlocks.ANDESITE_PEDESTAL, Blocks.POLISHED_ANDESITE_SLAB, Blocks.POLISHED_ANDESITE);
registerPedestal("diorite_pedestal", EndBlocks.DIORITE_PEDESTAL, Blocks.POLISHED_DIORITE_SLAB, Blocks.POLISHED_DIORITE);
@ -49,37 +54,40 @@ public class CraftingRecipes {
registerPedestal("quartz_pedestal", EndBlocks.QUARTZ_PEDESTAL, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_PILLAR);
registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR);
GridRecipe.make("infusion_pedestal", EndBlocks.INFUSION_PEDESTAL)
.setShape(" Y ", "O#O", " # ")
.addMaterial('O', Items.ENDER_PEARL)
.addMaterial('Y', Items.ENDER_EYE)
.addMaterial('#', Blocks.OBSIDIAN)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "infusion_pedestal", EndBlocks.INFUSION_PEDESTAL)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape(" Y ", "O#O", " # ")
.addMaterial('O', Items.ENDER_PEARL)
.addMaterial('Y', Items.ENDER_EYE)
.addMaterial('#', Blocks.OBSIDIAN)
.build();
String material = "aeternium";
GridRecipe.make(material + "_block", EndBlocks.AETERNIUM_BLOCK)
.setShape("III", "III", "III")
.addMaterial('I', EndItems.AETERNIUM_INGOT)
.build();
GridRecipe.make(material + "_block_to_ingot", EndItems.AETERNIUM_INGOT)
.addMaterial('#', EndBlocks.AETERNIUM_BLOCK)
.setOutputCount(9)
.setList("#")
.build();
GridRecipe.make(BetterEnd.MOD_ID, material + "_block", EndBlocks.AETERNIUM_BLOCK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("III", "III", "III")
.addMaterial('I', EndItems.AETERNIUM_INGOT)
.build();
GridRecipe.make(BetterEnd.MOD_ID, material + "_block_to_ingot", EndItems.AETERNIUM_INGOT)
.checkConfig(Configs.RECIPE_CONFIG)
.addMaterial('#', EndBlocks.AETERNIUM_BLOCK)
.setOutputCount(9)
.setList("#")
.build();
GridRecipe.make("blue_vine_seed_dye", Items.BLUE_DYE).setList("#").addMaterial('#', EndBlocks.BLUE_VINE_SEED).build();
GridRecipe.make("creeping_moss_dye", Items.CYAN_DYE).setList("#").addMaterial('#', EndBlocks.CREEPING_MOSS).build();
GridRecipe.make("umbrella_moss_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS).build();
GridRecipe.make("umbrella_moss_tall_dye", Items.YELLOW_DYE).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL).build();
GridRecipe.make("shadow_plant_dye", Items.BLACK_DYE).setList("#").addMaterial('#', EndBlocks.SHADOW_PLANT).build();
GridRecipe.make(BetterEnd.MOD_ID, "blue_vine_seed_dye", Items.BLUE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.BLUE_VINE_SEED).build();
GridRecipe.make(BetterEnd.MOD_ID, "creeping_moss_dye", Items.CYAN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CREEPING_MOSS).build();
GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_dye", Items.YELLOW_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS).build();
GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_tall_dye", Items.YELLOW_DYE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL).build();
GridRecipe.make(BetterEnd.MOD_ID, "shadow_plant_dye", Items.BLACK_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.SHADOW_PLANT).build();
GridRecipe.make("paper", Items.PAPER).setShape("###").addMaterial('#', EndItems.END_LILY_LEAF_DRIED).setOutputCount(3).build();
GridRecipe.make(BetterEnd.MOD_ID, "paper", Items.PAPER).checkConfig(Configs.RECIPE_CONFIG).setShape("###").addMaterial('#', EndItems.END_LILY_LEAF_DRIED).setOutputCount(3).build();
GridRecipe.make("aurora_block", EndBlocks.AURORA_CRYSTAL).setShape("##", "##").addMaterial('#', EndItems.CRYSTAL_SHARDS).build();
GridRecipe.make("lotus_block", EndBlocks.END_LOTUS.log).setShape("##", "##").addMaterial('#', EndBlocks.END_LOTUS_STEM).build();
GridRecipe.make("needlegrass_stick", Items.STICK).setList("#").setOutputCount(2).addMaterial('#', EndBlocks.NEEDLEGRASS).build();
GridRecipe.make("shadow_berry_seeds", EndBlocks.SHADOW_BERRY).setList("#").setOutputCount(4).addMaterial('#', EndItems.SHADOW_BERRY_RAW).build();
GridRecipe.make("purple_polypore_dye", Items.PURPLE_DYE).setList("#").addMaterial('#', EndBlocks.PURPLE_POLYPORE).build();
GridRecipe.make(BetterEnd.MOD_ID, "aurora_block", EndBlocks.AURORA_CRYSTAL).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.CRYSTAL_SHARDS).build();
GridRecipe.make(BetterEnd.MOD_ID, "lotus_block", EndBlocks.END_LOTUS.log).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.END_LOTUS_STEM).build();
GridRecipe.make(BetterEnd.MOD_ID, "needlegrass_stick", Items.STICK).setList("#").checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).addMaterial('#', EndBlocks.NEEDLEGRASS).build();
GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_seeds", EndBlocks.SHADOW_BERRY).checkConfig(Configs.RECIPE_CONFIG).setList("#").setOutputCount(4).addMaterial('#', EndItems.SHADOW_BERRY_RAW).build();
GridRecipe.make(BetterEnd.MOD_ID, "purple_polypore_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.PURPLE_POLYPORE).build();
registerLantern("end_stone_lantern", EndBlocks.END_STONE_LANTERN, Blocks.END_STONE_BRICK_SLAB);
registerLantern("andesite_lantern", EndBlocks.ANDESITE_LANTERN, Blocks.ANDESITE_SLAB);
@ -89,135 +97,167 @@ public class CraftingRecipes {
registerLantern("purpur_lantern", EndBlocks.PURPUR_LANTERN, Blocks.PURPUR_SLAB);
registerLantern("blackstone_lantern", EndBlocks.BLACKSTONE_LANTERN, Blocks.BLACKSTONE_SLAB);
GridRecipe.make("amber_gem", EndItems.AMBER_GEM).setShape("##", "##").addMaterial('#', EndItems.RAW_AMBER).build();
GridRecipe.make("amber_block", EndBlocks.AMBER_BLOCK).setShape("##", "##").addMaterial('#', EndItems.AMBER_GEM).build();
GridRecipe.make("amber_gem_block", EndItems.AMBER_GEM).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.AMBER_BLOCK).build();
GridRecipe.make("iron_bulb_lantern", EndBlocks.IRON_BULB_LANTERN).setShape("C", "I", "#").addMaterial('C', Items.CHAIN).addMaterial('I', Items.IRON_INGOT).addMaterial('#', EndItems.GLOWING_BULB).build();
GridRecipe.make("twisted_moss_dye", Items.PINK_DYE).setList("#").addMaterial('#', EndBlocks.TWISTED_MOSS).build();
GridRecipe.make("byshy_grass_dye", Items.MAGENTA_DYE).setList("#").addMaterial('#', EndBlocks.BUSHY_GRASS).build();
GridRecipe.make("tail_moss_dye", Items.GRAY_DYE).setList("#").addMaterial('#', EndBlocks.TAIL_MOSS).build();
GridRecipe.make("petal_block", EndBlocks.HYDRALUX_PETAL_BLOCK).setShape("##", "##").addMaterial('#', EndItems.HYDRALUX_PETAL).build();
GridRecipe.make("petal_white_dye", Items.WHITE_DYE).setList("#").addMaterial('#', EndItems.HYDRALUX_PETAL).build();
GridRecipe.make(BetterEnd.MOD_ID, "amber_gem", EndItems.AMBER_GEM).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.RAW_AMBER).build();
GridRecipe.make(BetterEnd.MOD_ID, "amber_block", EndBlocks.AMBER_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.AMBER_GEM).build();
GridRecipe.make(BetterEnd.MOD_ID, "amber_gem_block", EndItems.AMBER_GEM).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.AMBER_BLOCK).build();
GridRecipe.make(BetterEnd.MOD_ID, "iron_bulb_lantern", EndBlocks.IRON_BULB_LANTERN).checkConfig(Configs.RECIPE_CONFIG).setShape("C", "I", "#").addMaterial('C', Items.CHAIN).addMaterial('I', Items.IRON_INGOT)
.addMaterial('#', EndItems.GLOWING_BULB).build();
GridRecipe.make(BetterEnd.MOD_ID, "twisted_moss_dye", Items.PINK_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TWISTED_MOSS).build();
GridRecipe.make(BetterEnd.MOD_ID, "byshy_grass_dye", Items.MAGENTA_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.BUSHY_GRASS).build();
GridRecipe.make(BetterEnd.MOD_ID, "tail_moss_dye", Items.GRAY_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TAIL_MOSS).build();
GridRecipe.make(BetterEnd.MOD_ID, "petal_block", EndBlocks.HYDRALUX_PETAL_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.HYDRALUX_PETAL).build();
GridRecipe.make(BetterEnd.MOD_ID, "petal_white_dye", Items.WHITE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndItems.HYDRALUX_PETAL).build();
GridRecipe.make("sweet_berry_jelly", EndItems.SWEET_BERRY_JELLY)
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR).addMaterial('B', Items.SWEET_BERRIES)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "sweet_berry_jelly", EndItems.SWEET_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR).addMaterial('B', Items.SWEET_BERRIES)
.build();
GridRecipe.make("shadow_berry_jelly", EndItems.SHADOW_BERRY_JELLY)
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR)
.addMaterial('B', EndItems.SHADOW_BERRY_COOKED)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.SHADOW_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR)
.addMaterial('B', EndItems.SHADOW_BERRY_COOKED)
.build();
GridRecipe.make("shadow_berry_jelly", EndItems.BLOSSOM_BERRY_JELLY)
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR)
.addMaterial('B', EndItems.BLOSSOM_BERRY)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.BLOSSOM_BERRY_JELLY)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("JWSB")
.addMaterial('J', EndItems.GELATINE)
.addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER))
.addMaterial('S', Items.SUGAR)
.addMaterial('B', EndItems.BLOSSOM_BERRY)
.build();
GridRecipe.make("sulphur_gunpowder", Items.GUNPOWDER).setList("SCB").addMaterial('S', EndItems.CRYSTALLINE_SULPHUR).addMaterial('C', Items.COAL, Items.CHARCOAL).addMaterial('B', Items.BONE_MEAL).build();
GridRecipe.make(BetterEnd.MOD_ID, "sulphur_gunpowder", Items.GUNPOWDER).checkConfig(Configs.RECIPE_CONFIG).setList("SCB").addMaterial('S', EndItems.CRYSTALLINE_SULPHUR).addMaterial('C', Items.COAL, Items.CHARCOAL)
.addMaterial('B', Items.BONE_MEAL).build();
GridRecipe.make("dense_emerald_ice", EndBlocks.DENSE_EMERALD_ICE).setShape("##", "##").addMaterial('#', EndBlocks.EMERALD_ICE).build();
GridRecipe.make("ancient_emerald_ice", EndBlocks.ANCIENT_EMERALD_ICE).setShape("###", "###", "###").addMaterial('#', EndBlocks.DENSE_EMERALD_ICE).build();
GridRecipe.make(BetterEnd.MOD_ID, "dense_emerald_ice", EndBlocks.DENSE_EMERALD_ICE).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.EMERALD_ICE).build();
GridRecipe.make(BetterEnd.MOD_ID, "ancient_emerald_ice", EndBlocks.ANCIENT_EMERALD_ICE).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', EndBlocks.DENSE_EMERALD_ICE).build();
GridRecipe.make("charnia_cyan_dye", Items.CYAN_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_CYAN).build();
GridRecipe.make("charnia_green_dye", Items.GREEN_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_GREEN).build();
GridRecipe.make("charnia_light_blue_dye", Items.LIGHT_BLUE_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE).build();
GridRecipe.make("charnia_orange_dye", Items.ORANGE_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_ORANGE).build();
GridRecipe.make("charnia_purple_dye", Items.PURPLE_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_PURPLE).build();
GridRecipe.make("charnia_red_dye", Items.RED_DYE).setList("#").addMaterial('#', EndBlocks.CHARNIA_RED).build();
GridRecipe.make(BetterEnd.MOD_ID, "charnia_cyan_dye", Items.CYAN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_CYAN).build();
GridRecipe.make(BetterEnd.MOD_ID, "charnia_green_dye", Items.GREEN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_GREEN).build();
GridRecipe.make(BetterEnd.MOD_ID, "charnia_light_blue_dye", Items.LIGHT_BLUE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE).build();
GridRecipe.make(BetterEnd.MOD_ID, "charnia_orange_dye", Items.ORANGE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_ORANGE).build();
GridRecipe.make(BetterEnd.MOD_ID, "charnia_purple_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_PURPLE).build();
GridRecipe.make(BetterEnd.MOD_ID, "charnia_red_dye", Items.RED_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_RED).build();
GridRecipe.make("respawn_obelisk", EndBlocks.RESPAWN_OBELISK)
.setShape("CSC", "CSC", "AAA")
.addMaterial('C', EndBlocks.AURORA_CRYSTAL)
.addMaterial('S', EndItems.ETERNAL_CRYSTAL)
.addMaterial('A', EndBlocks.AMBER_BLOCK)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "respawn_obelisk", EndBlocks.RESPAWN_OBELISK)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("CSC", "CSC", "AAA")
.addMaterial('C', EndBlocks.AURORA_CRYSTAL)
.addMaterial('S', EndItems.ETERNAL_CRYSTAL)
.addMaterial('A', EndBlocks.AMBER_BLOCK)
.build();
GridRecipe.make("twisted_umbrella_moss_dye", Items.PURPLE_DYE).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS).build();
GridRecipe.make("twisted_umbrella_moss_dye_tall", Items.PURPLE_DYE).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL).build();
GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS).build();
GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye_tall", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL).build();
GridRecipe.make("leather_to_stripes", EndItems.LEATHER_STRIPE)
.setList("L")
.addMaterial('L', Items.LEATHER)
.setOutputCount(3)
.build();
GridRecipe.make("stripes_to_leather", Items.LEATHER)
.setList("SSS")
.addMaterial('S', EndItems.LEATHER_STRIPE)
.build();
GridRecipe.make("leather_wrapped_stick", EndItems.LEATHER_WRAPPED_STICK)
.setList("SL")
.addMaterial('S', Items.STICK)
.addMaterial('L', EndItems.LEATHER_STRIPE)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "leather_to_stripes", EndItems.LEATHER_STRIPE)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("L")
.addMaterial('L', Items.LEATHER)
.setOutputCount(3)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "stripes_to_leather", Items.LEATHER)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("SSS")
.addMaterial('S', EndItems.LEATHER_STRIPE)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "leather_wrapped_stick", EndItems.LEATHER_WRAPPED_STICK)
.checkConfig(Configs.RECIPE_CONFIG)
.setList("SL")
.addMaterial('S', Items.STICK)
.addMaterial('L', EndItems.LEATHER_STRIPE)
.build();
GridRecipe.make("fiber_string", Items.STRING).setOutputCount(6).setShape("#", "#", "#").addMaterial('#', EndItems.SILK_FIBER).build();
GridRecipe.make(BetterEnd.MOD_ID, "fiber_string", Items.STRING).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("#", "#", "#").addMaterial('#', EndItems.SILK_FIBER).build();
GridRecipe.make("ender_eye_amber", Items.ENDER_EYE)
.setShape("SAS", "APA", "SAS")
.addMaterial('S', EndItems.CRYSTAL_SHARDS)
.addMaterial('A', EndItems.AMBER_GEM)
.addMaterial('P', Items.ENDER_PEARL)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "ender_eye_amber", Items.ENDER_EYE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("SAS", "APA", "SAS")
.addMaterial('S', EndItems.CRYSTAL_SHARDS)
.addMaterial('A', EndItems.AMBER_GEM)
.addMaterial('P', Items.ENDER_PEARL)
.build();
GridRecipe.make("iron_chandelier", EndBlocks.IRON_CHANDELIER).setShape("I#I", " # ").addMaterial('#', Items.IRON_INGOT).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build();
GridRecipe.make("gold_chandelier", EndBlocks.GOLD_CHANDELIER).setShape("I#I", " # ").addMaterial('#', Items.GOLD_INGOT).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build();
GridRecipe.make(BetterEnd.MOD_ID, "iron_chandelier", EndBlocks.IRON_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.IRON_INGOT).addMaterial('I', EndItems.LUMECORN_ROD)
.setGroup("end_metal_chandelier").build();
GridRecipe.make(BetterEnd.MOD_ID, "gold_chandelier", EndBlocks.GOLD_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.GOLD_INGOT).addMaterial('I', EndItems.LUMECORN_ROD)
.setGroup("end_metal_chandelier").build();
GridRecipe.make("missing_tile", EndBlocks.MISSING_TILE)
.setOutputCount(4)
.setShape("#P", "P#")
.addMaterial('#', EndBlocks.VIOLECITE.stone, EndBlocks.VIOLECITE.bricks, EndBlocks.VIOLECITE.tiles)
.addMaterial('P', Blocks.PURPUR_BLOCK)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "missing_tile", EndBlocks.MISSING_TILE)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setShape("#P", "P#")
.addMaterial('#', EndBlocks.VIOLECITE.stone, EndBlocks.VIOLECITE.bricks, EndBlocks.VIOLECITE.tiles)
.addMaterial('P', Blocks.PURPUR_BLOCK)
.build();
registerHammer("iron", Items.IRON_INGOT, EndItems.IRON_HAMMER);
registerHammer("golden", Items.GOLD_INGOT, EndItems.GOLDEN_HAMMER);
registerHammer("diamond", Items.DIAMOND, EndItems.DIAMOND_HAMMER);
GridRecipe.make("charcoal_block", EndBlocks.CHARCOAL_BLOCK).setShape("###", "###", "###").addMaterial('#', Items.CHARCOAL).build();
GridRecipe.make("charcoal_from_block", Items.CHARCOAL).setOutputCount(9).setList("#").addMaterial('#', EndBlocks.CHARCOAL_BLOCK).build();
GridRecipe.make("end_stone_furnace", EndBlocks.END_STONE_FURNACE).setShape("###", "# #", "###").addMaterial('#', Blocks.END_STONE).build();
GridRecipe.make("filalux_lantern", EndBlocks.FILALUX_LANTERN).setShape("###", "###", "###").addMaterial('#', EndBlocks.FILALUX).build();
GridRecipe.make(BetterEnd.MOD_ID, "charcoal_block", EndBlocks.CHARCOAL_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', Items.CHARCOAL).build();
GridRecipe.make(BetterEnd.MOD_ID, "charcoal_from_block", Items.CHARCOAL).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', EndBlocks.CHARCOAL_BLOCK).build();
GridRecipe.make(BetterEnd.MOD_ID, "end_stone_furnace", EndBlocks.END_STONE_FURNACE).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', Blocks.END_STONE).build();
GridRecipe.make(BetterEnd.MOD_ID, "filalux_lantern", EndBlocks.FILALUX_LANTERN).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', EndBlocks.FILALUX).build();
GridRecipe.make("silk_moth_hive", EndBlocks.SILK_MOTH_HIVE).setShape("#L#", "LML", "#L#").addMaterial('#', EndBlocks.TENANEA.planks).addMaterial('L', EndBlocks.TENANEA_LEAVES).addMaterial('M', EndItems.SILK_MOTH_MATRIX).build();
GridRecipe.make("cave_pumpkin_pie", EndItems.CAVE_PUMPKIN_PIE).setShape("SBS", "BPB", "SBS").addMaterial('P', EndBlocks.CAVE_PUMPKIN).addMaterial('B', EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_RAW).addMaterial('S', Items.SUGAR).build();
GridRecipe.make("cave_pumpkin_seeds", EndBlocks.CAVE_PUMPKIN_SEED).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.CAVE_PUMPKIN).build();
GridRecipe.make(BetterEnd.MOD_ID, "silk_moth_hive", EndBlocks.SILK_MOTH_HIVE)
.checkConfig(Configs.RECIPE_CONFIG).setShape("#L#", "LML", "#L#")
.addMaterial('#', EndBlocks.TENANEA.planks)
.addMaterial('L', EndBlocks.TENANEA_LEAVES)
.addMaterial('M', EndItems.SILK_MOTH_MATRIX)
.build();
GridRecipe.make("neon_cactus_block", EndBlocks.NEON_CACTUS_BLOCK).setShape("##", "##").addMaterial('#', EndBlocks.NEON_CACTUS).build();
GridRecipe.make("neon_cactus_block_slab", EndBlocks.NEON_CACTUS_BLOCK_SLAB).setShape("###").setOutputCount(6).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build();
GridRecipe.make("neon_cactus_block_stairs", EndBlocks.NEON_CACTUS_BLOCK_STAIRS).setShape("# ", "## ", "###").setOutputCount(4).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build();
GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_pie", EndItems.CAVE_PUMPKIN_PIE)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("SBS", "BPB", "SBS")
.addMaterial('P', EndBlocks.CAVE_PUMPKIN)
.addMaterial('B', EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_RAW).addMaterial('S', Items.SUGAR).build();
GridRecipe.make("sugar_from_root", Items.SUGAR).setList("###").addMaterial('#', EndItems.AMBER_ROOT_RAW).build();
GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_seeds", EndBlocks.CAVE_PUMPKIN_SEED)
.checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4)
.setList("#")
.addMaterial('#', EndBlocks.CAVE_PUMPKIN)
.build();
GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block", EndBlocks.NEON_CACTUS_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.NEON_CACTUS).build();
GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_slab", EndBlocks.NEON_CACTUS_BLOCK_SLAB).checkConfig(Configs.RECIPE_CONFIG).setShape("###").setOutputCount(6).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build();
GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_stairs", EndBlocks.NEON_CACTUS_BLOCK_STAIRS).checkConfig(Configs.RECIPE_CONFIG).setShape("# ", "## ", "###").setOutputCount(4).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build();
GridRecipe.make(BetterEnd.MOD_ID, "sugar_from_root", Items.SUGAR).checkConfig(Configs.RECIPE_CONFIG).setList("###").addMaterial('#', EndItems.AMBER_ROOT_RAW).build();
}
private static void registerLantern(String name, Block lantern, Block slab) {
GridRecipe.make(name, lantern)
.setShape("S", "#", "S")
.addMaterial('#', EndItems.CRYSTAL_SHARDS)
.addMaterial('S', slab)
.setGroup("end_stone_lanterns")
.build();
GridRecipe.make(BetterEnd.MOD_ID, name, lantern)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("S", "#", "S")
.addMaterial('#', EndItems.CRYSTAL_SHARDS)
.addMaterial('S', slab)
.setGroup("end_stone_lanterns")
.build();
}
public static void registerPedestal(String name, Block pedestal, Block slab, Block pillar) {
GridRecipe.make(name, pedestal)
.setShape("S", "#", "S")
.addMaterial('S', slab)
.addMaterial('#', pillar)
.setOutputCount(2)
.build();
GridRecipe.make(BetterEnd.MOD_ID, name, pedestal)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("S", "#", "S")
.addMaterial('S', slab)
.addMaterial('#', pillar)
.setOutputCount(2)
.build();
}
private static void registerHammer(String name, Item material, Item result) {
GridRecipe.make(name + "_hammer", result)
GridRecipe.make(BetterEnd.MOD_ID, name + "_hammer", result)
.checkConfig(Configs.RECIPE_CONFIG)
.setShape("I I", "I#I", " # ")
.addMaterial('I', material)
.addMaterial('#', Items.STICK)

View file

@ -1,124 +0,0 @@
package ru.betterend.recipe.builders;
import java.util.Arrays;
import java.util.Map;
import com.google.common.collect.Maps;
import net.minecraft.core.NonNullList;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.Tag;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraft.world.item.crafting.ShapelessRecipe;
import net.minecraft.world.level.ItemLike;
import ru.betterend.BetterEnd;
import ru.betterend.config.Configs;
import ru.betterend.recipe.EndRecipeManager;
import ru.betterend.util.RecipeHelper;
public class GridRecipe {
private static final GridRecipe INSTANCE = new GridRecipe();
private String name;
private ItemLike output;
private String group;
private RecipeType<?> type;
private boolean shaped;
private String[] shape;
private Map<Character, Ingredient> materialKeys = Maps.newHashMap();
private int count;
private boolean exist = true;
private GridRecipe() {}
public static GridRecipe make(String name, ItemLike output) {
INSTANCE.name = name;
INSTANCE.output = output;
INSTANCE.group = "";
INSTANCE.type = RecipeType.CRAFTING;
INSTANCE.shaped = true;
INSTANCE.shape = new String[] {"#"};
INSTANCE.materialKeys.clear();
INSTANCE.count = 1;
INSTANCE.exist = Configs.RECIPE_CONFIG.getBoolean("grid", name, true) && RecipeHelper.exists(output);
return INSTANCE;
}
public GridRecipe setGroup(String group) {
this.group = group;
return this;
}
public GridRecipe setShape(String... shape) {
this.shape = shape;
return this;
}
public GridRecipe setList(String shape) {
this.shape = new String[] { shape };
this.shaped = false;
return this;
}
public GridRecipe addMaterial(char key, Tag<Item> value) {
return addMaterial(key, Ingredient.of(value));
}
public GridRecipe addMaterial(char key, ItemStack... value) {
return addMaterial(key, Ingredient.of(Arrays.stream(value)));
}
public GridRecipe addMaterial(char key, ItemLike... values) {
for (ItemLike item: values) {
exist &= RecipeHelper.exists(item);
}
return addMaterial(key, Ingredient.of(values));
}
private GridRecipe addMaterial(char key, Ingredient value) {
materialKeys.put(key, value);
return this;
}
public GridRecipe setOutputCount(int count) {
this.count = count;
return this;
}
private NonNullList<Ingredient> getMaterials(int width, int height) {
NonNullList<Ingredient> materials = NonNullList.withSize(width * height, Ingredient.EMPTY);
int pos = 0;
for (String line: shape) {
for (int i = 0; i < width; i++) {
char c = line.charAt(i);
Ingredient material = materialKeys.get(c);
materials.set(pos ++, material == null ? Ingredient.EMPTY : material);
}
}
return materials;
}
public void build() {
if (exist) {
int height = shape.length;
int width = shape[0].length();
ItemStack result = new ItemStack(output, count);
ResourceLocation id = BetterEnd.makeID(name);
NonNullList<Ingredient> materials = this.getMaterials(width, height);
CraftingRecipe recipe = shaped ? new ShapedRecipe(id, group, width, height, materials, result) : new ShapelessRecipe(id, group, result, materials);
EndRecipeManager.addRecipe(type, recipe);
} else {
BetterEnd.LOGGER.debug("Recipe {} couldn't be added", name);
}
}
}