11package betterwithaddons .interaction ;
22
33import betterwithaddons .handler .StumpingHandler ;
4- import betterwithaddons .util .BlockMeta ;
4+ import betterwithmods .BWMBlocks ;
5+ import betterwithmods .config .BWConfig ;
6+ import betterwithmods .craft .BlockMetaRecipe ;
7+ import betterwithmods .craft .KilnInteraction ;
8+ import betterwithmods .craft .SawInteraction ;
9+ import betterwithmods .items .ItemMaterial ;
10+ import betterwithmods .util .InvUtils ;
511import net .minecraft .block .BlockPlanks ;
612import net .minecraft .init .Blocks ;
13+ import net .minecraft .init .Items ;
14+ import net .minecraft .item .Item ;
15+ import net .minecraft .item .ItemBlock ;
16+ import net .minecraft .item .ItemStack ;
717import net .minecraftforge .common .MinecraftForge ;
818
919import java .util .Arrays ;
@@ -13,6 +23,8 @@ public class InteractionBTWTweak implements IInteraction {
1323 public static boolean ENABLED = true ;
1424 public static boolean HARD_STUMPS = true ;
1525 public static boolean SOFT_WOODS = true ;
26+ public static boolean SAW_RECYCLING = true ;
27+ public static boolean KILN_DOUBLING = true ;
1628
1729 @ Override
1830 public boolean isActive () {
@@ -48,10 +60,67 @@ public void init() {
4860 StumpingHandler .addSoftWood (Blocks .LOG ,BlockPlanks .EnumType .JUNGLE .getMetadata (),1.0f );
4961 StumpingHandler .addSoftWood (Blocks .LOG2 ,BlockPlanks .EnumType .DARK_OAK .getMetadata () - 4 ,1.3f );
5062 }
63+
64+ if (SAW_RECYCLING )
65+ {
66+ SawInteraction .INSTANCE .addRecipe (Blocks .BOOKSHELF ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .OAK .getMetadata ()),new ItemStack (Items .BOOK ,3 ));
67+ SawInteraction .INSTANCE .addRecipe (Blocks .CHEST ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 6 , BlockPlanks .EnumType .OAK .getMetadata ()));
68+ SawInteraction .INSTANCE .addRecipe (Blocks .JUKEBOX ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 6 , BlockPlanks .EnumType .OAK .getMetadata ()),new ItemStack (Items .DIAMOND ,1 ));
69+ SawInteraction .INSTANCE .addRecipe (Blocks .LADDER ,0 ,new ItemStack (Items .STICK ,2 ));
70+ SawInteraction .INSTANCE .addRecipe (Blocks .NOTEBLOCK ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 6 , BlockPlanks .EnumType .OAK .getMetadata ()),new ItemStack (Items .REDSTONE ,1 ));
71+ SawInteraction .INSTANCE .addRecipe (Blocks .TRAPDOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 2 , BlockPlanks .EnumType .OAK .getMetadata ()));
72+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .AXLE ,0 ,new ItemStack (BWMBlocks .WOOD_CORNER , 2 , BlockPlanks .EnumType .OAK .getMetadata ()),new ItemStack (BWMBlocks .ROPE ,1 ));
73+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .BELLOWS ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 2 , BlockPlanks .EnumType .OAK .getMetadata ()), ItemMaterial .getMaterial ("leather_belt" ), ItemMaterial .getMaterial ("gear" ), ItemMaterial .getMaterial ("tanned_leather_cut" ,3 ));
74+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .GEARBOX ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 3 , BlockPlanks .EnumType .OAK .getMetadata ()), ItemMaterial .getMaterial ("gear" ,3 ), ItemMaterial .getMaterial ("redstone_latch" ));
75+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .SINGLE_MACHINES ,4 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .OAK .getMetadata ()), ItemMaterial .getMaterial ("gear" ,1 ), new ItemStack (Blocks .WOODEN_PRESSURE_PLATE ,1 ));
76+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .PLATFORM ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .OAK .getMetadata ()), new ItemStack (BWMBlocks .PANE ,2 ,2 ));
77+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .SINGLE_MACHINES ,1 ,new ItemStack (BWMBlocks .WOOD_SIDING , 3 , BlockPlanks .EnumType .OAK .getMetadata ()), new ItemStack (Items .IRON_INGOT ), ItemMaterial .getMaterial ("gear" ), ItemMaterial .getMaterial ("redstone_latch" ));
78+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .SAW ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 1 , BlockPlanks .EnumType .OAK .getMetadata ()), ItemMaterial .getMaterial ("leather_belt" ), ItemMaterial .getMaterial ("gear" ), new ItemStack (Items .IRON_INGOT , 2 ));
79+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .PUMP ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 3 , BlockPlanks .EnumType .OAK .getMetadata ()), ItemMaterial .getMaterial ("screw" ), new ItemStack (BWMBlocks .GRATE , 1 , BlockPlanks .EnumType .OAK .getMetadata ()));
80+
81+ BlockPlanks .EnumType [] woodtypes = BlockPlanks .EnumType .values ();
82+ int len = woodtypes .length ;
83+
84+ for (int i = 0 ; i < len ; ++i ) {
85+ BlockPlanks .EnumType woodtype = woodtypes [i ];
86+
87+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .WOOD_BENCH ,woodtype .getMetadata (),new ItemStack (BWMBlocks .WOOD_CORNER , 2 , woodtype .getMetadata ()));
88+ SawInteraction .INSTANCE .addRecipe (BWMBlocks .WOOD_TABLE ,woodtype .getMetadata (),new ItemStack (BWMBlocks .WOOD_CORNER , 3 , woodtype .getMetadata ()));
89+ }
90+
91+ SawInteraction .INSTANCE .addRecipe (Blocks .OAK_DOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .OAK .getMetadata ()));
92+ SawInteraction .INSTANCE .addRecipe (Blocks .BIRCH_DOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .BIRCH .getMetadata ()));
93+ SawInteraction .INSTANCE .addRecipe (Blocks .SPRUCE_DOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .SPRUCE .getMetadata ()));
94+ SawInteraction .INSTANCE .addRecipe (Blocks .JUNGLE_DOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .JUNGLE .getMetadata ()));
95+ SawInteraction .INSTANCE .addRecipe (Blocks .ACACIA_DOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .ACACIA .getMetadata ()));
96+ SawInteraction .INSTANCE .addRecipe (Blocks .DARK_OAK_DOOR ,0 ,new ItemStack (BWMBlocks .WOOD_SIDING , 4 , BlockPlanks .EnumType .DARK_OAK .getMetadata ()));
97+
98+ SawInteraction .INSTANCE .addRecipe (Blocks .OAK_FENCE_GATE ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .OAK .getMetadata ()));
99+ SawInteraction .INSTANCE .addRecipe (Blocks .BIRCH_FENCE_GATE ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .BIRCH .getMetadata ()));
100+ SawInteraction .INSTANCE .addRecipe (Blocks .SPRUCE_FENCE_GATE ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .SPRUCE .getMetadata ()));
101+ SawInteraction .INSTANCE .addRecipe (Blocks .JUNGLE_FENCE_GATE ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .JUNGLE .getMetadata ()));
102+ SawInteraction .INSTANCE .addRecipe (Blocks .ACACIA_FENCE_GATE ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .ACACIA .getMetadata ()));
103+ SawInteraction .INSTANCE .addRecipe (Blocks .DARK_OAK_FENCE_GATE ,0 ,new ItemStack (BWMBlocks .WOOD_MOULDING , 3 , BlockPlanks .EnumType .DARK_OAK .getMetadata ()));
104+ }
51105 }
52106
53107 @ Override
54108 public void postInit () {
55-
109+ if (KILN_DOUBLING && BWConfig .canKilnSmeltOres )
110+ {
111+ InvUtils .oreNames .forEach (ore -> {
112+ if (ore .getItem () instanceof ItemBlock )
113+ {
114+ BlockMetaRecipe recipe = KilnInteraction .INSTANCE .getRecipe (ore );
115+ List <ItemStack > outputs = recipe .getOutputs ();
116+ if (outputs .size () > 0 )
117+ {
118+ ItemStack output = outputs .get (0 ).copy ();
119+ output .stackSize = 2 ;
120+ outputs .set (0 ,output );
121+ }
122+ }
123+ });
124+ }
56125 }
57126}
0 commit comments