-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathIERecipes.java
More file actions
506 lines (439 loc) · 26.3 KB
/
IERecipes.java
File metadata and controls
506 lines (439 loc) · 26.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
package tnfcmod.recipes;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import javax.annotation.Nullable;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import blusunrize.immersiveengineering.api.ApiUtils;
import blusunrize.immersiveengineering.api.ComparableItemStack;
import blusunrize.immersiveengineering.api.crafting.ArcFurnaceRecipe;
import blusunrize.immersiveengineering.api.crafting.CrusherRecipe;
import blusunrize.immersiveengineering.api.crafting.IngredientStack;
import blusunrize.immersiveengineering.api.crafting.MetalPressRecipe;
import blusunrize.immersiveengineering.api.tool.BelljarHandler;
import blusunrize.immersiveengineering.common.IEContent;
import blusunrize.immersiveengineering.common.blocks.plant.BlockIECrop;
import com.eerussianguy.firmalife.registry.BlocksFL;
import com.eerussianguy.firmalife.registry.ItemsFL;
import com.eerussianguy.firmalife.init.FoodFL;
import com.pyraliron.advancedtfctech.crafting.GristMillRecipe;
import net.dries007.tfc.api.capability.food.CapabilityFood;
import net.dries007.tfc.api.recipes.quern.QuernRecipe;
import net.dries007.tfc.api.registries.TFCRegistries;
import net.dries007.tfc.api.types.ICrop;
import net.dries007.tfc.api.types.Metal;
import net.dries007.tfc.api.types.Ore;
import net.dries007.tfc.api.types.Rock;
import net.dries007.tfc.objects.Powder;
import net.dries007.tfc.objects.blocks.BlocksTFC;
import net.dries007.tfc.objects.blocks.agriculture.BlockCropSimple;
import net.dries007.tfc.objects.blocks.agriculture.BlockCropTFC;
import net.dries007.tfc.objects.blocks.stone.BlockOreTFC;
import net.dries007.tfc.objects.fluids.FluidsTFC;
import net.dries007.tfc.objects.inventory.ingredient.IIngredient;
import net.dries007.tfc.objects.items.ItemPowder;
import net.dries007.tfc.objects.items.ItemSeedsTFC;
import net.dries007.tfc.objects.items.food.ItemFoodTFC;
import net.dries007.tfc.objects.items.metal.ItemMetal;
import net.dries007.tfc.objects.items.metal.ItemOreTFC;
import net.dries007.tfc.util.agriculture.Crop;
import net.dries007.tfc.util.agriculture.Food;
import tnfcmod.objects.items.TNFCItems;
import static blusunrize.immersiveengineering.api.tool.BelljarHandler.*;
import static net.dries007.tfc.api.types.Metal.ItemType.*;
public class IERecipes
{
private static final DefaultPlantHandler tfcBelljarHandler = new DefaultPlantHandler()
{
private HashMap<ComparableItemStack, IngredientStack> seedSoilMap = new HashMap();
private HashMap<ComparableItemStack, ItemStack[]> seedOutputMap = new HashMap();
private HashMap<ComparableItemStack, IBlockState[]> seedRenderMap = new HashMap();
private HashSet<ComparableItemStack> validSeeds = new HashSet<>();
@Override
@SideOnly(Side.CLIENT)
public float getRenderSize(ItemStack seed, ItemStack soil, float growth, TileEntity tile)
{
return .6675f;
}
@Override
protected HashSet<ComparableItemStack> getSeedSet() {return validSeeds;}
@Override
public boolean isValid(ItemStack seed)
{
return seed != null && this.getSeedSet().contains(new ComparableItemStack(seed, false, false));
}
@Override
public boolean isCorrectSoil(final ItemStack seed, final ItemStack soil)
{
IngredientStack reqSoil = (IngredientStack) this.seedSoilMap.get(new ComparableItemStack(seed, false, false));
return reqSoil.matchesItemStack(soil);
}
@Override
public ItemStack[] getOutput(ItemStack seed, ItemStack soil, TileEntity tile)
{
return (ItemStack[]) this.seedOutputMap.get(new ComparableItemStack(seed, false, false));
}
@Override
@SideOnly(Side.CLIENT)
public IBlockState[] getRenderedPlant(ItemStack seed, ItemStack soil, float growth, TileEntity tile)
{
// Will need to handle vanilla crops? IE Hemp in particular
IBlockState[] states = (IBlockState[]) this.seedRenderMap.get(new ComparableItemStack(seed, false, false));
//IBlockState[] states = null;
if (states == null)
{
return null;
}
else
{
IBlockState[] ret = new IBlockState[states.length];
label58:
for (int i = 0; i < states.length; ++i)
{
if (states[i] != null)
{
if (states[i].getBlock() instanceof BlockCrops)
{
int max = ((BlockCrops) states[i].getBlock()).getMaxAge();
ret[i] = ((BlockCrops) states[i].getBlock()).withAge(Math.min(max, Math.round((float) max * growth)));
}
else if (states[i].getBlock() instanceof BlockCropTFC)
{
BlockCropTFC bs = (BlockCropTFC) states[i].getBlock();
ICrop crop = bs.getCrop();
int curStage = states[i].getValue(bs.getStageProperty());
int maxStage = crop.getMaxStage();
int age = Math.min(maxStage, Math.round(growth * maxStage));
return new IBlockState[] {states[i].getBlock().getStateFromMeta(age)};
}
//IE Block
else if (states[i].getBlock() instanceof BlockIECrop)
{
int age = Math.min(4, Math.round(growth * 4));
if (age == 4)
return new IBlockState[] {states[i].getBlock().getStateFromMeta(age), states[i].getBlock().getStateFromMeta(age + 1)};
return new IBlockState[] {states[i].getBlock().getStateFromMeta(age)};
}
else
{
Iterator var8 = states[i].getPropertyKeys().iterator();
while (true)
{
IProperty prop;
do
{
do
{
if (!var8.hasNext())
{
if (ret[i] == null)
{
ret[i] = states[i];
}
continue label58;
}
prop = (IProperty) var8.next();
} while (!"age".equals(prop.getName()));
} while (!(prop instanceof PropertyInteger));
int maxx = 0;
Iterator var11 = ((PropertyInteger) prop).getAllowedValues().iterator();
while (var11.hasNext())
{
Integer allowed = (Integer) var11.next();
if (allowed != null && allowed > maxx)
{
maxx = allowed;
}
}
ret[i] = states[i].withProperty(prop, Math.min(maxx, Math.round((float) maxx * growth)));
}
}
}
}
return ret;
}
}
@Override
public void register(ItemStack seed, ItemStack[] output, Object soil, IBlockState... render)
{
this.register(seed, output, ApiUtils.createIngredientStack(soil), render);
}
public void register(ItemStack seed, ItemStack[] output, IngredientStack soil, IBlockState... render)
{
ComparableItemStack comp = new ComparableItemStack(seed, false, false);
this.getSeedSet().add(comp);
this.seedSoilMap.put(comp, soil);
this.seedOutputMap.put(comp, output);
this.seedRenderMap.put(comp, render);
}
};
public static void registerMetalPressRecipes()
{
//Mold recipes
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_blank, 1), "sheetDoubleSteel", new ItemStack(IEContent.blockStorage, 1, 8), 2400);
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_block, 1), "blockSteel", new ItemStack(TNFCItems.mold_blank, 1), 2400);
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_doubleingot, 1), "ingotDoubleSteel", new ItemStack(TNFCItems.mold_blank, 1), 2400);
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_sheet, 1), "sheetSteel", new ItemStack(TNFCItems.mold_blank, 1), 2400);
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_bucket, 1), "bucketRedSteel", new ItemStack(TNFCItems.mold_blank, 1), 2400);
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_bucket, 1), "bucketBlueSteel", new ItemStack(TNFCItems.mold_blank, 1), 2400);
Ingredient ingredientVanillaBucket = Ingredient.fromStacks(new ItemStack(Items.BUCKET));
MetalPressRecipe.addRecipe(new ItemStack(TNFCItems.mold_bucket, 1), ingredientVanillaBucket, new ItemStack(TNFCItems.mold_blank, 1), 2400);
//Need some block recipes to create sandstone. Let's try it
MetalPressRecipe.addRecipe(new ItemStack(Blocks.SANDSTONE, 1), "sand", new ItemStack(TNFCItems.mold_block), 2400).setInputSize(9);
for (Metal metal : TFCRegistries.METALS.getValuesCollection())
{
// are there non-tool metals that we want sheets/doubles from? :: **yes**
ItemStack outputDoubleIngot = new ItemStack(ItemMetal.get(metal, Metal.ItemType.DOUBLE_INGOT), 1);
ItemStack outputSheet = new ItemStack(ItemMetal.get(metal, Metal.ItemType.SHEET), 1);
ItemStack outputDoubleSheet = new ItemStack(ItemMetal.get(metal, Metal.ItemType.DOUBLE_SHEET), 1);
ItemStack emptyReturn = new ItemStack(Items.AIR, 1);
Ingredient ingredientIngot = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.INGOT)));
Ingredient ingredientDoubleIngot = Ingredient.fromStacks(outputDoubleIngot);
Ingredient ingredientSheet = Ingredient.fromStacks(outputSheet);
Ingredient ingredientDoubleSheet = Ingredient.fromStacks(outputDoubleSheet);
if (!outputDoubleIngot.isEmpty()){
MetalPressRecipe.addRecipe(outputDoubleIngot, ingredientIngot, new ItemStack(TNFCItems.mold_doubleingot), 2400).setInputSize(2);
MetalPressRecipe.addRecipe(outputSheet, ingredientIngot, new ItemStack(TNFCItems.mold_sheet), 2400).setInputSize(2);
MetalPressRecipe.addRecipe(outputSheet, ingredientDoubleIngot, new ItemStack(TNFCItems.mold_sheet), 2400);
MetalPressRecipe.addRecipe(outputDoubleSheet, ingredientSheet, new ItemStack(TNFCItems.mold_sheet), 2400).setInputSize(2);
}
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.TRAPDOOR), 1), ingredientSheet, new ItemStack(ItemMetal.get(Metal.STEEL, Metal.ItemType.TRAPDOOR), 1), 2400);
if (metal.isToolMetal())
{
Ingredient ingredientKnives = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.KNIFE_BLADE)));
//Sheets and doubles
//Tools
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.AXE_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_axe), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.CHISEL_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_chisel), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.HAMMER_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_hammer), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.HOE_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_hoe), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.JAVELIN_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_javelin), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.KNIFE_BLADE), 1), ingredientIngot, new ItemStack(TNFCItems.mold_knife), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.LAMP), 1), ingredientIngot, new ItemStack(TNFCItems.mold_lamp), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.MACE_HEAD), 1), ingredientDoubleIngot, new ItemStack(TNFCItems.mold_mace), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.MACE_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_mace), 2400).setInputSize(2);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.PICK_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_pick), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.PROPICK_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_propick), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SAW_BLADE), 1), ingredientIngot, new ItemStack(TNFCItems.mold_saw), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SCYTHE_BLADE), 1), ingredientIngot, new ItemStack(TNFCItems.mold_scythe), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SHEARS), 1), ingredientKnives, new ItemStack(TNFCItems.mold_shears), 2400).setInputSize(2);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SHOVEL_HEAD), 1), ingredientIngot, new ItemStack(TNFCItems.mold_shovel), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SWORD_BLADE), 1), ingredientDoubleIngot, new ItemStack(TNFCItems.mold_sword), 2400);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SWORD_BLADE), 1), ingredientIngot, new ItemStack(TNFCItems.mold_sword), 2400).setInputSize(2);
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.TUYERE), 1), ingredientDoubleSheet, new ItemStack(TNFCItems.mold_tuyere), 2400).setInputSize(1);
if (metal == Metal.RED_STEEL | metal == Metal.BLUE_STEEL)
{
MetalPressRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, Metal.ItemType.BUCKET), 1), ingredientSheet, new ItemStack(TNFCItems.mold_bucket), 2400);
}
}
}
}
public static void registerGristMillRecipes() {
IngredientStack ingredientPumpkin = new IngredientStack(new ItemStack(BlocksFL.PUMPKIN_FRUIT,1));
GristMillRecipe.addRecipe(new ItemStack(ItemsFL.getFood(FoodFL.PUMPKIN_CHUNKS),6), ingredientPumpkin,100,256);
IngredientStack ingredientSoybean = new IngredientStack(new ItemStack(ItemFoodTFC.get(Food.SOYBEAN),1));
GristMillRecipe.addRecipe(new ItemStack(ItemsFL.getFood(FoodFL.GROUND_SOYBEANS),3), ingredientSoybean,100,256);
}
public static void registerCrusherRecipes(){
for (Metal metal : TFCRegistries.METALS.getValuesCollection())
{
//Basic ingot to dust
if (DUST.hasType(metal)){
Ingredient ingredientIngot = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.INGOT)));
CrusherRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, DUST), 1), ingredientIngot, 8000);
}
//Turn scrap into dust. Scrap is the new orepile from 1.7.10.
if (Metal.ItemType.SCRAP.hasType(metal) && DUST.hasType(metal)){
Ingredient ingredientScrap = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SCRAP)));
CrusherRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, DUST), 1), ingredientScrap, 8000);
//Do we want to be able to crush tools/armour/etc to scrap?
}
//pig iron and high carbon steel need to crush to pig iron dust. Also need HC others to crush to dusts
//add our 'fake' weak steel dust recipes to the crusher
if (metal.toString().equals("weak_steel")){
Ingredient ingredientWeakIngot = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.INGOT)));
CrusherRecipe.addRecipe(new ItemStack(TNFCItems.weak_steel_dust, 1), ingredientWeakIngot, 8000);
}
if (metal.toString().equals("weak_blue_steel")){
Ingredient ingredientWeakBlueIngot = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.INGOT)));
CrusherRecipe.addRecipe(new ItemStack(TNFCItems.weak_blue_steel_dust, 1), ingredientWeakBlueIngot, 8000);
}
if (metal.toString().equals("weak_red_steel")){
Ingredient ingredientWeakRedIngot = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.INGOT)));
CrusherRecipe.addRecipe(new ItemStack(TNFCItems.weak_red_steel_dust, 1), ingredientWeakRedIngot, 8000);
}
//Throw your used anvils in the grinder for a satisfying crunch
if (Metal.ItemType.ANVIL.hasType(metal) && DUST.hasType(metal))
{
Ingredient ingredientAnvil = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.ANVIL)));
CrusherRecipe.addRecipe(new ItemStack(ItemMetal.get(metal, DUST), 14), ingredientAnvil, 112000);
}
// add selenite to glowstone recipe, also to quern
}
//Going to add a raw ore block crush to dust recipe. Mostly for AR automining. But also for Silk Touch if it ever appears.
//Crushing an ore to 1 dust is a bonus. Either a double for a normal ore, or 25% for a rich ore.
for (BlockOreTFC blockOreTarget : BlocksTFC.getAllOreBlocks())
{
Ore oreTarget = blockOreTarget.ore;
if (oreTarget.isGraded())
{
Metal metalTarget = oreTarget.getMetal();
if (DUST.hasType(metalTarget))
{
Ingredient blockOreIngredient = Ingredient.fromStacks(new ItemStack(blockOreTarget, 1));
CrusherRecipe.addRecipe(new ItemStack(ItemMetal.get(metalTarget, DUST), 1), blockOreIngredient, 8000);
}
}
if (oreTarget.getMetal() == null){
//Here we deal with coal, kimberlite, other ones. Just going to output the ore. Fugedaboudit.
Ingredient blockOreIngredient = Ingredient.fromStacks(new ItemStack(blockOreTarget, 1));
ItemStack output = new ItemStack(ItemOreTFC.get(oreTarget),1);
CrusherRecipe.addRecipe(output, blockOreIngredient, 8000);
}
}
// Clear out the recipes related
for (QuernRecipe quernRecipe : TFCRegistries.QUERN.getValuesCollection())
{
CrusherRecipe.removeRecipesForOutput(quernRecipe.getOutputs().get(0));
}
// Churn the quern and steal its recipes
for (QuernRecipe quernRecipe : TFCRegistries.QUERN.getValuesCollection())
{
NonNullList<IIngredient<ItemStack>> ingredientlist = quernRecipe.getIngredients();
IIngredient iingredient = ingredientlist.get(0);
NonNullList foo = iingredient.getValidIngredients();
ItemStack input = (ItemStack) foo.get(0);
// if it's a food item we're going to skip it unless we can come up with a food expiry solution.
if (!input.hasCapability(CapabilityFood.CAPABILITY, null)){
Ingredient ingredient = Ingredient.fromStacks(input);
ItemStack output = quernRecipe.getOutputs().get(0);
Item item = output.getItem();
//The IE Crusher is just super-efficient
int amount = Math.min(output.getCount() * 2 + 2, 9);
int meta = output.getMetadata();
ItemStack newoutput = new ItemStack(item, amount, meta);
if (ingredient != null)
{
CrusherRecipe.addRecipe(newoutput, ingredient, amount * 1000);
}
}
}
}
public static void registerGardenClocheRecipes()
{
java.util.List<ItemStack> soils = Lists.newArrayList();
BelljarHandler.registerHandler(tfcBelljarHandler);
BlocksTFC.getAllBlockRockVariants().forEach(x ->
{
if (x.getType() == Rock.Type.DIRT || x.getType() == Rock.Type.GRASS || x.getType() == Rock.Type.FARMLAND)
{
soils.add(new ItemStack(x, 1));
}
});
for (Crop crop : Crop.values())
{
tfcBelljarHandler.register(ItemSeedsTFC.get(crop, 1), new ItemStack[] {new ItemStack(ItemSeedsTFC.get(crop), 1), crop.getFoodDrop(crop.getMaxStage())}, soils, BlockCropSimple.get(crop).getDefaultState());
}
//Hopefully this takes over from the built in handler for hemp and lets it work with Fresh_water and... stuff. Not caring enough to build it's own entire separate handler ffs
tfcBelljarHandler.register(new ItemStack(IEContent.itemSeeds, 1), new ItemStack[] {new ItemStack(IEContent.itemMaterial, 4, 4), new ItemStack(IEContent.itemSeeds, 1)}, soils, IEContent.blockCrop.getDefaultState());
registerFluidFertilizer(new FluidFertilizerHandler()
{
@Override
public boolean isValid(@Nullable FluidStack fertilizer)
{
return fertilizer != null && (fertilizer.getFluid() == FluidsTFC.FRESH_WATER.get() || fertilizer.getFluid() == FluidsTFC.HOT_WATER.get());
}
@Override
public float getGrowthMultiplier(FluidStack fertilizer, ItemStack itemStack, ItemStack itemStack1, TileEntity tileEntity)
{
if (fertilizer.getFluid() == FluidsTFC.FRESH_WATER.get())
{
return 1f;
}
else if (fertilizer.getFluid() == FluidsTFC.HOT_WATER.get())
{
return 2f;
}
return 0f;
}
});
registerItemFertilizer(new ItemFertilizerHandler()
{
final ItemStack sylvite = ItemPowder.get(Powder.FERTILIZER, 1);
@Override
public boolean isValid(ItemStack fertilizer)
{
return !fertilizer.isEmpty() && OreDictionary.itemMatches(sylvite, fertilizer, true);
}
@Override
public float getGrowthMultiplier(ItemStack itemStack, ItemStack itemStack1, ItemStack itemStack2, TileEntity tileEntity)
{
return 1.0f;
}
});
}
public static void registerArcFurnaceRecipes()
{
//ArcFurnaceRecipe addRecipe(ItemStack output, Object input, @Nonnull ItemStack slag, int time, int energyPerTick, Object... additives)
//ArcFurnaceRecipe.addRecipe(new ItemStack(IEContent.itemMetal, 1, 8), "ingotIron", new ItemStack(IEContent.itemMaterial, 1, 7), 400, 512, "dustCoke");
// ArrayList<ArcFurnaceRecipe> recipeList = ArcFurnaceRecipe.recipeList;
// recipeList.clear();
for (Metal metal : TFCRegistries.METALS.getValuesCollection())
{
ItemStack output = new ItemStack(ItemMetal.get(metal, INGOT), 1);
ArcFurnaceRecipe.removeRecipes(output);
if (!metal.toString().endsWith("wrought_iron")) {
//Basic dust to ingot. Need to skip iron dust.
if (DUST.hasType(metal))
{
// need to see if it's got an oredict and use that instead of the actual item.
ItemStack dust = new ItemStack(ItemMetal.get(metal, Metal.ItemType.DUST));
int intOreDics[] = OreDictionary.getOreIDs(dust);
String oreDicString = "";
for (int num : intOreDics)
{
String dictName = OreDictionary.getOreName(num);
if (!dictName.toLowerCase().contains("anybronze"))
{
oreDicString = dictName;
break;
}
}
if (OreDictionary.doesOreNameExist(oreDicString))
{
ArcFurnaceRecipe.addRecipe(output, oreDicString, ItemStack.EMPTY, 200, 512).setSpecialRecipeType("Ores");
}
else
{
Ingredient input = Ingredient.fromStacks(dust);
ArcFurnaceRecipe.addRecipe(output, input, ItemStack.EMPTY, 200, 512).setSpecialRecipeType("Ores");
}
}
}
if (SCRAP.hasType(metal))
{
Ingredient input = Ingredient.fromStacks(new ItemStack(ItemMetal.get(metal, Metal.ItemType.SCRAP)));
ArcFurnaceRecipe.addRecipe(output, input, ItemStack.EMPTY, 400, 512).setSpecialRecipeType("Ores");
}
}
}
public static void registerBlastFurnaceRecipes()
{
//currently in CT Script. Advantage to moving here?
}
}