Advertisement
Draco18s

Untitled

Mar 11th, 2017
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.00 KB | None | 0 0
  1. package WGHxPERNAxBEAST.TutorialMod.handlers;
  2.  
  3. import WGHxPERNAxBEAST.TutorialMod.init.ModArmor;
  4. import WGHxPERNAxBEAST.TutorialMod.init.ModBlocks;
  5. import WGHxPERNAxBEAST.TutorialMod.init.ModCombat;
  6. import WGHxPERNAxBEAST.TutorialMod.init.ModItems;
  7. import WGHxPERNAxBEAST.TutorialMod.init.ModTools;
  8. import WGHxPERNAxBEAST.TutorialMod.util.Utils;
  9. import net.minecraft.init.Items;
  10. import net.minecraft.item.Item;
  11. import net.minecraft.item.ItemStack;
  12. import net.minecraftforge.fml.common.registry.GameRegistry;
  13. import net.minecraftforge.oredict.OreDictionary;
  14. import net.minecraftforge.oredict.ShapedOreRecipe;
  15.  
  16. public class RecipeHandler {
  17.  
  18.     public static void registerCraftingRecipes() {
  19.         GameRegistry.addRecipe(new ItemStack(ModCombat.soulStealer),
  20.                 new Object[] { "SAS", "ADA", "SAS", 'S', ModItems.blacktitaniumStick, 'A', Items.STRING, 'D', Items.DIAMOND });
  21.         GameRegistry.addRecipe(new ItemStack(ModItems.blacktitaniumIngot),
  22.                 new Object[] { "BBB", "BTB", "BBB", 'B', Items.DYE, 'T', "ingotTitanium", });
  23.         GameRegistry.addRecipe(new ItemStack(ModItems.blacktitaniumStick, 4),
  24.                 new Object[] { " B ", "BSB", " B ", 'B', ModItems.blacktitaniumIngot, 'S', Items.STICK, });
  25.         GameRegistry.addRecipe(new ItemStack(ModCombat.titaniumShield),
  26.                 new Object[] { "TTT", "TST", "TTT", 'S', Items.SHIELD, 'T', "ingotTitanium" });
  27.         GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.breaker, 1, 0),
  28.                 new Object[] { "TTT", "RPR", "TTT", 'P', ModTools.titaniumPickaxe, 'R', "dustRedstone", 'T', "blockTitanium" }));
  29.         GameRegistry.addRecipe(new ShapedOreRecipe(
  30.                 new ItemStack(ModBlocks.breaker, 1, 1), new Object[] { "BBB", "BPB", "BBB", 'P', ModTools.titaniumPickaxe, 'M', 'B', new ItemStack(ModBlocks.breaker, 1, 0), }));
  31.         GameRegistry.addRecipe(new ItemStack(ModBlocks.titanium_block),
  32.                 new Object[] { "TTT", "TTT", "TTT", 'T', "ingotTitanium" });
  33.         GameRegistry.addRecipe(new ItemStack(ModBlocks.black_titanium_block),
  34.                 new Object[] { "TTT", "TTT", "TTT", 'T', ModItems.blacktitaniumIngot });
  35.  
  36.         registerToolRecipe(ModItems.titaniumIngot, ModItems.blacktitaniumStick, ModTools.titaniumPickaxe, ModTools.titaniumAxe, ModTools.titaniumShovel, ModTools.titaniumHoe, ModCombat.titaniumSword);
  37.         registerArmorRecipe("ingotTitanium", ModArmor.TitaniumHelmet, ModArmor.TitaniumChestplate, ModArmor.TitaniumLeggings, ModArmor.TitaniumBoots);
  38.        
  39.         Utils.getLogger().info("Registered Crafting Recipes!");
  40.     }
  41.  
  42.     public static void registerSmeltingRecipes() {
  43.         GameRegistry.addSmelting(ModBlocks.titanium_ore, new ItemStack(ModItems.titaniumIngot), 2.0F);
  44.         GameRegistry.addSmelting(ModBlocks.black_titanium_ore, new ItemStack(ModItems.blacktitaniumIngot), 2.0F);
  45.         Utils.getLogger().info("Registered Furnace Recipes!");
  46.     }
  47.  
  48.  
  49.     /**
  50.      * Registers a tool using the ingot
  51.      * @param ingot The ingot
  52.      * @param pickaxe The pickaxe
  53.      * @param axe The axe
  54.      * @param shovel The shovel
  55.      * @param hoe The hoe
  56.      * @param sword The sword
  57.      */
  58.     private static void registerToolRecipe(Item ingot, Item stick, Item pickaxe, Item axe, Item shovel, Item hoe, Item sword) {
  59.         GameRegistry.addRecipe(new ItemStack(pickaxe), new Object[] { "III", " S ", " S ", 'I', ingot, 'S', stick });
  60.         GameRegistry.addRecipe(new ItemStack(axe), new Object[] { "II ", "IS ", " S ", 'I', ingot, 'S', stick });
  61.         GameRegistry.addRecipe(new ItemStack(axe), new Object[] { " II", " SI", " S ", 'I', ingot, 'S', stick });
  62.         GameRegistry.addRecipe(new ItemStack(shovel), new Object[] { " I ", " S ", " S ", 'I', ingot, 'S', stick });
  63.         GameRegistry.addRecipe(new ItemStack(hoe), new Object[] { " II", " S ", " S ", 'I', ingot, 'S', stick });
  64.         GameRegistry.addRecipe(new ItemStack(hoe), new Object[] { "II ", " S ", " S ", 'I', ingot, 'S', stick });
  65.         GameRegistry.addRecipe(new ItemStack(sword), new Object[] { " I ", " I ", " S ", 'I', ingot, 'S', stick });
  66.     }
  67.    
  68.     /**
  69.      * Registers a tool using the ingot from the {@link OreDictionary}
  70.      * @param ingotOD The ingot from the {@link OreDictionary}
  71.      * @param pickaxe The pickaxe
  72.      * @param axe The axe
  73.      * @param shovel The shovel
  74.      * @param hoe The hoe
  75.      * @param sword The sword
  76.      * @param stickOD The stick from the {@link OreDictionary}
  77.      */
  78.     private static void registerToolRecipe(String ingotOD, Item pickaxe, Item axe, Item shovel, Item hoe, Item sword, String stickOD) {
  79.         GameRegistry.addRecipe(new ShapedOreRecipe(pickaxe, new Object[] { "III", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
  80.         GameRegistry.addRecipe(new ShapedOreRecipe(axe, new Object[] { "II ", "IS ", " S ", 'I', ingotOD, 'S', stickOD }));
  81.         GameRegistry.addRecipe(new ShapedOreRecipe(axe, new Object[] { " II", " SI", " S ", 'I', ingotOD, 'S', stickOD }));
  82.         GameRegistry.addRecipe(new ShapedOreRecipe(shovel, new Object[] { " I ", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
  83.         GameRegistry.addRecipe(new ShapedOreRecipe(hoe, new Object[] { " II", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
  84.         GameRegistry.addRecipe(new ShapedOreRecipe(hoe, new Object[] { "II ", " S ", " S ", 'I', ingotOD, 'S', stickOD }));
  85.         GameRegistry.addRecipe(new ShapedOreRecipe(sword, new Object[] { " I ", " I ", " S ", 'I', ingotOD, 'S', stickOD }));
  86.     }
  87.    
  88.     /**
  89.      * Registers Armor using the ingot
  90.      * @param ingot The ingot
  91.      * @param helmet The helmet
  92.      * @param chestplate The chestplate
  93.      * @param leggings The leggings
  94.      * @param boots The boots
  95.      */
  96.     public static void registerArmorRecipe(Item ingot, Item helmet, Item chestplate, Item leggings, Item boots) {
  97.         GameRegistry.addRecipe(new ItemStack(helmet), new Object[] { "III","I I","   ",'I',ingot});
  98.         GameRegistry.addRecipe(new ItemStack(helmet), new Object[] { "   ","III","I I",'I',ingot});
  99.         GameRegistry.addRecipe(new ItemStack(chestplate), new Object[] { "I I","III","III",'I',ingot});
  100.         GameRegistry.addRecipe(new ItemStack(leggings), new Object[] { "III","I I","I I",'I',ingot});
  101.         GameRegistry.addRecipe(new ItemStack(boots), new Object[] { "I I","I I","   ",'I',ingot});
  102.         GameRegistry.addRecipe(new ItemStack(boots), new Object[] { "   ","I I","I I",'I',ingot});
  103.     }
  104.    
  105.     /**
  106.      * Registers Armor using the ingot from the {@link OreDictionary}
  107.      * @param ingotOD The ingot from the {@link OreDictionary}
  108.      * @param helmet The helmet
  109.      * @param chestplate The chestplate
  110.      * @param leggings The leggings
  111.      * @param boots The boots
  112.      */
  113.     public static void registerArmorRecipe(String ingotOD, Item helmet, Item chestplate, Item leggings, Item boots) {
  114.         GameRegistry.addRecipe(new ShapedOreRecipe(helmet, new Object[] { "III","I I","   ",'I',ingotOD}));
  115.         GameRegistry.addRecipe(new ShapedOreRecipe(helmet, new Object[] { "   ","III","I I",'I',ingotOD}));
  116.         GameRegistry.addRecipe(new ShapedOreRecipe(chestplate, new Object[] { "I I","III","III",'I',ingotOD}));
  117.         GameRegistry.addRecipe(new ShapedOreRecipe(leggings, new Object[] { "III","I I","I I",'I',ingotOD}));
  118.         GameRegistry.addRecipe(new ShapedOreRecipe(boots, new Object[] { "I I","I I","   ",'I',ingotOD}));
  119.         GameRegistry.addRecipe(new ShapedOreRecipe(boots, new Object[] { "   ","I I","I I",'I',ingotOD}));
  120.     }
  121.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement