This commit is contained in:
Shadows_of_Fire 2018-01-15 17:15:29 -05:00
parent bf451dceb1
commit 4e30e7bb3b

View file

@ -25,6 +25,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public final class BlockCrafting{ public final class BlockCrafting{
@ -98,6 +99,22 @@ public final class BlockCrafting{
public static IRecipe recipeFarmer; public static IRecipe recipeFarmer;
public static IRecipe recipeBatteryBox; public static IRecipe recipeBatteryBox;
private static class FireworkIngredient extends Ingredient {
ItemStack firework = new ItemStack(Items.FIREWORKS);
ItemStack[] fireworks = new ItemStack[] {firework};
@Override
public ItemStack[] getMatchingStacks() {
return fireworks;
}
@Override
public boolean apply(ItemStack stack) {
return stack.getItem() == Items.FIREWORKS;
}
}
public static void init(){ public static void init(){
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockOilGenerator), new ItemStack(InitBlocks.blockOilGenerator)); RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockOilGenerator), new ItemStack(InitBlocks.blockOilGenerator));
@ -148,7 +165,7 @@ public final class BlockCrafting{
'G', new ItemStack(Items.GUNPOWDER), 'G', new ItemStack(Items.GUNPOWDER),
'S', new ItemStack(Items.STICK), 'S', new ItemStack(Items.STICK),
'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()),
'F', new ItemStack(Items.FIREWORKS, 1, Util.WILDCARD), 'F', new FireworkIngredient(),
'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal())); 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()));
recipeFireworkBox = RecipeUtil.lastIRecipe(); recipeFireworkBox = RecipeUtil.lastIRecipe();