Search in sources :

Example 1 with ItemStackSet

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

the class MultiItemRandom method addItem.

/**
 * This adds a Custom Item.
 * @param aID The Id of the assigned Item [0 - 32766]
 * @param aEnglish The Default Localised Name of the created Item
 * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
 * @param aFoodBehavior The Food Value of this Item. Can be null aswell. Just a convenience thing.
 * @param aRandomData The OreDict Names you want to give the Item. Also used for TC Aspects and some other things.
 * @return An ItemStack containing the newly created Item.
 */
@SuppressWarnings("unchecked")
public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) {
    if (aToolTip == null)
        aToolTip = "";
    if (mAllowedToAddItems && aID >= 0 && aID < 32767 && aID != W) {
        mLastID = (short) aID;
        ItemStack aStack = ST.make(this, 1, aID);
        if (UT.Code.stringValid(aEnglish)) {
            mEnabledItems.set(aID);
            mVisibleItems.set(aID);
            LH.add(getUnlocalizedName(aStack) + ".name", aEnglish);
            LH.add(getUnlocalizedName(aStack) + ".tooltip", aToolTip);
        }
        List<TC_AspectStack> tAspects = new ArrayListNoNulls<>();
        // Important Stuff to do first
        for (Object tRandomData : aRandomData) if (tRandomData instanceof TagData) {
            if (tRandomData == TD.Creative.HIDDEN) {
                mVisibleItems.set(aID, F);
                continue;
            }
            if (tRandomData == TD.Properties.AUTO_BLACKLIST) {
                OM.blacklist_(aStack);
                continue;
            }
        }
        // now check for the rest
        for (Object tRandomData : aRandomData) if (tRandomData != null) {
            boolean tUseOreDict = T;
            if (tRandomData instanceof ItemStackSet) {
                ((ItemStackSet<?>) tRandomData).add(aStack);
                continue;
            }
            if (tRandomData instanceof TagData) {
                continue;
            }
            if (tRandomData instanceof Number) {
                setBurnValue(aID, ((Number) tRandomData).intValue());
                continue;
            }
            if (tRandomData instanceof IFoodStat) {
                setFoodBehavior(aID, (IFoodStat) tRandomData);
                if (IL.IC2_Food_Can_Empty.exists() && IL.IC2_Food_Can_Filled.exists() && getContainerItem(aStack) == null) {
                    int tFoodValue = ((IFoodStat) tRandomData).getFoodLevel(this, aStack, null);
                    if (tFoodValue > 0)
                        RM.Canner.addRecipe2(T, 16, tFoodValue * 16, aStack, IL.IC2_Food_Can_Empty.get(tFoodValue), ((IFoodStat) tRandomData).isRotten(this, aStack, null) ? IL.IC2_Food_Can_Spoiled.get(tFoodValue, IL.IC2_Food_Can_Filled.get(tFoodValue)) : IL.IC2_Food_Can_Filled.get(tFoodValue));
                }
                tUseOreDict = F;
            }
            if (tRandomData instanceof ICover) {
                CoverRegistry.put(aStack, (ICover) tRandomData);
                tUseOreDict = F;
            }
            if (tRandomData instanceof IBehavior) {
                addItemBehavior(aID, (IBehavior<MultiItem>) tRandomData);
                tUseOreDict = F;
            }
            if (tRandomData instanceof IItemEnergy) {
                setElectricStats(aID, (IItemEnergy) tRandomData);
                tUseOreDict = F;
            }
            if (tRandomData instanceof IItemContainer) {
                ((IItemContainer) tRandomData).set(aStack);
                tUseOreDict = F;
            }
            if (tRandomData instanceof TC_AspectStack) {
                ((TC_AspectStack) tRandomData).addToAspectList(tAspects);
                continue;
            }
            if (tRandomData instanceof OreDictItemData) {
                if (((OreDictItemData) tRandomData).hasValidPrefixMaterialData()) {
                    OM.reg(aStack, tRandomData);
                    ItemStack tStack = ((OreDictItemData) tRandomData).getStack(1);
                    // Priority over autogenerated PrefixItems, but not over the hardcoded Compatibility Targets.
                    if (ST.invalid(tStack) || tStack.getItem() instanceof PrefixItem) {
                        OreDictManager.INSTANCE.setTarget_(((OreDictItemData) tRandomData).mPrefix, ((OreDictItemData) tRandomData).mMaterial.mMaterial, aStack);
                        continue;
                    }
                }
                OreDictManager.INSTANCE.addItemData_(aStack, (OreDictItemData) tRandomData);
                continue;
            }
            if (tRandomData instanceof FluidStack) {
                tRandomData = new FluidContainerData((FluidStack) tRandomData, ST.copy_(aStack), getContainerItem(aStack), T);
                // if (((FluidContainerData)tRandomData).emptyContainer != null)
                // RM.Canner.addRecipe1(T, 16, Math.max(((FluidContainerData)tRandomData).fluid.amount / 64, 16), ((FluidContainerData)tRandomData).emptyContainer, ((FluidContainerData)tRandomData).fluid, NF, ((FluidContainerData)tRandomData).filledContainer);
                // RM.Canner.addRecipe1(T, 16, Math.max(((FluidContainerData)tRandomData).fluid.amount / 64, 16), ((FluidContainerData)tRandomData).filledContainer, NF, ((FluidContainerData)tRandomData).fluid, ST.container(((FluidContainerData)tRandomData).filledContainer, F));
                FL.reg((FluidContainerData) tRandomData, T, F);
                continue;
            }
            if (tRandomData instanceof FluidContainerData) {
                // if (((FluidContainerData)tRandomData).emptyContainer != null)
                // RM.Canner.addRecipe1(T, 16, Math.max(((FluidContainerData)tRandomData).fluid.amount / 64, 16), ((FluidContainerData)tRandomData).emptyContainer, ((FluidContainerData)tRandomData).fluid, NF, ((FluidContainerData)tRandomData).filledContainer);
                // RM.Canner.addRecipe1(T, 16, Math.max(((FluidContainerData)tRandomData).fluid.amount / 64, 16), ((FluidContainerData)tRandomData).filledContainer, NF, ((FluidContainerData)tRandomData).fluid, ST.container(((FluidContainerData)tRandomData).filledContainer, F));
                FL.reg((FluidContainerData) tRandomData, T, F);
                continue;
            }
            if (tRandomData instanceof Runnable) {
                GAPI.mAfterPostInit.add((Runnable) tRandomData);
                tUseOreDict = F;
            }
            if (tUseOreDict) {
                OM.reg(tRandomData, aStack);
                continue;
            }
        }
        if (COMPAT_TC != null)
            COMPAT_TC.registerThaumcraftAspectsToItem(aStack, tAspects, F);
        return ST.update(ST.make(this, 1, aID));
    }
    return null;
}
Also used : IItemEnergy(gregapi.item.IItemEnergy) OreDictItemData(gregapi.oredict.OreDictItemData) FluidStack(net.minecraftforge.fluids.FluidStack) IFoodStat(gregapi.item.multiitem.food.IFoodStat) ItemStackSet(gregapi.code.ItemStackSet) IItemContainer(gregapi.code.IItemContainer) PrefixItem(gregapi.item.prefixitem.PrefixItem) FluidContainerData(net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData) ArrayListNoNulls(gregapi.code.ArrayListNoNulls) TC_AspectStack(gregapi.data.TC.TC_AspectStack) IBehavior(gregapi.item.multiitem.behaviors.IBehavior) ICover(gregapi.cover.ICover) TagData(gregapi.code.TagData) ItemStack(net.minecraft.item.ItemStack)

