Recipe check
This commit is contained in:
parent
62698e8bf5
commit
26eb6165a7
4 changed files with 91 additions and 82 deletions
|
@ -1,81 +1,73 @@
|
|||
package ru.betterend.recipe;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.registry.ItemRegistry;
|
||||
|
||||
public class CraftingRecipes {
|
||||
|
||||
public static void register() {
|
||||
if (exists(BlockRegistry.ENDER_BLOCK)) {
|
||||
RecipeBuilder.make("ender_pearl_to_block", BlockRegistry.ENDER_BLOCK)
|
||||
.setShape(new String[] { "OO", "OO" })
|
||||
.addMaterial('O', Items.ENDER_PEARL)
|
||||
.build();
|
||||
RecipeBuilder.make("ender_block_to_pearl", Items.ENDER_PEARL)
|
||||
.addMaterial('#', BlockRegistry.ENDER_BLOCK)
|
||||
.setOutputCount(4)
|
||||
.setList("#")
|
||||
.build();
|
||||
}
|
||||
if (exists(BlockRegistry.END_STONE_SMELTER)) {
|
||||
RecipeBuilder.make("end_stone_smelter", BlockRegistry.END_STONE_SMELTER)
|
||||
.setShape(new String[] { "###", "V V", "###" })
|
||||
.addMaterial('#', Blocks.END_STONE_BRICKS)
|
||||
.addMaterial('V', Items.BUCKET)
|
||||
.build();
|
||||
|
||||
}
|
||||
if (exists(ItemRegistry.TERMINITE_INGOT)) {
|
||||
String material = "terminite";
|
||||
RecipeBuilder.make(material + "_block", BlockRegistry.TERMINITE_BLOCK)
|
||||
.setShape(new String[] { "III", "III", "III" })
|
||||
.addMaterial('I', ItemRegistry.TERMINITE_INGOT)
|
||||
.build();
|
||||
|
||||
registerHelmet(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HELMET);
|
||||
registerChestplate(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_CHESTPLATE);
|
||||
registerLeggings(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_LEGGINGS);
|
||||
registerBoots(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_BOOTS);
|
||||
registerShovel(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_SHOVEL);
|
||||
registerSword(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_SWORD);
|
||||
registerPickaxe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_PICKAXE);
|
||||
registerAxe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_AXE);
|
||||
registerHoe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HOE);
|
||||
registerHammer(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HAMMER);
|
||||
}
|
||||
if (exists(ItemRegistry.AETERNIUM_INGOT)) {
|
||||
String material = "aeternium";
|
||||
RecipeBuilder.make(material + "_block", BlockRegistry.AETERNIUM_BLOCK)
|
||||
.setShape(new String[] { "III", "III", "III" })
|
||||
.addMaterial('I', ItemRegistry.AETERNIUM_INGOT)
|
||||
.build();
|
||||
|
||||
registerHelmet(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HELMET);
|
||||
registerChestplate(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_CHESTPLATE);
|
||||
registerLeggings(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_LEGGINGS);
|
||||
registerBoots(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_BOOTS);
|
||||
registerShovel(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_SHOVEL);
|
||||
registerSword(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_SWORD);
|
||||
registerPickaxe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_PICKAXE);
|
||||
registerAxe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_AXE);
|
||||
registerHoe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HOE);
|
||||
registerHammer(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HAMMER);
|
||||
}
|
||||
RecipeBuilder.make("ender_pearl_to_block", BlockRegistry.ENDER_BLOCK)
|
||||
.setShape(new String[] { "OO", "OO" })
|
||||
.addMaterial('O', Items.ENDER_PEARL)
|
||||
.build();
|
||||
RecipeBuilder.make("ender_block_to_pearl", Items.ENDER_PEARL)
|
||||
.addMaterial('#', BlockRegistry.ENDER_BLOCK)
|
||||
.setOutputCount(4)
|
||||
.setList("#")
|
||||
.build();
|
||||
|
||||
RecipeBuilder.make("end_stone_smelter", BlockRegistry.END_STONE_SMELTER)
|
||||
.setShape(new String[] { "###", "V V", "###" })
|
||||
.addMaterial('#', Blocks.END_STONE_BRICKS)
|
||||
.addMaterial('V', Items.BUCKET)
|
||||
.build();
|
||||
|
||||
String material = "terminite";
|
||||
RecipeBuilder.make(material + "_block", BlockRegistry.TERMINITE_BLOCK)
|
||||
.setShape(new String[] { "III", "III", "III" })
|
||||
.addMaterial('I', ItemRegistry.TERMINITE_INGOT)
|
||||
.build();
|
||||
|
||||
registerHelmet(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HELMET);
|
||||
registerChestplate(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_CHESTPLATE);
|
||||
registerLeggings(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_LEGGINGS);
|
||||
registerBoots(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_BOOTS);
|
||||
registerShovel(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_SHOVEL);
|
||||
registerSword(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_SWORD);
|
||||
registerPickaxe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_PICKAXE);
|
||||
registerAxe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_AXE);
|
||||
registerHoe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HOE);
|
||||
registerHammer(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HAMMER);
|
||||
|
||||
material = "aeternium";
|
||||
RecipeBuilder.make(material + "_block", BlockRegistry.AETERNIUM_BLOCK)
|
||||
.setShape(new String[] { "III", "III", "III" })
|
||||
.addMaterial('I', ItemRegistry.AETERNIUM_INGOT)
|
||||
.build();
|
||||
|
||||
registerHelmet(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HELMET);
|
||||
registerChestplate(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_CHESTPLATE);
|
||||
registerLeggings(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_LEGGINGS);
|
||||
registerBoots(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_BOOTS);
|
||||
registerShovel(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_SHOVEL);
|
||||
registerSword(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_SWORD);
|
||||
registerPickaxe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_PICKAXE);
|
||||
registerAxe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_AXE);
|
||||
registerHoe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HOE);
|
||||
registerHammer(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HAMMER);
|
||||
|
||||
registerHammer("iron", Items.IRON_INGOT, ItemRegistry.IRON_HAMMER);
|
||||
registerHammer("golden", Items.GOLD_INGOT, ItemRegistry.GOLDEN_HAMMER);
|
||||
registerHammer("diamond", Items.DIAMOND, ItemRegistry.DIAMOND_HAMMER);
|
||||
registerHammer("netherite", Items.NETHERITE_INGOT, ItemRegistry.NETHERITE_HAMMER);
|
||||
|
||||
if (exists(BlockRegistry.BLUE_VINE_SEED)) {
|
||||
RecipeBuilder.make("blue_vine_seed_dye", Items.BLUE_DYE).setList("#").addMaterial('#', BlockRegistry.BLUE_VINE_SEED).build();
|
||||
}
|
||||
RecipeBuilder.make("blue_vine_seed_dye", Items.BLUE_DYE).setList("#").addMaterial('#', BlockRegistry.BLUE_VINE_SEED).build();
|
||||
RecipeBuilder.make("creeping_moss_dye", Items.CYAN_DYE).setList("#").addMaterial('#', BlockRegistry.CREEPING_MOSS).build();
|
||||
RecipeBuilder.make("umbrella_moss_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS).build();
|
||||
RecipeBuilder.make("umbrella_moss_tall_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS_TALL).build();
|
||||
}
|
||||
|
||||
private static void registerHelmet(String name, Item material, Item result) {
|
||||
|
@ -153,13 +145,4 @@ public class CraftingRecipes {
|
|||
.addMaterial('#', Items.STICK)
|
||||
.build();
|
||||
}
|
||||
|
||||
protected static boolean exists(ItemConvertible item) {
|
||||
if (item instanceof Block) {
|
||||
return Registry.BLOCK.getId((Block) item) != Registry.BLOCK.getDefaultId();
|
||||
}
|
||||
else {
|
||||
return Registry.ITEM.getId(item.asItem()) != Registry.ITEM.getDefaultId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue