2014-12-15 00:11:48 +00:00
package com.cricketcraft.chisel ;
import com.cricketcraft.chisel.init.ModBlocks ;
import com.cricketcraft.chisel.init.ModItems ;
2014-04-21 19:13:15 +01:00
import net.minecraft.block.Block ;
import net.minecraft.init.Blocks ;
import net.minecraft.init.Items ;
import net.minecraft.item.ItemStack ;
import net.minecraft.item.crafting.FurnaceRecipes ;
2014-07-12 11:54:00 +01:00
import net.minecraftforge.oredict.OreDictionary ;
import net.minecraftforge.oredict.ShapedOreRecipe ;
import net.minecraftforge.oredict.ShapelessOreRecipe ;
2014-12-14 20:05:39 +00:00
import cpw.mods.fml.common.registry.GameRegistry ;
2014-04-21 19:13:15 +01:00
2014-11-30 18:02:58 -05:00
public class Crafting {
2014-04-21 19:13:15 +01:00
2014-11-30 18:02:58 -05:00
public static void init () {
2014-07-17 22:05:29 +01:00
Block concreteRecipeBlock = Block . getBlockFromName ( Configurations . config . get ( "tweaks" , "concrete recipe block" , "gravel" , "Unlocalized name of the block that, when burned, will produce concrete (examples: lightgem, stone)" ). getString ());
2014-11-30 18:02:58 -05:00
if ( concreteRecipeBlock == null ) concreteRecipeBlock = Blocks . gravel ;
2014-04-21 19:13:15 +01:00
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "concrete" ))
FurnaceRecipes . smelting (). func_151393_a ( concreteRecipeBlock , new ItemStack ( ModBlocks . concrete ), 0 . 1F );
if ( Configurations . featureEnabled ( "sandstoneScribbles" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . sandstoneScribbles , 1 ), new Object [] { "X" , 'X' , new ItemStack ( ModBlocks . sandstone , 1 , 8 ),});
2014-11-30 18:02:58 -05:00
for ( int meta = 0 ; meta < 16 ; meta ++ ) {
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "marble" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . marbleSlab , 6 , 0 ), new Object [] { "***" , '*' , new ItemStack ( ModBlocks . marble , 1 , meta )});
if ( Configurations . featureEnabled ( "limestone" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . limestoneSlab , 6 , 0 ), new Object [] { "***" , '*' , new ItemStack ( ModBlocks . limestone , 1 , meta )});
if ( Configurations . featureEnabled ( "marblePillar" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . marblePillarSlab , 6 , 0 ), new Object [] { "***" , '*' , new ItemStack ( ModBlocks . marblePillar , 1 , meta )});
if ( Configurations . featureEnabled ( "marblePillar" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . marblePillar , 6 ), new Object [] { "XX" , "XX" , "XX" , 'X' , new ItemStack ( ModBlocks . marble , 1 , meta ),});
if ( Configurations . featureEnabled ( "marble" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . marble , 4 ), new Object [] { "XX" , "XX" , 'X' , new ItemStack ( ModBlocks . marblePillar , 1 , meta ),});
if ( Configurations . featureEnabled ( "icePillar" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . icePillar , 6 , 1 ), new Object [] { "XX" , "XX" , "XX" , 'X' , new ItemStack ( ModBlocks . ice , 1 , meta ),});
if ( Configurations . featureEnabled ( "ice" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . ice , 4 , 1 ), new Object [] { "XX" , "XX" , 'X' , new ItemStack ( ModBlocks . icePillar , 1 , meta ),});
if ( Configurations . featureEnabled ( "sandstone" ))
GameRegistry . addRecipe ( new ItemStack ( Blocks . sandstone , 1 , 1 ), new Object [] { "X" , 'X' , new ItemStack ( ModBlocks . sandstoneScribbles , 1 , meta ),});
if ( Configurations . featureEnabled ( "carpet" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . carpet , 8 , meta ), new Object [] { "YYY" , "YXY" , "YYY" , 'X' , new ItemStack ( Items . string , 1 ), 'Y' , new ItemStack ( Blocks . wool , 1 , meta ),});
if ( Configurations . featureEnabled ( "carpetFloor" ))
2014-10-28 21:10:08 -04:00
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . carpetFloor , 3 , meta ), new Object [] { "XX" , 'X' , new ItemStack ( ModBlocks . carpet , 1 , meta ),});
2014-04-21 19:13:15 +01:00
}
2014-09-14 19:49:24 +02:00
// The following recipe is due to bugs with Chisel 1.5.1 to 1.5.6a
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "sandstone" ))
GameRegistry . addRecipe ( new ItemStack ( Blocks . sandstone , 1 , 0 ), new Object [] { "X" , 'X' , new ItemStack ( ModBlocks . sandstone , 1 , 0 ),});
2014-09-14 19:49:24 +02:00
// The following recipe is due to bug with Chisel 1.5.6b
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "sandstone" ))
GameRegistry . addRecipe ( new ItemStack ( Blocks . sandstone , 1 , 1 ), new Object [] { "X" , 'X' , new ItemStack ( ModBlocks . sandstone , 1 , 1 ),});
if ( Configurations . featureEnabled ( "holystone" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . holystone , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . feather , 1 )});
2014-12-15 00:49:32 +00:00
if ( Configurations . featureEnabled ( "grimstone" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . grimstone , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . coal , 1 )});
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "lavastone" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . lavastone , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . lava_bucket , 1 )});
if ( Configurations . featureEnabled ( "waterstone" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . waterstone , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . water_bucket , 1 )});
if ( Configurations . featureEnabled ( "fantasy" ))
2014-12-15 00:49:32 +00:00
{
2014-12-08 16:26:02 -05:00
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . fantasy , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . gold_nugget , 1 )});
2014-12-15 00:49:32 +00:00
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModBlocks . fantasy2 , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( ModBlocks . fantasy , 1 ), 'X' , "dyeWhite" }));
}
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "futuristicArmorPlating" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . tyrian , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . iron_ingot , 1 )});
if ( Configurations . featureEnabled ( "templeBlock" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . temple , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . dye , 1 , 4 )});
if ( Configurations . featureEnabled ( "factory" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . factory , Configurations . factoryBlockAmount , 0 ), new Object [] { "*X*" , "X X" , "*X*" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . iron_ingot , 1 )});
if ( Configurations . featureEnabled ( "voidstone" ))
2014-12-15 00:49:32 +00:00
{
2014-12-14 10:48:30 +00:00
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . voidstone , 8 , 1 ), new Object [] { "oxo" , "xyx" , "oxo" , 'x' , new ItemStack ( Blocks . stone , 1 ), 'y' , new ItemStack ( Items . ender_pearl , 1 ), 'o' , new ItemStack ( Blocks . obsidian , 1 )});
2014-12-15 00:49:32 +00:00
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . voidstone2 , 8 , 1 ), new Object [] { "oxo" , "xyx" , "oxo" , 'x' , new ItemStack ( Blocks . stone , 1 ), 'y' , new ItemStack ( Items . ender_eye , 1 ), 'o' , new ItemStack ( Blocks . obsidian , 1 )});
}
2014-04-21 19:13:15 +01:00
2014-10-28 21:10:08 -04:00
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModBlocks . roadLine , 8 , 0 ), new Object [] { "wrw" , "wrw" , "wrw" , ( 'w' ), "dyeWhite" , ( 'r' ), Items . redstone }));
2014-04-21 19:13:15 +01:00
2014-11-30 18:02:58 -05:00
if ( Configurations . chiselRecipe ) {
2014-10-31 19:47:22 -04:00
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModItems . chisel , 1 ), new Object [] { " YY" , " YY" , "X " , 'X' , Items . stick , 'Y' , Items . iron_ingot }));
2014-11-30 18:02:58 -05:00
} else {
2014-10-31 19:47:22 -04:00
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModItems . chisel , 1 ), new Object [] { " Y" , "X " , 'X' , Items . stick , 'Y' , Items . iron_ingot }));
2014-04-21 19:13:15 +01:00
}
2014-11-30 18:02:58 -05:00
if ( Configurations . featureEnabled ( "ballOfMoss" ))
2014-10-28 21:10:08 -04:00
GameRegistry . addRecipe ( new ItemStack ( ModItems . itemBallOMoss , 1 ), new Object [] { "XYX" , "YXY" , "XYX" , 'X' , Blocks . vine , 'Y' , Items . stick });
2014-11-30 18:02:58 -05:00
if ( Configurations . featureEnabled ( "cloud" ))
2014-10-28 21:10:08 -04:00
GameRegistry . addRecipe ( new ItemStack ( ModItems . itemCloudInABottle , 1 ), new Object [] { "X X" , "XYX" , " X " , 'X' , Blocks . glass , 'Y' , Items . quartz });
2014-11-27 13:07:59 -05:00
if ( Configurations . featureEnabled ( "smashingrock" ))
GameRegistry . addShapelessRecipe ( new ItemStack ( ModItems . smashingRock , 16 ), new Object [] { new ItemStack ( Items . stone_pickaxe ), new ItemStack ( Items . glass_bottle , 1 ), new ItemStack ( Items . stone_shovel )});
2014-04-21 19:13:15 +01:00
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "paperWall" ))
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModBlocks . paperWall , 8 ), new Object [] { "ppp" , "psp" , "ppp" , ( 'p' ), Items . paper , ( 's' ), "stickWood" }));
2014-07-12 11:54:00 +01:00
String [] sGNames = new String [] {
"White" , "Orange" , "Magenta" , "Light Blue" ,
"Yellow" , "Lime" , "Pink" , "Gray" ,
"Light Gray" , "Cyan" , "Purple" , "Blue" ,
"Brown" , "Green" , "Red" , "Black"
};
2014-11-30 18:02:58 -05:00
for ( int i = 0 ; i < 16 ; i ++ ) {
2014-07-12 11:54:00 +01:00
OreDictionary . registerOre ( "stainedClay" + sGNames [ i ] . replaceAll ( " " , "" ), new ItemStack ( Blocks . stained_hardened_clay , 1 , i ));
OreDictionary . registerOre ( "blockWool" + sGNames [ i ] . replaceAll ( " " , "" ), new ItemStack ( Blocks . wool , 1 , i ));
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "woolenClay" ))
GameRegistry . addRecipe ( new ShapelessOreRecipe ( new ItemStack ( ModBlocks . woolenClay , 2 , i ), new Object [] { "blockWool" + sGNames [ i ] . replaceAll ( " " , "" ), "stainedClay" + sGNames [ i ] . replaceAll ( " " , "" )}));
2014-07-12 11:54:00 +01:00
}
2014-12-08 16:26:02 -05:00
if ( Configurations . featureEnabled ( "laboratory" ))
GameRegistry . addRecipe ( new ItemStack ( ModBlocks . laboratory , 8 , 0 ), new Object [] { "***" , "*X*" , "***" , '*' , new ItemStack ( Blocks . stone , 1 ), 'X' , new ItemStack ( Items . quartz , 1 )});
2014-07-12 11:54:00 +01:00
2014-12-08 16:26:02 -05:00
if ( Configurations . autoChisel )
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModBlocks . autoChisel , 1 ), new Object [] { "XXX" , "XYX" , "XXX" , Character . valueOf ( 'X' ), "plankWood" , Character . valueOf ( 'Y' ), ModItems . chisel }));
2014-12-08 16:42:43 -05:00
if ( Configurations . featureEnabled ( "hexPlating" ))
GameRegistry . addRecipe ( new ShapedOreRecipe ( new ItemStack ( ModBlocks . hexPlating , 1 ), new Object [] { "XXX" , "XYX" , "XXX" , 'X' , "stone" , 'Y' , "blockCoal" }));
2014-04-21 19:13:15 +01:00
}
}