Search in sources :

Example 1 with MillRecipe

use of betterwithmods.common.registry.bulk.recipes.MillRecipe in project BetterWithAddons by DaedalusGame.

the class InteractionBWA method postInit.

@Override
public void postInit() {
    HashSet<ResourceLocation> rotBlackList = new HashSet<>();
    for (String resname : ROTTEN_FOOD_BLACKLIST) {
        rotBlackList.add(new ResourceLocation(resname));
    }
    for (Item item : Item.REGISTRY) {
        if (!(item instanceof ItemFood) || rotBlackList.contains(item.getRegistryName()))
            continue;
        ItemStack stack = new ItemStack(item);
        if (stack.isEmpty())
            continue;
        if (item instanceof ItemFishFood || ItemUtil.matchesOreDict(stack, "listAllfish"))
            RotHandler.addRottingItem(stack, FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
        else if (ItemUtil.matchesOreDict(stack, "foodMeat") || ItemUtil.matchesOreDict(stack, "listAllmeat") || ItemUtil.matchesOreDict(stack, "listAllmeatcooked"))
            RotHandler.addRottingItem(stack, MEAT_ROT_TIME, "meat", new ItemStack(Items.ROTTEN_FLESH));
        else if (isFruit(stack))
            RotHandler.addRottingItem(stack, FRUIT_ROT_TIME, "fruit", new ItemStack(ModItems.rottenFood));
        else
            RotHandler.addRottingItem(stack, MISC_ROT_TIME);
    }
    RotHandler.addRottingItem(new ItemStack(Items.CAKE, 1, OreDictionary.WILDCARD_VALUE));
    RotHandler.addRottingItem(new ItemStack(Items.FISH, 1, ItemFishFood.FishType.SALMON.getMetadata()), FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
    RotHandler.addRottingItem(new ItemStack(Items.FISH, 1, ItemFishFood.FishType.CLOWNFISH.getMetadata()), FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
    RotHandler.addRottingItem(new ItemStack(Items.FISH, 1, ItemFishFood.FishType.PUFFERFISH.getMetadata()), FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
    // Salt Cluster grinding recipe (migration version, to be changed)
    List<ItemStack> saltDusts = OreDictionary.getOres("foodSalt");
    if (saltDusts != null && saltDusts.size() > 0) {
        ItemStack saltCluster = new ItemStack(ModItems.salts, 1, 0);
        ItemStack saltDust = saltDusts.get(0).copy();
        saltDust.setCount(3);
        MillManager.getInstance().addRecipe(new MillRecipe(0, saltDust, ItemStack.EMPTY, new Object[] { saltCluster }));
    }
}
Also used : Item(net.minecraft.item.Item) ItemFood(net.minecraft.item.ItemFood) ResourceLocation(net.minecraft.util.ResourceLocation) ItemFishFood(net.minecraft.item.ItemFishFood) MillRecipe(betterwithmods.common.registry.bulk.recipes.MillRecipe) ItemStack(net.minecraft.item.ItemStack) HashSet(java.util.HashSet)

Example 2 with MillRecipe

use of betterwithmods.common.registry.bulk.recipes.MillRecipe in project BetterWithAddons by DaedalusGame.

the class InteractionBWM method postInit.

@Override
public void postInit() {
    // Fixes baked stuff showing up in the cauldron
    removeCauldronRecipe(new ItemStack(Items.BAKED_POTATO));
    removeCauldronRecipe(new ItemStack(ModItems.bakedCarrot));
    removeCauldronRecipe(new ItemStack(ModItems.bakedBeetroot));
    if (CHORUS_IN_CAULDRON)
        BetterWithAddons.instance.removeSmeltingRecipe(new ItemStack(Items.CHORUS_FRUIT_POPPED));
    for (ItemStack stack : OreDictionary.getOres("listAllmeat")) {
        ItemStack groundMeat = new ItemStack(ModItems.groundMeat);
        ItemStack meatStack = stack.copy();
        meatStack.setCount(1);
        if (meatStack.getItem() instanceof ItemFood) {
            int amount = ((ItemFood) meatStack.getItem()).getHealAmount(meatStack) / ModItems.groundMeat.getHealAmount(groundMeat);
            groundMeat.setCount(Math.max(amount, 1));
        }
        MillManager.getInstance().addRecipe(new MillRecipe(0, groundMeat, ItemStack.EMPTY, new Object[] { meatStack }));
    }
}
Also used : MillRecipe(betterwithmods.common.registry.bulk.recipes.MillRecipe)

Example 3 with MillRecipe

use of betterwithmods.common.registry.bulk.recipes.MillRecipe in project BetterWithAddons by DaedalusGame.

the class InteractionBWR method init.

@Override
void init() {
    PlantCrossbreedHandler.initialize();
    AnimalCrossbreedHandler.initialize();
    OreDictionary.registerOre("listAllBlazeFoods", Items.COAL);
    // Charcoal
    OreDictionary.registerOre("listAllBlazeFoods", new ItemStack(Items.COAL, 1, 1));
    OreDictionary.registerOre("listAllBlazeFoods", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.COAL_DUST));
    OreDictionary.registerOre("listAllBlazeFoods", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.CHARCOAL_DUST));
    OreDictionary.registerOre("listAllBlazeFoods", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.NETHERCOAL));
    OreDictionary.registerOre("listAllBlazeFoods", ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.BLASTING_OIL));
    OreDictionary.registerOre("pileSand", BWMItems.SAND_PILE);
    OreDictionary.registerOre("pileSand", BWMItems.RED_SAND_PILE);
    OreDictionary.registerOre("pileSand", ModItems.soulSandPile);
    // Tanning Leather with dung blocks
    // TODO: This is hacky.
    CauldronManager.getInstance().addRecipe(ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.TANNED_LEATHER), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.DUNG, 8), new Object[] { ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SCOURED_LEATHER), new ItemStack(BWMBlocks.AESTHETIC, 1, BlockAesthetic.EnumType.DUNG.getMeta()) });
    CauldronManager.getInstance().addRecipe(ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.TANNED_LEATHER_CUT, 2), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.DUNG, 8), new Object[] { ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SCOURED_LEATHER_CUT, 2), new ItemStack(BWMBlocks.AESTHETIC, 1, BlockAesthetic.EnumType.DUNG.getMeta()) });
    // Redstone synthesis
    ItemStack smallRedstone = new ItemStack(Items.REDSTONE, REDSTONE_PER_SYNTHESIS);
    ItemStack bigRedstone = new ItemStack(Items.REDSTONE, REDSTONE_PER_SYNTHESIS * 9);
    if (REDSTONE_SYNTHESIS) {
        StokedCrucibleRecipe smallRecipe = new StokedCrucibleRecipe(smallRedstone, ItemStack.EMPTY, new Object[] { new OreStack("nuggetGold", 1), new OreStack("ingotConcentratedHellfire", 1) });
        StokedCrucibleRecipe mediumRecipe = new StokedCrucibleRecipe(smallRedstone, new ItemStack(Items.GOLD_NUGGET, 8), new Object[] { new OreStack("ingotGold", 1), new OreStack("ingotConcentratedHellfire", 1) });
        StokedCrucibleRecipe bigRecipe = new StokedCrucibleRecipe(bigRedstone, ItemStack.EMPTY, new Object[] { new OreStack("ingotGold", 1), new OreStack("ingotConcentratedHellfire", 9) });
        smallRecipe.setPriority(108);
        mediumRecipe.setPriority(109);
        bigRecipe.setPriority(110);
        StokedCrucibleManager.getInstance().addRecipe(smallRecipe);
        StokedCrucibleManager.getInstance().addRecipe(mediumRecipe);
        StokedCrucibleManager.getInstance().addRecipe(bigRecipe);
    }
    if (REDSTONE_SYNTHESIS_EARLY) {
        MillManager.getInstance().addRecipe(2, smallRedstone, new Object[] { new OreStack("nuggetGold", 3), new OreStack("ingotConcentratedHellfire", 1) });
        MillManager.getInstance().addRecipe(2, bigRedstone, new Object[] { new OreStack("ingotGold", 3), new OreStack("ingotConcentratedHellfire", 9) });
    }
    ItemStack hellfireDust = ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.HELLFIRE_DUST);
    if (HELLFIRE_EARLY) {
        MillRecipe withSawDust = new MillRecipe(2, hellfireDust.copy(), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SOUL_DUST), new Object[] { new OreStack("dustNetherrack", 1), new OreStack("dustWood", 1) });
        MillRecipe withoutSawDust = new MillRecipe(2, hellfireDust.copy(), ItemStack.EMPTY, new Object[] { new OreStack("dustNetherrack", 1) });
        withSawDust.setPriority(11);
        withoutSawDust.setPriority(10);
        MillManager.getInstance().addRecipe(withSawDust);
        MillManager.getInstance().addRecipe(withoutSawDust);
    }
    if (BOILING_BUSHES)
        StokedCauldronManager.getInstance().addRecipe(new ItemStack(Blocks.DEADBUSH), new Object[] { new ItemStack(Blocks.SAPLING) });
    if (WEAVING_WEBS)
        CauldronManager.getInstance().addRecipe(new ItemStack(Blocks.WEB), new Object[] { new OreStack("string", 3), new OreStack("slimeball", 1) });
    if (DIAMOND_RECOVERY) {
        if (ModuleLoader.isFeatureEnabled(HCDiamond.class))
            addDiamondRecovery(new OreStack("ingotDiamond", 1), 1);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_SWORD), 2);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_PICKAXE), 3);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_AXE), 3);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_SHOVEL), 1);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_HOE), 2);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_HELMET), 5);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_CHESTPLATE), 8);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_LEGGINGS), 7);
        addDiamondRecovery(new ItemStack(Items.DIAMOND_BOOTS), 4);
        addDiamondRecovery(new ItemStack(ModItems.diamondSpade), 2);
        addDiamondRecovery(new ItemStack(ModItems.diamondMatchPick), 3);
        addDiamondRecovery(new ItemStack(ModItems.diamondMachete), 4);
        addDiamondRecovery(new ItemStack(ModItems.diamondKukri), 5);
        addDiamondRecovery(new ItemStack(ModItems.diamondCarpenterSaw), 5);
        addDiamondRecovery(new ItemStack(ModItems.diamondMasonPick), 4);
    }
    if (LAPIS_FROM_WOOL) {
        addLapisRinsing(EnumDyeColor.BLUE, 1, EnumDyeColor.WHITE);
        addLapisRinsing(EnumDyeColor.LIGHT_BLUE, 2, EnumDyeColor.WHITE);
        addLapisRinsing(EnumDyeColor.CYAN, 2, EnumDyeColor.GREEN);
        addLapisRinsing(EnumDyeColor.PURPLE, 2, EnumDyeColor.RED);
        addLapisRinsing(EnumDyeColor.MAGENTA, 4, EnumDyeColor.RED, EnumDyeColor.PINK);
    }
    if (GOLD_GRINDING) {
        addGoldGrinding(new ItemStack(Items.GOLDEN_SWORD), 2);
        addGoldGrinding(new ItemStack(Items.GOLDEN_PICKAXE), 3);
        addGoldGrinding(new ItemStack(Items.GOLDEN_AXE), 3);
        addGoldGrinding(new ItemStack(Items.GOLDEN_SHOVEL), 1);
        addGoldGrinding(new ItemStack(Items.GOLDEN_HOE), 2);
        addGoldGrinding(new ItemStack(Items.GOLDEN_HELMET), 5);
        addGoldGrinding(new ItemStack(Items.GOLDEN_CHESTPLATE), 8);
        addGoldGrinding(new ItemStack(Items.GOLDEN_LEGGINGS), 7);
        addGoldGrinding(new ItemStack(Items.GOLDEN_BOOTS), 4);
    }
    if (NETHERRACK_SYNTHESIS) {
        ItemStack soulUrn = new ItemStack(BWMBlocks.URN, 1, BlockUrn.EnumType.FULL.getMeta());
        CauldronManager.getInstance().addRecipe(new ItemStack(Blocks.NETHERRACK, 8), new Object[] { new ItemStack(Blocks.COBBLESTONE, 8), new ItemStack(Items.NETHER_WART, 8), soulUrn });
        CauldronManager.getInstance().addRecipe(new ItemStack(Blocks.NETHERRACK), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SAWDUST), new Object[] { new ItemStack(Blocks.COBBLESTONE), new ItemStack(Items.NETHER_WART), ItemMaterial.getMaterial(ItemMaterial.EnumMaterial.SOUL_DUST) });
    }
    if (DIAMOND_SYNTHESIS)
        StokedCrucibleManager.getInstance().addRecipe(new ItemStack(Items.DIAMOND), hellfireDust.copy(), new Object[] { new ItemStack(Items.GHAST_TEAR), new ItemStack(Items.DYE, 1, EnumDyeColor.CYAN.getDyeDamage()), new OreStack("dustNetherrack", 1) });
    if (QUARTZ_GROWING) {
        CauldronManager.getInstance().addRecipe(new QuartzCrystalRecipe(new ItemStack(Items.QUARTZ), ItemStack.EMPTY, new Object[] { new OreStack("pileSand", 1) }));
    }
}
Also used : OreStack(betterwithmods.common.registry.OreStack) MillRecipe(betterwithmods.common.registry.bulk.recipes.MillRecipe) QuartzCrystalRecipe(betterwithaddons.crafting.recipes.QuartzCrystalRecipe) ItemStack(net.minecraft.item.ItemStack) StokedCrucibleRecipe(betterwithmods.common.registry.bulk.recipes.StokedCrucibleRecipe)

Aggregations

MillRecipe (betterwithmods.common.registry.bulk.recipes.MillRecipe)3 ItemStack (net.minecraft.item.ItemStack)2 QuartzCrystalRecipe (betterwithaddons.crafting.recipes.QuartzCrystalRecipe)1 OreStack (betterwithmods.common.registry.OreStack)1 StokedCrucibleRecipe (betterwithmods.common.registry.bulk.recipes.StokedCrucibleRecipe)1 HashSet (java.util.HashSet)1 Item (net.minecraft.item.Item)1 ItemFishFood (net.minecraft.item.ItemFishFood)1 ItemFood (net.minecraft.item.ItemFood)1 ResourceLocation (net.minecraft.util.ResourceLocation)1