Search in sources :

Example 1 with ItemStackContainer

use of gregapi.code.ItemStackContainer in project gregtech6 by GregTech6.

the class Loader_Recipes_OreDict method addAllListeners.

@Override
public void addAllListeners() {
    addListener(OP.dust.dat(MT.Glass), OP.dust.dat(MT.Sand), OP.dust.dat(MT.RedSand), OP.dust.dat(MT.EndSand), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, ST.make(Blocks.glass_pane, 1, 0), F, F, F);
        }
    });
    addListener(OP.blockDust.dat(MT.Glass), OP.blockDust.dat(MT.Sand), OP.blockDust.dat(MT.RedSand), OP.blockDust.dat(MT.EndSand), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, ST.make(Blocks.glass, 1, 0), F, F, F);
        }
    });
    addListener(OP.dust.dat(MT.Stone), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, OP.plate.mat(MT.Stone, 1), T, F, F);
        }
    });
    addListener(OP.blockDust.dat(MT.Stone), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, ST.make(Blocks.stone, 1, 0), T, F, F);
        }
    });
    addListener(OP.blockDust.dat(MT.Concrete), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, ST.make(MD.CHSL, "concrete", 1, 0, ST.make(Blocks.stone, 1, 0)), F, F, F);
        }
    });
    addListener(OP.dustDiv72.dat(MT.ArcaneCompound), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, OP.dustDiv72.mat(MT.ArcaneAsh, 2), F, F, F);
        }
    });
    addListener(OP.dustTiny.dat(MT.ArcaneCompound), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, OP.dustTiny.mat(MT.ArcaneAsh, 2), F, F, F);
        }
    });
    addListener(OP.dustSmall.dat(MT.ArcaneCompound), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, OP.dustSmall.mat(MT.ArcaneAsh, 2), F, F, F);
        }
    });
    addListener(OP.dust.dat(MT.ArcaneCompound), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, OP.dust.mat(MT.ArcaneAsh, 2), F, F, F);
        }
    });
    addListener(OP.blockDust.dat(MT.ArcaneCompound), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.add_smelting(aEvent.mStack, OP.blockDust.mat(MT.ArcaneAsh, 2), F, F, F);
        }
    });
    addListener(DYE_OREDICTS_LENS[DYE_INDEX_White], new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.LaserEngraver.addRecipe2(T, 16, 64, ST.make(Blocks.stone, 1, W), ST.amount(0, aEvent.mStack), ST.make(Blocks.stonebrick, 1, 3));
            RM.LaserEngraver.addRecipe2(T, 16, 128, IL.Module_Stone_Generator.get(0), ST.amount(0, aEvent.mStack), ST.make(Blocks.stonebrick, 1, 3));
            RM.LaserEngraver.addRecipe2(T, 16, 128, IL.Module_Basalt_Generator.get(0), ST.amount(0, aEvent.mStack), IL.NeLi_Basalt_Polished.get(1, IL.NePl_Basalt_Polished.get(1, ST.make(BlocksGT.Basalt, 1, BlockStones.BRICK))));
            RM.LaserEngraver.addRecipe2(T, 16, 128, IL.Module_Blackstone_Generator.get(0), ST.amount(0, aEvent.mStack), IL.NeLi_Blackstone_Bricks.get(1, IL.NePl_Blackstone_Bricks.get(1, ST.make(BlocksGT.Basalt, 1, BlockStones.BRICK))));
        }
    });
    addListener(OP.blockSolid.dat(MT.Obsidian), new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Hammer.addRecipe1(T, 16, 64, aEvent.mStack, IL.RC_Crushed_Obsidian.get(1, OP.dust.mat(MT.Obsidian, 8)));
            RM.Crusher.addRecipe1(T, 16, 600, new long[] { 10000, 2500 }, aEvent.mStack, IL.RC_Crushed_Obsidian.get(1, OP.dust.mat(MT.Obsidian, 8)), OP.dust.mat(MT.Obsidian, 1));
            RM.pulverizing(aEvent.mStack, IL.RC_Crushed_Obsidian.get(1, OP.dust.mat(MT.Obsidian, 8)), OP.dust.mat(MT.Obsidian, 1), 25, T);
        }
    });
    addListener("stoneNetherBrick", new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Hammer.addRecipe1(T, 16, 16, aEvent.mStack, ST.make(Items.netherbrick, 3, 0));
            RM.Crusher.addRecipe1(T, 16, 16, new long[] { 10000, 9000, 8000, 7000 }, aEvent.mStack, ST.make(Items.netherbrick, 1, 0), ST.make(Items.netherbrick, 1, 0), ST.make(Items.netherbrick, 1, 0), ST.make(Items.netherbrick, 1, 0));
        }
    });
    addListener("stoneNetherrack", new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Hammer.addRecipe1(T, 16, 16, aEvent.mStack, OP.rockGt.mat(MT.Netherrack, 4));
            RM.Crusher.addRecipe1(T, 16, 16, aEvent.mStack, OP.rockGt.mat(MT.Netherrack, 4));
        }
    });
    addListener("stoneEndstone", new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Hammer.addRecipe1(T, 16, 16, aEvent.mStack, OP.rockGt.mat(MT.Endstone, 4));
            RM.Crusher.addRecipe1(T, 16, 16, aEvent.mStack, OP.rockGt.mat(MT.Endstone, 4));
        }
    });
    addListener(OD.itemTar, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Laminator.addRecipe2(T, 16, 16, aEvent.mStack, ST.make(Blocks.piston, 1, W), ST.make(Blocks.sticky_piston, 1, 0));
            for (FluidStack tWater : FL.waters(250, 200)) RM.Mixer.addRecipe1(T, 16, 16, aEvent.mStack, tWater, FL.Glue.make(250), ZL_IS);
            RM.Loom.addRecipeX(T, 16, 16, ST.array(ST.tag(3), aEvent.mStack, ST.make((Item) OP.plantGtFiber.mRegisteredPrefixItems.get(0), 4, W)), ST.make(Items.lead, 2, 0));
            RM.Loom.addRecipeX(T, 16, 16, ST.array(ST.tag(3), aEvent.mStack, ST.make(Items.string, 4, W)), ST.make(Items.lead, 2, 0));
        }
    });
    addListener(OD.slimeball, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            if (OD.itemTar.is_(aEvent.mStack))
                return;
            if (ST.item_(aEvent.mStack) != Items.slime_ball)
                RM.generify(aEvent.mStack, ST.make(Items.slime_ball, 1, 0));
            RM.Mixer.addRecipe2(T, 16, 16, aEvent.mStack, OM.dust(MT.Blaze, U9), ST.make(Items.magma_cream, 1, 0));
            RM.Mixer.addRecipe2(T, 16, 16, ST.amount(9, aEvent.mStack), OM.dust(MT.Blaze), ST.make(Items.magma_cream, 9, 0));
            if (!OD.slimeballSwet.is_(aEvent.mStack) && !OD.slimeballPink.is_(aEvent.mStack) && !OD.slimeballRice.is_(aEvent.mStack) && !OD.slimeballBorax.is_(aEvent.mStack)) {
                RM.Squeezer.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Slime_Green.make(250), ZL_IS);
                RM.Juicer.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Slime_Green.make(125), ZL_IS);
                RM.Centrifuge.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Latex.make(L / 2), FL.Glue.make(250));
                RM.Drying.addRecipe1(T, 16, 128, aEvent.mStack, NF, FL.DistW.make(50), ST.make(MD.SC2, "ItemSlimeRubber", 1, 0));
            }
            RM.Laminator.addRecipe2(T, 16, 16, aEvent.mStack, ST.make(Blocks.piston, 1, W), ST.make(Blocks.sticky_piston, 1, 0));
            for (FluidStack tWater : FL.waters(250, 200)) RM.Mixer.addRecipe1(T, 16, 16, aEvent.mStack, tWater, FL.Glue.make(250), ZL_IS);
            RM.Loom.addRecipeX(T, 16, 16, ST.array(ST.tag(3), aEvent.mStack, ST.make((Item) OP.plantGtFiber.mRegisteredPrefixItems.get(0), 4, W)), ST.make(Items.lead, 2, 0));
            RM.Loom.addRecipeX(T, 16, 16, ST.array(ST.tag(3), aEvent.mStack, ST.make(Items.string, 4, W)), ST.make(Items.lead, 2, 0));
        }
    });
    addListener(OD.slimeballPink, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Squeezer.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Slime_Pink.make(250, FL.Slime_Green), ZL_IS);
            RM.Juicer.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Slime_Pink.make(125, FL.Slime_Green), ZL_IS);
            RM.Centrifuge.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Latex.make(L / 2), FL.Glue.make(250));
            RM.Drying.addRecipe1(T, 16, 128, aEvent.mStack, NF, FL.DistW.make(50), ST.make(MD.SC2, "ItemSlimeRubber", 1, 0));
            RM.generify(aEvent.mStack, ST.make(Items.slime_ball, 1, 0));
        }
    });
    addListener(OD.slimeballSwet, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Squeezer.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Slime_Green.make(250), ZL_IS);
            RM.Juicer.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Slime_Green.make(125), ZL_IS);
            RM.Centrifuge.addRecipe1(T, 16, 64, aEvent.mStack, NF, FL.Latex.make(L / 2), FL.Glue.make(250));
            RM.Drying.addRecipe1(T, 16, 128, aEvent.mStack, NF, FL.DistW.make(50), ST.make(MD.SC2, "ItemSlimeRubber", 1, 0));
            RM.generify(aEvent.mStack, ST.make(Items.slime_ball, 1, 0));
        }
    });
    addListener("foodJellyfishraw", new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.Squeezer.addRecipe1(T, 16, 16, 9000, aEvent.mStack, NF, NF, ST.make(Items.slime_ball, 1, 0));
            RM.Juicer.addRecipe1(T, 16, 16, 7000, aEvent.mStack, NF, NF, ST.make(Items.slime_ball, 1, 0));
            RM.Centrifuge.addRecipe1(T, 16, 16, aEvent.mStack, NF, FL.Glue.make(500), ZL_IS);
        }
    });
    addListener(OD.record, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            if (!BooksGT.BOOK_REGISTER.containsKey(aEvent.mStack, T))
                BooksGT.BOOK_REGISTER.put(new ItemStackContainer(aEvent.mStack), (byte) 30);
        }
    });
    addListener(OP.treeSapling, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.sawing(16, 16, F, 1, aEvent.mStack, OP.stick.mat(MT.Wood, 1));
        }
    });
    addListener(OD.logRubber, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.ic2_extractor(aEvent.mStack, dustSmall.mat(MT.Rubber, 2));
            RM.pulverizing(aEvent.mStack, dust.mat(MT.WoodRubber, 6), IL.IC2_Resin.get(1, IL.Resin.get(1)), 33, F);
            if (FL.Resin_Rubber.exists())
                RM.Squeezer.addRecipe1(T, 16, 64, 5000, aEvent.mStack, NF, FL.Resin_Rubber.make(200), IL.IC2_Resin.get(1, IL.Resin.get(1)));
        }
    });
    addListener(OD.logWood, OD.logRubber, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            if (ConfigsGT.RECIPES.get(ConfigCategories.Recipes.disabledrecipes, "wood2charcoalsmelting", T))
                RM.rem_smelting(aEvent.mStack, ST.make(Items.coal, 1, 1));
            if (ST.block(aEvent.mStack) == BlocksGT.Log1)
                return;
            if (IL.MaCu_Polished_Logs.exists()) {
                RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Fish.make(3000), NF, IL.MaCu_Polished_Logs.get(1));
                RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Whale.make(1500), NF, IL.MaCu_Polished_Logs.get(1));
            }
            for (FluidStack tWater : FL.waters(1000)) RM.Freezer.addRecipe1(T, 16, 16, aEvent.mStack, tWater, NF, ST.make(BlocksGT.Log1, 1, 3));
            RM.Drying.addRecipe1(T, 16, 128, aEvent.mStack, NF, FL.DistW.make(64), ST.make(BlocksGT.Log1, 1, 0));
            RM.Fermenter.addRecipe1(T, 16, 128, aEvent.mStack, ST.make(BlocksGT.Log1, 1, 1));
            if (WoodDictionary.IGNORED_OREDICT_REGISTRATIONS.contains(ST.item_(aEvent.mStack)))
                return;
            OreDictMaterial tWood = MT.Wood;
            if (aEvent.mOreDictName.equals(OD.logRubber.toString())) {
                tWood = MT.WoodRubber;
                RM.debarking(aEvent.mStack, ST.make(BlocksGT.Beam2, 1, 2), OM.dust(MT.Bark));
            } else {
                RM.debarking(aEvent.mStack, ST.make(BlocksGT.Beam2, 1, 3), OM.dust(MT.Bark));
            }
            RM.Lathe.addRecipe1(T, 16, 80, aEvent.mStack, stickLong.mat(tWood, 4), dust.mat(tWood, 2));
            RM.CokeOven.addRecipe1(T, 0, 3600, aEvent.mStack, NF, FL.Oil_Creosote.make(200), OP.gem.mat(MT.Charcoal, 1));
            if (ST.meta_(aEvent.mStack) == W) {
                ItemStack tPlank;
                for (int i = 0; i < W; i++) {
                    tPlank = CR.get(ST.make(ST.item_(aEvent.mStack), 1, i));
                    if (tPlank == null) {
                        if (i < 16)
                            continue;
                        break;
                    }
                    ItemStack tPlanks = ST.amount((tPlank.stackSize * 3) / 2, tPlank);
                    tPlanks.stackSize = (tPlanks.stackSize * 3) / 2;
                    RM.sawing(16, 128, F, 5, ST.make(ST.item_(aEvent.mStack), 1, i), ST.copy(tPlanks), dust.mat(tWood, 1), OM.dust(MT.Bark, U2));
                    CR.remove(ST.make(ST.item_(aEvent.mStack), 1, i));
                    CR.shaped(ST.amount(NERFED_WOOD ? tPlank.stackSize : (tPlank.stackSize * 5) / 4, tPlank), CR.DEF_NCC | CR.ONLY_IF_HAS_RESULT, "s", "L", 'L', ST.make(ST.item_(aEvent.mStack), 1, i));
                    CR.shapeless(ST.amount(tPlank.stackSize / (NERFED_WOOD ? 2 : 1), tPlank), CR.DEF_NCC | CR.ONLY_IF_HAS_RESULT, new Object[] { ST.make(ST.item_(aEvent.mStack), 1, i) });
                }
            } else {
                ItemStack tPlank = CR.get(ST.array(aEvent.mStack));
                if (tPlank != null) {
                    ItemStack tPlanks = ST.copy(tPlank);
                    tPlanks.stackSize = (tPlanks.stackSize * 3) / 2;
                    RM.sawing(16, 128, F, 5, aEvent.mStack, ST.copy(tPlanks), dust.mat(tWood, 1), OM.dust(MT.Bark, U2));
                    CR.remove(aEvent.mStack);
                    CR.shaped(ST.amount(NERFED_WOOD ? tPlank.stackSize : (tPlank.stackSize * 5) / 4, tPlank), CR.DEF_NCC | CR.ONLY_IF_HAS_RESULT, "s", "L", 'L', aEvent.mStack);
                    CR.shapeless(ST.amount(tPlank.stackSize / (NERFED_WOOD ? 2 : 1), tPlank), CR.DEF_NCC | CR.ONLY_IF_HAS_RESULT, new Object[] { aEvent.mStack });
                }
            }
        }
    });
    addListener(OD.slabWood, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.generify(aEvent.mStack, IL.Plank_Slab.get(1));
        }
    });
    addListener(OD.plankSkyroot, OD.plankWeedwood, OD.plankWood, new IOreDictListenerEvent() {

        @Override
        public void onOreRegistration(OreDictRegistrationContainer aEvent) {
            RM.generify(aEvent.mStack, IL.Plank.get(1));
            RM.Assembler.addRecipe2(T, 16, 32, ST.amount(8, aEvent.mStack), dust.mat(MT.Redstone, 1), ST.make(Blocks.noteblock, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 64, ST.amount(8, aEvent.mStack), gem.mat(MT.Diamond, 1), ST.make(Blocks.jukebox, 1, 0));
            // RM.Assembler.addRecipe2(T, 16,  32, aEvent.mStack, screw.mat(MT.Fe, 1), IL.Crate_Empty.get(1));
            // RM.Assembler.addRecipe2(T, 16,  32, aEvent.mStack, screw.mat(MT.WroughtIron, 1), IL.Crate_Empty.get(1));
            // RM.Assembler.addRecipe2(T, 16,  32, aEvent.mStack, screw.mat(MT.Steel, 1), IL.Crate_Empty.get(1));
            RM.Assembler.addRecipe2(T, 16, 16, aEvent.mStack, ST.tag(1), ST.make(Blocks.wooden_button, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 32, ST.amount(2, aEvent.mStack), ST.tag(2), ST.make(Blocks.wooden_pressure_plate, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 48, ST.amount(3, aEvent.mStack), ST.tag(3), ST.make(Blocks.trapdoor, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 64, ST.amount(4, aEvent.mStack), ST.tag(4), ST.make(Blocks.crafting_table, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 96, ST.amount(2, aEvent.mStack), ST.tag(6), ST.make(Items.wooden_door, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 128, ST.amount(8, aEvent.mStack), ST.tag(8), ST.make(Blocks.chest, 1, 0));
            RM.Assembler.addRecipe2(T, 16, 64, ST.amount(6, aEvent.mStack), ST.make(Items.book, 3, 0), ST.make(Blocks.bookshelf, 1, 0));
            if (WoodDictionary.IGNORED_OREDICT_REGISTRATIONS.contains(ST.item_(aEvent.mStack)))
                return;
            if (IL.MaCu_Polished_Planks.exists()) {
                RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Fish.make(1000), NF, IL.MaCu_Polished_Planks.get(1));
                RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Whale.make(500), NF, IL.MaCu_Polished_Planks.get(1));
            }
            ItemStack tTreated = IL.IE_Treated_Planks.get(1, IL.Treated_Planks.get(1));
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Seed.make(100), NF, tTreated);
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Lin.make(100), NF, tTreated);
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Hemp.make(100), NF, tTreated);
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Nut.make(100), NF, tTreated);
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Olive.make(100), NF, tTreated);
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Sunflower.make(100), NF, tTreated);
            RM.Bath.addRecipe1(T, 0, 144, aEvent.mStack, FL.Oil_Creosote.make(100), NF, tTreated);
        }
    });
}
Also used : OreDictMaterial(gregapi.oredict.OreDictMaterial) Item(net.minecraft.item.Item) ItemStackContainer(gregapi.code.ItemStackContainer) IOreDictListenerEvent(gregapi.oredict.event.IOreDictListenerEvent) FluidStack(net.minecraftforge.fluids.FluidStack) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ItemStackContainer

use of gregapi.code.ItemStackContainer in project gregtech6 by GregTech6.

the class CompatIC2 method onPostLoad.

@Override
public void onPostLoad(FMLPostInitializationEvent aEvent) {
    for (Object tOre : BlocksGT.stoneToSmallOres.values()) valuable((Block) tOre, 2);
    for (Object tOre : BlocksGT.stoneToNormalOres.values()) valuable((Block) tOre, 3);
    for (Object tOre : BlocksGT.stoneToBrokenOres.values()) valuable((Block) tOre, 3);
    if (mToBlacklist != null) {
        for (ItemStackContainer tStack : mToBlacklist) ic2.api.recipe.Recipes.recyclerBlacklist.add((IRecipeInput) makeInput(tStack.toStack()));
        mToBlacklist.clear();
        mToBlacklist = null;
    }
    if (MD.AA.mLoaded)
        Crops.instance.registerBaseSeed(ST.make(MD.AA, "itemCoffeeBeans", 1, W), Crops.instance.getCropCard("IC2", "Coffee"), 1, 1, 1, 1);
}
Also used : IRecipeInput(ic2.api.recipe.IRecipeInput) ItemStackContainer(gregapi.code.ItemStackContainer) Block(net.minecraft.block.Block)

Example 3 with ItemStackContainer

use of gregapi.code.ItemStackContainer in project gregtech6 by GregTech6.

the class RecipeMapHammer method getNEIAllRecipes.

@Override
public List<Recipe> getNEIAllRecipes() {
    List<Recipe> rList = super.getNEIAllRecipes();
    if (mBufferedDynamicRecipes == null) {
        mBufferedDynamicRecipes = new ArrayListNoNulls<>();
        for (OreDictMaterial tMaterial : OP.crushed.mRegisteredMaterials) {
            for (ItemStackContainer tStack : tMaterial.mRegisteredItems) {
                mBufferedDynamicRecipes.add(getRecipeFor(tStack.toStack()));
            }
        }
    }
    rList.addAll(mBufferedDynamicRecipes);
    return rList;
}
Also used : OreDictMaterial(gregapi.oredict.OreDictMaterial) ItemStackContainer(gregapi.code.ItemStackContainer) Recipe(gregapi.recipes.Recipe)

Example 4 with ItemStackContainer

use of gregapi.code.ItemStackContainer in project gregtech6 by GregTech6.

the class OreDictManager method setItemData_.

public boolean setItemData_(ItemStack aStack, OreDictItemData aData) {
    OreDictItemData tData = getAssociation_(aStack, F);
    if (tData != null && tData.mMaterial.mMaterial != MT.Wood && tData.mMaterial.mMaterial != ANY.Wood)
        return F;
    if (aStack.stackSize > 1) {
        if (aData.mMaterial != null)
            aData.mMaterial.mAmount /= aStack.stackSize;
        for (OreDictMaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize;
        aStack = ST.amount(1, aStack);
    }
    if (!aData.mBlackListed)
        aData.mBlackListed = isBlacklisted(aStack);
    if (!aData.mBlocked)
        aData.mBlocked = (aData.mBlackListed || ST.block(aStack) != NB || FL.getFluid(aStack, T) != null || (aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0));
    sItemStack2DataMap.put(new ItemStackContainer(aStack), aData);
    if (aData.hasValidMaterialData()) {
        long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(TD.Processing.UNRECYCLABLE) ? 0 : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : U;
        for (OreDictMaterialStack tMaterial : aData.mByProducts) tValidMaterialAmount += tMaterial.mMaterial.contains(TD.Processing.UNRECYCLABLE) ? 0 : tMaterial.mAmount >= 0 ? tMaterial.mAmount : U;
        if (tValidMaterialAmount < U && COMPAT_IC2 != null)
            COMPAT_IC2.blacklist(aStack);
    }
    if (!aData.hasValidPrefixData() || aData.mPrefix.contains(TD.Prefix.RECYCLABLE)) {
        OreDictRecyclingContainer tRegistration = new OreDictRecyclingContainer(aStack, aData);
        for (IOreDictListenerRecyclable tListener : mRecyclableOreDictListeners) tListener.onRecycleableRegistration(tRegistration);
        mRecyclableRegistrations.add(tRegistration);
    }
    return T;
}
Also used : ItemStackContainer(gregapi.code.ItemStackContainer) IFluidContainerItem(net.minecraftforge.fluids.IFluidContainerItem) OreDictRecyclingContainer(gregapi.oredict.event.IOreDictListenerRecyclable.OreDictRecyclingContainer) IOreDictListenerRecyclable(gregapi.oredict.event.IOreDictListenerRecyclable)

Example 5 with ItemStackContainer

use of gregapi.code.ItemStackContainer in project gregtech6 by GregTech6.

the class WD method oreGenReplaceable.

public static boolean oreGenReplaceable(World aWorld, int aX, int aY, int aZ, boolean aAllowAir) {
    Block aBlock = aWorld.getBlock(aX, aY, aZ);
    if (aBlock == NB)
        return aAllowAir;
    byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ);
    if (BlocksGT.sDontGenerateOresIn.contains(new ItemStackContainer(aBlock, 1, aMeta)))
        return F;
    if (BlocksGT.stoneToNormalOres.containsKey(new ItemStackContainer(aBlock, 1, aMeta)))
        return T;
    if (Blocks.stone != aBlock && aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone))
        return T;
    if (Blocks.gravel != aBlock && aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.gravel))
        return T;
    if (Blocks.sand != aBlock && aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.sand))
        return T;
    if (Blocks.netherrack != aBlock && aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.netherrack))
        return T;
    if (Blocks.end_stone != aBlock && aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))
        return T;
    return F;
}
Also used : ItemStackContainer(gregapi.code.ItemStackContainer) IPartialSealableBlock(micdoodle8.mods.galacticraft.api.block.IPartialSealableBlock)

Aggregations

ItemStackContainer (gregapi.code.ItemStackContainer)25 ItemStack (net.minecraft.item.ItemStack)8 OreDictMaterial (gregapi.oredict.OreDictMaterial)6 ArrayListNoNulls (gregapi.code.ArrayListNoNulls)5 Drops (gregapi.block.behaviors.Drops)4 Drops_SmallOre (gregapi.block.behaviors.Drops_SmallOre)4 PrefixBlock_ (gregapi.block.prefixblock.PrefixBlock_)4 Block (net.minecraft.block.Block)4 FluidContainerData (net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData)4 FluidStack (net.minecraftforge.fluids.FluidStack)4 IBlockPlacable (gregapi.block.IBlockPlacable)3 OreDictItemData (gregapi.oredict.OreDictItemData)3 OreDictPrefix (gregapi.oredict.OreDictPrefix)3 Recipe (gregapi.recipes.Recipe)3 IPartialSealableBlock (micdoodle8.mods.galacticraft.api.block.IPartialSealableBlock)3 PrefixBlock (gregapi.block.prefixblock.PrefixBlock)2 ItemStackSet (gregapi.code.ItemStackSet)2 IOreDictListenerEvent (gregapi.oredict.event.IOreDictListenerEvent)2 DelegatorTileEntity (gregapi.tileentity.delegate.DelegatorTileEntity)2 TileEntity (net.minecraft.tileentity.TileEntity)2