Example 2 with ItemStackSet

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

the class MultiItemTool method addTool.

/**
 * This adds a Custom Item to the ending Range.
 * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items)
 * @param aEnglish The Default Localized Name of the created Item
 * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip
 * @param aToolStats The Food Value of this Item. Can be null as well.
 * @param aRandomParameters The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects.
 * @return An ItemStack containing the newly created Item, but without specific Stats.
 */
public final ItemStack addTool(int aID, String aEnglish, String aToolTip, IToolStats aToolStats, Object... aRandomParameters) {
    if (aToolTip == null)
        aToolTip = "";
    if (aID >= 0 && aID < 32766 && isUsableMeta((short) aID)) {
        LH.add(getUnlocalizedName() + "." + aID + ".name", aEnglish);
        LH.add(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
        LH.add(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
        LH.add(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
        mToolStats.put((short) aID, aToolStats);
        mToolStats.put((short) (aID + 1), aToolStats);
        aToolStats.onStatsAddedToTool(this, aID);
        ItemStack rStack = ST.make(this, 1, aID);
        List<TC_AspectStack> tAspects = new ArrayListNoNulls<>();
        for (Object tRandomParameter : aRandomParameters) {
            if (tRandomParameter instanceof TC_AspectStack)
                ((TC_AspectStack) tRandomParameter).addToAspectList(tAspects);
            else if (tRandomParameter instanceof ItemStackSet)
                ((ItemStackSet<?>) tRandomParameter).add(rStack.copy());
            else
                OM.reg(tRandomParameter, rStack);
        }
        if (COMPAT_TC != null)
            COMPAT_TC.registerThaumcraftAspectsToItem(rStack, tAspects, F);
        return rStack;
    }
    return null;
}
Also used : TC_AspectStack(gregapi.data.TC.TC_AspectStack) ItemStackSet(gregapi.code.ItemStackSet) ItemStack(net.minecraft.item.ItemStack) ArrayListNoNulls(gregapi.code.ArrayListNoNulls)

Example 3 with ItemStackSet

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

the class MultiTileEntityLogisticsCore method onServerTickPre.

@Override
@SuppressWarnings("unchecked")
public void onServerTickPre(boolean aFirst) {
    // Sync up with other Stuff that happens to check for visual Updates every 20 Ticks to reduce Lag.
    if (SYNC_SECOND) {
        int tCPU_Logic = oCPU_Logic, tCPU_Control = oCPU_Control, tCPU_Storage = oCPU_Storage, tCPU_Conversion = oCPU_Conversion;
        oCPU_Logic = 0;
        oCPU_Control = 0;
        oCPU_Storage = 0;
        oCPU_Conversion = 0;
        if (checkStructure(F) && mEnergy >= 128L + mCPU_Logic * 64L * mCPU_Conversion) {
            int tX = getOffsetXN(mFacing, 2), tY = getOffsetYN(mFacing, 2), tZ = getOffsetZN(mFacing, 2);
            ItemStackSet<ItemStackContainer> tFilteredFor = new ItemStackSet<>();
            final List<LogisticsData> tStackImportsGeneric = new ArrayListNoNulls<>(), tStackImportsSemi = new ArrayListNoNulls<>(), tStackImportsFiltered = new ArrayListNoNulls<>(), tStackExportsGeneric = new ArrayListNoNulls<>(), tStackExportsSemi = new ArrayListNoNulls<>(), tStackExportsFiltered = new ArrayListNoNulls<>(), tStackStorageGeneric = new ArrayListNoNulls<>(), tStackStorageSemi = new ArrayListNoNulls<>(), tStackStorageFiltered = new ArrayListNoNulls<>(), tStackDumps = new ArrayListNoNulls<>(), tFluidImportsGeneric = new ArrayListNoNulls<>(), tFluidImportsSemi = new ArrayListNoNulls<>(), tFluidImportsFiltered = new ArrayListNoNulls<>(), tFluidExportsGeneric = new ArrayListNoNulls<>(), tFluidExportsSemi = new ArrayListNoNulls<>(), tFluidExportsFiltered = new ArrayListNoNulls<>(), tFluidStorageGeneric = new ArrayListNoNulls<>(), tFluidStorageSemi = new ArrayListNoNulls<>(), tFluidStorageFiltered = new ArrayListNoNulls<>(), tExports1[][] = new List[][] { { tFluidExportsFiltered, tStackExportsFiltered }, { tFluidExportsSemi, tStackExportsSemi }, { tFluidExportsGeneric, tStackExportsGeneric }, { tFluidStorageFiltered, tStackStorageFiltered }, { tFluidStorageSemi, tStackStorageSemi }, { tFluidStorageGeneric, tStackStorageGeneric } }, tExports2[][] = new List[][] { { tFluidExportsFiltered, tStackExportsFiltered }, { tFluidExportsSemi, tStackExportsSemi }, { tFluidExportsGeneric, tStackExportsGeneric } }, tImports1[][] = new List[][] { { tFluidImportsGeneric, tStackImportsGeneric }, { tFluidImportsSemi, tStackImportsSemi }, { tFluidImportsFiltered, tStackImportsFiltered } }, tImports2[][] = new List[][] { { tFluidStorageGeneric, tStackStorageGeneric }, { tFluidStorageSemi, tStackStorageSemi }, { tFluidStorageFiltered, tStackStorageFiltered } };
            Set<ITileEntityLogistics> tScanning = new HashSetNoNulls<>(), tScanningNext = new HashSetNoNulls<>();
            Set<TileEntity> tScanned = new HashSetNoNulls<>();
            for (int i = -2; i <= 2; i++) for (int j = -2; j <= 2; j++) for (int k = -2; k <= 2; k++) {
                TileEntity tTileEntity = WD.te(worldObj, tX + i, tY + j, tZ + k, T);
                if (tScanned.add(tTileEntity) && tTileEntity instanceof ITileEntityLogistics)
                    tScanning.add((ITileEntityLogistics) tTileEntity);
            }
            while (!tScanning.isEmpty()) {
                for (ITileEntityLogistics tLogistics : tScanning) {
                    if (tLogistics instanceof ITileEntityLogisticsStorage) {
                        tFilteredFor.add(((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterItem());
                        if (tLogistics instanceof ITileEntityLogisticsSemiFilteredItem) {
                            tFilteredFor.addAll(((ITileEntityLogisticsSemiFilteredItem) tLogistics).getLogisticsFilter(SIDE_ANY));
                        }
                        switch(((ITileEntityLogisticsStorage) tLogistics).getLogisticsPriorityFluid()) {
                            case 1:
                                tFluidStorageGeneric.add(new LogisticsData(new DelegatorTileEntity<>((TileEntity) tLogistics, SIDE_ANY), ((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterFluid()));
                                break;
                            case 2:
                                tFluidStorageSemi.add(new LogisticsData(new DelegatorTileEntity<>((TileEntity) tLogistics, SIDE_ANY), ((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterFluid()));
                                break;
                            case 3:
                                tFluidStorageFiltered.add(new LogisticsData(new DelegatorTileEntity<>((TileEntity) tLogistics, SIDE_ANY), ((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterFluid()));
                                break;
                        }
                        switch(((ITileEntityLogisticsStorage) tLogistics).getLogisticsPriorityItem()) {
                            case 1:
                                tStackStorageGeneric.add(new LogisticsData(new DelegatorTileEntity<>((TileEntity) tLogistics, SIDE_ANY), ((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterItem()));
                                break;
                            case 2:
                                tStackStorageSemi.add(new LogisticsData(new DelegatorTileEntity<>((TileEntity) tLogistics, SIDE_ANY), ((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterItem()));
                                break;
                            case 3:
                                tStackStorageFiltered.add(new LogisticsData(new DelegatorTileEntity<>((TileEntity) tLogistics, SIDE_ANY), ((ITileEntityLogisticsStorage) tLogistics).getLogisticsFilterItem()));
                                break;
                        }
                    }
                    CoverData tCovers = tLogistics.getCoverData();
                    if (tCovers != null && !tCovers.mStopped) {
                        for (byte tSide : ALL_SIDES_VALID) if (tCovers.mBehaviours[tSide] instanceof AbstractCoverAttachmentLogistics) {
                            if (tCovers.mBehaviours[tSide] == CoverLogisticsDisplayCPULogic.INSTANCE) {
                                tCovers.value(tSide, (short) (tCPU_Logic <= 0 ? 0 : tCPU_Logic >= mCPU_Logic ? 15 : 14 - (int) Math.max(0, Math.min(13, ((mCPU_Logic - tCPU_Logic) * 14L) / mCPU_Logic))), T);
                                tCovers.visual(tSide, (short) (tCPU_Logic <= 0 ? 0 : tCPU_Logic >= mCPU_Logic ? 10 : 9 - (int) Math.max(0, Math.min(8, ((mCPU_Logic - tCPU_Logic) * 9L) / mCPU_Logic))));
                                continue;
                            }
                            if (tCovers.mBehaviours[tSide] == CoverLogisticsDisplayCPUControl.INSTANCE) {
                                tCovers.value(tSide, (short) (tCPU_Control <= 0 ? 0 : tCPU_Control >= mCPU_Control ? 15 : 14 - (int) Math.max(0, Math.min(13, ((mCPU_Control - tCPU_Control) * 14L) / mCPU_Control))), T);
                                tCovers.visual(tSide, (short) (tCPU_Control <= 0 ? 0 : tCPU_Control >= mCPU_Control ? 10 : 9 - (int) Math.max(0, Math.min(8, ((mCPU_Control - tCPU_Control) * 9L) / mCPU_Control))));
                                continue;
                            }
                            if (tCovers.mBehaviours[tSide] == CoverLogisticsDisplayCPUStorage.INSTANCE) {
                                tCovers.value(tSide, (short) (tCPU_Storage <= 0 ? 0 : tCPU_Storage >= mCPU_Storage ? 15 : 14 - (int) Math.max(0, Math.min(13, ((mCPU_Storage - tCPU_Storage) * 14L) / mCPU_Storage))), T);
                                tCovers.visual(tSide, (short) (tCPU_Storage <= 0 ? 0 : tCPU_Storage >= mCPU_Storage ? 10 : 9 - (int) Math.max(0, Math.min(8, ((mCPU_Storage - tCPU_Storage) * 9L) / mCPU_Storage))));
                                continue;
                            }
                            if (tCovers.mBehaviours[tSide] == CoverLogisticsDisplayCPUConversion.INSTANCE) {
                                tCovers.value(tSide, (short) (tCPU_Conversion <= 0 ? 0 : tCPU_Conversion >= mCPU_Conversion ? 15 : 14 - (int) Math.max(0, Math.min(13, ((mCPU_Conversion - tCPU_Conversion) * 14L) / mCPU_Conversion))), T);
                                tCovers.visual(tSide, (short) (tCPU_Conversion <= 0 ? 0 : tCPU_Conversion >= mCPU_Conversion ? 10 : 9 - (int) Math.max(0, Math.min(8, ((mCPU_Conversion - tCPU_Conversion) * 9L) / mCPU_Conversion))));
                                continue;
                            }
                            DelegatorTileEntity<TileEntity> tAdjacent = tLogistics.getAdjacentTileEntity(tSide);
                            if (tAdjacent.mTileEntity instanceof ITileEntityLogistics && ((ITileEntityLogistics) tAdjacent.mTileEntity).canLogistics(SIDE_ANY)) {
                            // Ignore those ones to reduce likelihood of infinite Loops.
                            } else {
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsFluidExport.INSTANCE) {
                                    FluidStack tFluid = FL.load(tCovers.mNBTs[tSide], "gt.filter.fluid");
                                    if (tFluid != null && tFluid.getFluid() != null) {
                                        switch(tCovers.mValues[tSide] & 3) {
                                            case 1:
                                                tFluidExportsGeneric.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                            case 2:
                                                tFluidExportsSemi.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                            default:
                                                tFluidExportsFiltered.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                        }
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsFluidImport.INSTANCE) {
                                    FluidStack tFluid = FL.load(tCovers.mNBTs[tSide], "gt.filter.fluid");
                                    if (tFluid != null && tFluid.getFluid() != null) {
                                        switch(tCovers.mValues[tSide] & 3) {
                                            case 1:
                                                tFluidImportsGeneric.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                            case 2:
                                                tFluidImportsSemi.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                            default:
                                                tFluidImportsFiltered.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                        }
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsFluidStorage.INSTANCE) {
                                    FluidStack tFluid = FL.load(tCovers.mNBTs[tSide], "gt.filter.fluid");
                                    if (tFluid != null && tFluid.getFluid() != null) {
                                        switch(tCovers.mValues[tSide] & 3) {
                                            case 1:
                                                tFluidStorageGeneric.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                            case 2:
                                                tFluidStorageSemi.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                            default:
                                                tFluidStorageFiltered.add(new LogisticsData(tAdjacent, tFluid.getFluid()));
                                                break;
                                        }
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsItemExport.INSTANCE) {
                                    ItemStack tStack = ST.load(tCovers.mNBTs[tSide], "gt.filter.item");
                                    if (ST.valid(tStack)) {
                                        tFilteredFor.add(tStack);
                                        switch(tCovers.mValues[tSide] & 3) {
                                            case 1:
                                                tStackExportsGeneric.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                            case 2:
                                                tStackExportsSemi.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                            default:
                                                tStackExportsFiltered.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                        }
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsItemImport.INSTANCE) {
                                    ItemStack tStack = ST.load(tCovers.mNBTs[tSide], "gt.filter.item");
                                    if (ST.valid(tStack)) {
                                        tFilteredFor.add(tStack);
                                        switch(tCovers.mValues[tSide] & 3) {
                                            case 1:
                                                tStackImportsGeneric.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                            case 2:
                                                tStackImportsSemi.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                            default:
                                                tStackImportsFiltered.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                        }
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsItemStorage.INSTANCE) {
                                    ItemStack tStack = ST.load(tCovers.mNBTs[tSide], "gt.filter.item");
                                    if (ST.valid(tStack)) {
                                        tFilteredFor.add(tStack);
                                        switch(tCovers.mValues[tSide] & 3) {
                                            case 1:
                                                tStackStorageGeneric.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                            case 2:
                                                tStackStorageSemi.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                            default:
                                                tStackStorageFiltered.add(new LogisticsData(tAdjacent, tStack, (tCovers.mValues[tSide] >> 2) & 127));
                                                break;
                                        }
                                    }
                                    continue;
                                }
                                LogisticsData tTarget = new LogisticsData(tAdjacent, (tCovers.mValues[tSide] >> 2) & 127);
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsGenericDump.INSTANCE) {
                                    tStackDumps.add(tTarget);
                                    continue;
                                }
                                int tDefault = (tCovers.mValues[tSide] & 3);
                                boolean aAllowFluids = T;
                                if (tAdjacent.mTileEntity instanceof ITileEntityLogisticsSemiFilteredItem) {
                                    aAllowFluids = F;
                                    ItemStackSet<ItemStackContainer> tFilter = ((ITileEntityLogisticsSemiFilteredItem) tAdjacent.mTileEntity).getLogisticsFilter(tAdjacent.mSideOfTileEntity);
                                    if (tFilter != null) {
                                        tFilteredFor.addAll(tFilter);
                                        if (tDefault == 0)
                                            tDefault = 2;
                                    }
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsGenericExport.INSTANCE) {
                                    switch(tDefault) {
                                        default:
                                            if (aAllowFluids)
                                                tFluidExportsGeneric.add(tTarget);
                                            tStackExportsGeneric.add(tTarget);
                                            break;
                                        case 2:
                                            if (aAllowFluids)
                                                tFluidExportsSemi.add(tTarget);
                                            tStackExportsSemi.add(tTarget);
                                            break;
                                        case 3:
                                            if (aAllowFluids)
                                                tFluidExportsFiltered.add(tTarget);
                                            tStackExportsFiltered.add(tTarget);
                                            break;
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsGenericImport.INSTANCE) {
                                    switch(tDefault) {
                                        default:
                                            if (aAllowFluids)
                                                tFluidImportsGeneric.add(tTarget);
                                            tStackImportsGeneric.add(tTarget);
                                            break;
                                        case 2:
                                            if (aAllowFluids)
                                                tFluidImportsSemi.add(tTarget);
                                            tStackImportsSemi.add(tTarget);
                                            break;
                                        case 3:
                                            if (aAllowFluids)
                                                tFluidImportsFiltered.add(tTarget);
                                            tStackImportsFiltered.add(tTarget);
                                            break;
                                    }
                                    continue;
                                }
                                if (tCovers.mBehaviours[tSide] == CoverLogisticsGenericStorage.INSTANCE) {
                                    switch(tDefault) {
                                        default:
                                            if (aAllowFluids)
                                                tFluidStorageGeneric.add(tTarget);
                                            tStackStorageGeneric.add(tTarget);
                                            break;
                                        case 2:
                                            if (aAllowFluids)
                                                tFluidStorageSemi.add(tTarget);
                                            tStackStorageSemi.add(tTarget);
                                            break;
                                        case 3:
                                            if (aAllowFluids)
                                                tFluidStorageFiltered.add(tTarget);
                                            tStackStorageFiltered.add(tTarget);
                                            break;
                                    }
                                    continue;
                                }
                            }
                        }
                    }
                    if (tLogistics.getWorld() == worldObj)
                        for (byte tSide : ALL_SIDES_VALID) if (tLogistics.canLogistics(tSide)) {
                            int tMaxDistance = Math.max(Math.abs(tLogistics.getOffsetX(tSide) - tX), Math.max(Math.abs(tLogistics.getOffsetY(tSide) - tY), Math.abs(tLogistics.getOffsetZ(tSide) - tZ)));
                            if (tMaxDistance <= mCPU_Control + 2) {
                                oCPU_Control = Math.max(oCPU_Control, tMaxDistance - 2);
                                DelegatorTileEntity<TileEntity> tAdjacent = tLogistics.getAdjacentTileEntity(tSide);
                                if (tAdjacent.mTileEntity instanceof ITileEntityLogistics && ((ITileEntityLogistics) tAdjacent.mTileEntity).canLogistics(tAdjacent.mSideOfTileEntity) && tScanned.add(tAdjacent.mTileEntity))
                                    tScanningNext.add((ITileEntityLogistics) tAdjacent.mTileEntity);
                            }
                        }
                }
                tScanning.clear();
                tScanning.addAll(tScanningNext);
                tScanningNext.clear();
            }
            while (++oCPU_Logic <= mCPU_Logic) {
                boolean tBreak = F;
                // Import Export Business
                for (List<LogisticsData>[] tExports : tExports1) {
                    for (List<LogisticsData>[] tImports : tImports1) {
                        if (moveFluids(tImports[0], tExports[0])) {
                            tBreak = T;
                            break;
                        }
                        if (moveStacks(tImports[1], tExports[1])) {
                            tBreak = T;
                            break;
                        }
                    }
                    if (tBreak)
                        break;
                }
                if (tBreak)
                    continue;
                for (List<LogisticsData>[] tExports : tExports2) {
                    for (List<LogisticsData>[] tImports : tImports2) {
                        if (moveFluids(tImports[0], tExports[0])) {
                            tBreak = T;
                            break;
                        }
                        if (moveStacks(tImports[1], tExports[1])) {
                            tBreak = T;
                            break;
                        }
                    }
                    if (tBreak)
                        break;
                }
                if (tBreak)
                    continue;
                // Defragmentation
                if (moveFluids(tFluidStorageGeneric, tFluidStorageFiltered))
                    continue;
                if (moveStacks(tStackStorageGeneric, tStackStorageFiltered))
                    continue;
                if (moveFluids(tFluidStorageGeneric, tFluidStorageSemi))
                    continue;
                if (moveStacks(tStackStorageGeneric, tStackStorageSemi))
                    continue;
                // Dump
                for (LogisticsData tImport : tStackStorageGeneric) {
                    for (LogisticsData tExport : tStackDumps) {
                        for (int j = 0; j < mCPU_Conversion; j++) {
                            long tMoved = ST.move(tImport.mTarget, tExport.mTarget, tFilteredFor, F, F, T, F, 64, 1, 64, 1);
                            if (tMoved > 0) {
                                oCPU_Conversion = Math.max(oCPU_Conversion, j + 1);
                                mEnergy -= tMoved;
                                tBreak = T;
                                continue;
                            }
                            break;
                        }
                        if (tBreak)
                            break;
                    }
                    if (tBreak)
                        break;
                }
                if (tBreak)
                    continue;
                // Core didn't actually get used.
                oCPU_Logic--;
                break;
            }
        }
    }
    mEnergy -= 20 + mCPU_Logic + mCPU_Control + mCPU_Storage + mCPU_Conversion;
    if (mEnergy < 0)
        mEnergy = 0;
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) CoverData(gregapi.cover.CoverData) DelegatorTileEntity(gregapi.tileentity.delegate.DelegatorTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) ItemStackContainer(gregapi.code.ItemStackContainer) ITileEntityLogisticsSemiFilteredItem(gregapi.tileentity.logistics.ITileEntityLogisticsSemiFilteredItem) List(java.util.List) DelegatorTileEntity(gregapi.tileentity.delegate.DelegatorTileEntity) ItemStackSet(gregapi.code.ItemStackSet) ArrayListNoNulls(gregapi.code.ArrayListNoNulls) HashSetNoNulls(gregapi.code.HashSetNoNulls) ITileEntityLogistics(gregapi.tileentity.logistics.ITileEntityLogistics) ITileEntityLogisticsStorage(gregapi.tileentity.logistics.ITileEntityLogisticsStorage) ItemStack(net.minecraft.item.ItemStack)

Example 4 with ItemStackSet

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

the class BlockStones method run.

@Override
@SuppressWarnings("unchecked")
public void run() {
    if ((!MD.NePl.mLoaded && !MD.NeLi.mLoaded) || (mMaterial != MT.STONES.Basalt && mMaterial != MT.STONES.Blackstone)) {
        RM.pack(rockGt.mat(mMaterial, 4), ST.make(this, 1, COBBL));
        CR.shaped(ST.make(this, 1, COBBL), CR.DEF, "XX", "XX", 'X', OP.rockGt.dat(mMaterial));
    }
    RM.add_smelting(OP.blockDust.mat(mMaterial, 1), ST.make(this, 1, STONE), F, F, F);
    CR.shaped(gearGtSmall.mat(mMaterial, 1), CR.DEF, "X ", " f", 'X', OP.stone.dat(mMaterial));
    // TODO Stairs
    CR.shaped(ST.make(Blocks.stone_stairs, 1, 0), CR.DEF_MIR, " X", "XX", 'X', OP.rockGt.dat(mMaterial));
    CR.shaped(ST.make(mSlabs[0], 1, COBBL), CR.DEF, "  ", "XX", 'X', OP.rockGt.dat(mMaterial));
    for (int i = 0; i < maxMeta(); i++) if (JUSTSTONE[i]) {
        RM.sawing(16, 16, F, 50, ST.make(mSlabs[0], 1, i), OP.plate.mat(mMaterial, 4), OP.dustSmall.mat(mMaterial, 2));
    }
    RM.sawing(16, 16, F, 50, ST.make(mSlabs[0], 1, RSTBR), OP.plate.mat(mMaterial, 4), OP.dustSmall.mat(mMaterial, 2), OP.dustSmall.mat(MT.Redstone, 2));
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[STONE]) {
        if (FL.Mana_TE.exists())
            RM.Bath.addRecipe1(T, 0, 16, tStack.toStack(), FL.Mana_TE.make(1), NF, ST.make(this, 1, CHISL));
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, SMOTH), F, F, F);
        CR.shaped(ST.make(this, 4, BRICK), CR.DEF, "XX", "XX", 'X', tStack.toStack());
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Plate.get(0), OP.plate.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Plate_Curved.get(0), OP.plateCurved.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Rod.get(0), OP.stick.mat(mMaterial, 18));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Rod_Long.get(0), OP.stickLong.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Bolt.get(0), OP.bolt.mat(mMaterial, 64));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Ingot.get(0), ST.make(this, 1, BRICK));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Block.get(0), ST.make(this, 1, STONE));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Shovel.get(0), OP.toolHeadRawShovel.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Sword.get(0), OP.toolHeadRawSword.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Hoe.get(0), OP.toolHeadRawHoe.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Pickaxe.get(0), OP.toolHeadRawPickaxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Axe.get(0), OP.toolHeadRawAxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Gear.get(0), OP.gearGt.mat(mMaterial, 2));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Gear_Small.get(0), OP.gearGtSmall.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Hammer.get(0), OP.toolHeadHammer.mat(mMaterial, 1));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Plate.get(0), OP.plate.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Plate_Curved.get(0), OP.plateCurved.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Rod.get(0), OP.stick.mat(mMaterial, 18));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Rod_Long.get(0), OP.stickLong.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Bolt.get(0), OP.bolt.mat(mMaterial, 64));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Ingot.get(0), ST.make(this, 1, BRICK));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Block.get(0), ST.make(this, 1, STONE));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Shovel.get(0), OP.toolHeadRawShovel.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Sword.get(0), OP.toolHeadRawSword.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Hoe.get(0), OP.toolHeadRawHoe.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Pickaxe.get(0), OP.toolHeadRawPickaxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Axe.get(0), OP.toolHeadRawAxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Gear.get(0), OP.gearGt.mat(mMaterial, 2));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Gear_Small.get(0), OP.gearGtSmall.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Hammer.get(0), OP.toolHeadHammer.mat(mMaterial, 1));
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[COBBL]) {
        if (FL.Mana_TE.exists())
            RM.Bath.addRecipe1(T, 0, 16, tStack.toStack(), FL.Mana_TE.make(1), NF, ST.make(this, 1, MCOBL));
        RM.Hammer.addRecipe1(T, 16, 16, 8000, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.cobblestone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shaped(ST.make(mSlabs[0], 4, COBBL), CR.DEF, "  ", "XX", 'X', tStack.toStack());
        // TODO Stairs
        CR.shaped(ST.make(Blocks.stone_stairs, 4, 0), CR.DEF_MIR, " X", "XX", 'X', tStack.toStack());
        // TODO Walls
        CR.shaped(ST.make(Blocks.cobblestone_wall, 6, 0), CR.DEF_MIR, "XXX", "XXX", 'X', tStack.toStack());
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Plate.get(0), OP.plate.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Plate_Curved.get(0), OP.plateCurved.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Rod.get(0), OP.stick.mat(mMaterial, 18));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Rod_Long.get(0), OP.stickLong.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Bolt.get(0), OP.bolt.mat(mMaterial, 64));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Ingot.get(0), ST.make(this, 1, BRICK));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Block.get(0), ST.make(this, 1, STONE));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Shovel.get(0), OP.toolHeadRawShovel.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Sword.get(0), OP.toolHeadRawSword.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Hoe.get(0), OP.toolHeadRawHoe.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Pickaxe.get(0), OP.toolHeadRawPickaxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Axe.get(0), OP.toolHeadRawAxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Gear.get(0), OP.gearGt.mat(mMaterial, 2));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Gear_Small.get(0), OP.gearGtSmall.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_Extruder_Hammer.get(0), OP.toolHeadHammer.mat(mMaterial, 1));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Plate.get(0), OP.plate.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Plate_Curved.get(0), OP.plateCurved.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Rod.get(0), OP.stick.mat(mMaterial, 18));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Rod_Long.get(0), OP.stickLong.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Bolt.get(0), OP.bolt.mat(mMaterial, 64));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Ingot.get(0), ST.make(this, 1, BRICK));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Block.get(0), ST.make(this, 1, STONE));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Shovel.get(0), OP.toolHeadRawShovel.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Sword.get(0), OP.toolHeadRawSword.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Hoe.get(0), OP.toolHeadRawHoe.mat(mMaterial, 4));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Pickaxe.get(0), OP.toolHeadRawPickaxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Axe.get(0), OP.toolHeadRawAxe.mat(mMaterial, 3));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Gear.get(0), OP.gearGt.mat(mMaterial, 2));
        RM.Extruder.addRecipe2(T, F, F, F, T, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Gear_Small.get(0), OP.gearGtSmall.mat(mMaterial, 9));
        RM.Extruder.addRecipe2(T, F, F, F, F, 16, 32, ST.amount(1, tStack.toStack()), IL.Shape_SimpleEx_Hammer.get(0), OP.toolHeadHammer.mat(mMaterial, 1));
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[MCOBL]) {
        RM.Hammer.addRecipe1(T, 16, 16, 8000, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.mossy_cobblestone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[BRICK]) {
        if (FL.Mana_TE.exists())
            RM.Bath.addRecipe1(T, 0, 16, tStack.toStack(), FL.Mana_TE.make(1), NF, ST.make(this, 1, MBRIK));
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stonebrick, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shaped(ST.make(this, 1, CRACK), CR.DEF, "h", "X", 'X', tStack.toStack());
        CR.shaped(ST.make(this, 1, RNFBR), CR.DEF_MIR, "Se", "X ", 'X', tStack.toStack(), 'S', OP.stick.dat(ANY.Iron));
        CR.shaped(ST.make(this, 1, RSTBR), CR.DEF, "Dh", "X ", 'X', tStack.toStack(), 'D', OD.itemRedstone);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[CRACK]) {
        RM.Hammer.addRecipe1(T, 16, 16, 7000, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stonebrick, 1, 1));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[MBRIK]) {
        RM.Hammer.addRecipe1(T, 16, 16, 7000, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stonebrick, 1, 2));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[CHISL]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stonebrick, 1, 3));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[SMOTH]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, COBBL));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shaped(ST.make(this, 1, CHISL), CR.DEF, "y", "X", 'X', tStack.toStack());
        CR.shaped(ST.make(this, 4, BRICK), CR.DEF, "XX", "XX", 'X', tStack.toStack());
        CR.shaped(ST.make(this, 2, TILES), CR.DEF, "X", "X", 'X', tStack.toStack());
        CR.shaped(ST.make(this, 2, STILE), CR.DEF, "XX", 'X', tStack.toStack());
        CR.shaped(ST.make(this, 2, SBRIK), CR.DEF, "X ", " X", 'X', tStack.toStack());
        CR.shaped(ST.make(this, 2, WINDA), CR.DEF, " X", "X ", 'X', tStack.toStack());
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[RNFBR]) {
        RM.Hammer.addRecipe1(T, 16, 16, 7000, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Crusher.addRecipe1(T, 16, 64 + mHarvestLevel * 64, tStack.toStack(), ST.make(this, 1, COBBL), OM.dust(MT.Fe, OP.stick.mAmount));
        RM.Shredder.addRecipe1(T, 16, 64 + mHarvestLevel * 64, tStack.toStack(), OP.blockDust.mat(mMaterial, 1), OM.dust(MT.Fe, OP.stick.mAmount));
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[RSTBR]) {
        RM.Hammer.addRecipe1(T, 16, 16, 7000, tStack.toStack(), OP.rockGt.mat(mMaterial, 4));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK), OM.dust(MT.Redstone));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1), OM.dust(MT.Redstone));
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[TILES]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shapeless(ST.make(this, 1, QBRIK), CR.DEF, new Object[] { tStack.toStack() });
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[STILE]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[SBRIK]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[WINDA]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shapeless(ST.make(this, 1, WINDB), CR.DEF, new Object[] { tStack.toStack() });
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[WINDB]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shapeless(ST.make(this, 1, WINDA), CR.DEF, new Object[] { tStack.toStack() });
    }
    for (ItemStackContainer tStack : (ItemStackSet<ItemStackContainer>) mEqualBlocks[QBRIK]) {
        RM.Hammer.addRecipe1(T, 16, 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Crusher.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), ST.make(this, 1, CRACK));
        RM.Shredder.addRecipe1(T, 16, 16 + mHarvestLevel * 16, tStack.toStack(), OP.blockDust.mat(mMaterial, 1));
        RM.generify(tStack.toStack(), ST.make(Blocks.stone, 1, 0));
        RM.add_smelting(tStack.toStack(), ST.make(this, 1, STONE), F, F, F);
        CR.shapeless(ST.make(this, 1, TILES), CR.DEF, new Object[] { tStack.toStack() });
    }
}
Also used : ItemStackContainer(gregapi.code.ItemStackContainer) ItemStackSet(gregapi.code.ItemStackSet)

Aggregations

ItemStackSet (gregapi.code.ItemStackSet)4 ArrayListNoNulls (gregapi.code.ArrayListNoNulls)3 ItemStack (net.minecraft.item.ItemStack)3 ItemStackContainer (gregapi.code.ItemStackContainer)2 TC_AspectStack (gregapi.data.TC.TC_AspectStack)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 HashSetNoNulls (gregapi.code.HashSetNoNulls)1 IItemContainer (gregapi.code.IItemContainer)1 TagData (gregapi.code.TagData)1 CoverData (gregapi.cover.CoverData)1 ICover (gregapi.cover.ICover)1 IItemEnergy (gregapi.item.IItemEnergy)1 IBehavior (gregapi.item.multiitem.behaviors.IBehavior)1 IFoodStat (gregapi.item.multiitem.food.IFoodStat)1 PrefixItem (gregapi.item.prefixitem.PrefixItem)1 OreDictItemData (gregapi.oredict.OreDictItemData)1 DelegatorTileEntity (gregapi.tileentity.delegate.DelegatorTileEntity)1 ITileEntityLogistics (gregapi.tileentity.logistics.ITileEntityLogistics)1 ITileEntityLogisticsSemiFilteredItem (gregapi.tileentity.logistics.ITileEntityLogisticsSemiFilteredItem)1 ITileEntityLogisticsStorage (gregapi.tileentity.logistics.ITileEntityLogisticsStorage)1