Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package WGHxPERNAxBEAST.TutorialMod.handlers;
- import WGHxPERNAxBEAST.TutorialMod.init.ModArmor;
- import WGHxPERNAxBEAST.TutorialMod.init.ModBlocks;
- import WGHxPERNAxBEAST.TutorialMod.init.ModCombat;
- import WGHxPERNAxBEAST.TutorialMod.init.ModItems;
- import WGHxPERNAxBEAST.TutorialMod.init.ModTools;
- import WGHxPERNAxBEAST.TutorialMod.util.Utils;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraftforge.fml.common.registry.GameRegistry;
- import net.minecraftforge.oredict.OreDictionary;
- import net.minecraftforge.oredict.ShapedOreRecipe;
- public class RecipeHandler {
- public static void registerCraftingRecipes() {
- GameRegistry.addRecipe(new ItemStack(ModCombat.soulStealer),
- new Object[] { "SAS", "ADA", "SAS", 'S', ModItems.blacktitaniumStick, 'A', Items.STRING, 'D', Items.DIAMOND });
- GameRegistry.addRecipe(new ItemStack(ModItems.blacktitaniumIngot),
- new Object[] { "BBB", "BTB", "BBB", 'B', Items.DYE, 'T', "ingotTitanium", });
- GameRegistry.addRecipe(new ItemStack(ModItems.blacktitaniumStick, 4),
- new Object[] { " B ", "BSB", " B ", 'B', ModItems.blacktitaniumIngot, 'S', Items.STICK, });
- GameRegistry.addRecipe(new ItemStack(ModCombat.titaniumShield),
- new Object[] { "TTT", "TST", "TTT", 'S', Items.SHIELD, 'T', "ingotTitanium" });
- GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.breaker, 1, 0),
- new Object[] { "TTT", "RPR", "TTT", 'P', ModTools.titaniumPickaxe, 'R', "dustRedstone", 'T', "blockTitanium" }));
- GameRegistry.addRecipe(new ShapedOreRecipe(
- new ItemStack(ModBlocks.breaker, 1, 1), new Object[] { "BBB", "BPB", "BBB", 'P', ModTools.titaniumPickaxe, 'M', 'B', new ItemStack(ModBlocks.breaker, 1, 0), }));
- GameRegistry.addRecipe(new ItemStack(ModBlocks.titanium_block),
- new Object[] { "TTT", "TTT", "TTT", 'T', "ingotTitanium" });
- GameRegistry.addRecipe(new ItemStack(ModBlocks.black_titanium_block),
- new Object[] { "TTT", "TTT", "TTT", 'T', ModItems.blacktitaniumIngot });
- registerToolRecipe(ModItems.titaniumIngot, ModItems.blacktitaniumStick, ModTools.titaniumPickaxe, ModTools.titaniumAxe, ModTools.titaniumShovel, ModTools.titaniumHoe, ModCombat.titaniumSword);
- registerArmorRecipe("ingotTitanium", ModArmor.TitaniumHelmet, ModArmor.TitaniumChestplate, ModArmor.TitaniumLeggings, ModArmor.TitaniumBoots);
- Utils.getLogger().info("Registered Crafting Recipes!");
- }
- public static void registerSmeltingRecipes() {
- GameRegistry.addSmelting(ModBlocks.titanium_ore, new ItemStack(ModItems.titaniumIngot), 2.0F);
- GameRegistry.addSmelting(ModBlocks.black_titanium_ore, new ItemStack(ModItems.blacktitaniumIngot), 2.0F);
- Utils.getLogger().info("Registered Furnace Recipes!");
- }
- /**
- * Registers a tool using the ingot
- * @param ingot The ingot
- * @param pickaxe The pickaxe
- * @param axe The axe
- * @param shovel The shovel
- * @param hoe The hoe
- * @param sword The sword
- */
- private static void registerToolRecipe(Item ingot, Item stick, Item pickaxe, Item axe, Item shovel, Item hoe, Item sword) {
- GameRegistry.addRecipe(new ItemStack(pickaxe), new Object[] { "III", " S ", " S ", 'I', ingot, 'S', stick });
- GameRegistry.addRecipe(new ItemStack(axe), new Object[] { "II ", "IS ", " S ", 'I', ingot, 'S', stick });
- GameRegistry.addRecipe(new ItemStack(axe), new Object[] { " II", " SI", " S ", 'I', ingot, 'S', stick });
- GameRegistry.addRecipe(new ItemStack(shovel), new Object[] { " I ", " S ", " S ", 'I', ingot, 'S', stick });
- GameRegistry.addRecipe(new ItemStack(hoe), new Object[] { " II", " S ", " S ", 'I', ingot, 'S', stick });
- GameRegistry.addRecipe(new ItemStack(hoe), new Object[] { "II ", " S ", " S ", 'I', ingot, 'S', stick });
- GameRegistry.addRecipe(new ItemStack(sword), new Object[] { " I ", " I ", " S ", 'I', ingot, 'S', stick });
- }
- /**
- * Registers a tool using the ingot from the {@link OreDictionary}
- * @param ingotOD The ingot from the {@link OreDictionary}
- * @param pickaxe The pickaxe
- * @param axe The axe
- * @param shovel The shovel
- * @param hoe The hoe
- * @param sword The sword
- * @param stickOD The stick from the {@link OreDictionary}
- */
- private static void registerToolRecipe(String ingotOD, Item pickaxe, Item axe, Item shovel, Item hoe, Item sword, String stickOD) {
- GameRegistry.addRecipe(new ShapedOreRecipe(pickaxe, new Object[] { "III", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
- GameRegistry.addRecipe(new ShapedOreRecipe(axe, new Object[] { "II ", "IS ", " S ", 'I', ingotOD, 'S', stickOD }));
- GameRegistry.addRecipe(new ShapedOreRecipe(axe, new Object[] { " II", " SI", " S ", 'I', ingotOD, 'S', stickOD }));
- GameRegistry.addRecipe(new ShapedOreRecipe(shovel, new Object[] { " I ", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
- GameRegistry.addRecipe(new ShapedOreRecipe(hoe, new Object[] { " II", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
- GameRegistry.addRecipe(new ShapedOreRecipe(hoe, new Object[] { "II ", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
- GameRegistry.addRecipe(new ShapedOreRecipe(sword, new Object[] { " I ", " I ", " S ", 'I', ingotOD, 'S', stickOD }));
- }
- /**
- * Registers Armor using the ingot
- * @param ingot The ingot
- * @param helmet The helmet
- * @param chestplate The chestplate
- * @param leggings The leggings
- * @param boots The boots
- */
- public static void registerArmorRecipe(Item ingot, Item helmet, Item chestplate, Item leggings, Item boots) {
- GameRegistry.addRecipe(new ItemStack(helmet), new Object[] { "III","I I"," ",'I',ingot});
- GameRegistry.addRecipe(new ItemStack(helmet), new Object[] { " ","III","I I",'I',ingot});
- GameRegistry.addRecipe(new ItemStack(chestplate), new Object[] { "I I","III","III",'I',ingot});
- GameRegistry.addRecipe(new ItemStack(leggings), new Object[] { "III","I I","I I",'I',ingot});
- GameRegistry.addRecipe(new ItemStack(boots), new Object[] { "I I","I I"," ",'I',ingot});
- GameRegistry.addRecipe(new ItemStack(boots), new Object[] { " ","I I","I I",'I',ingot});
- }
- /**
- * Registers Armor using the ingot from the {@link OreDictionary}
- * @param ingotOD The ingot from the {@link OreDictionary}
- * @param helmet The helmet
- * @param chestplate The chestplate
- * @param leggings The leggings
- * @param boots The boots
- */
- public static void registerArmorRecipe(String ingotOD, Item helmet, Item chestplate, Item leggings, Item boots) {
- GameRegistry.addRecipe(new ShapedOreRecipe(helmet, new Object[] { "III","I I"," ",'I',ingotOD}));
- GameRegistry.addRecipe(new ShapedOreRecipe(helmet, new Object[] { " ","III","I I",'I',ingotOD}));
- GameRegistry.addRecipe(new ShapedOreRecipe(chestplate, new Object[] { "I I","III","III",'I',ingotOD}));
- GameRegistry.addRecipe(new ShapedOreRecipe(leggings, new Object[] { "III","I I","I I",'I',ingotOD}));
- GameRegistry.addRecipe(new ShapedOreRecipe(boots, new Object[] { "I I","I I"," ",'I',ingotOD}));
- GameRegistry.addRecipe(new ShapedOreRecipe(boots, new Object[] { " ","I I","I I",'I',ingotOD}));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement