Search in sources :

Example 6 with SolidMaterial

use of gregtech.api.unification.material.type.SolidMaterial in project GregTech by GregTechCE.

the class ProcessingToolOther method registerOre.

// @Override
public void registerOre(UnificationEntry entry, String modName, SimpleItemStack simpleStack) {
    if (entry.material != Materials.Stone && entry.material != Materials.Flint) {
        if (entry.material != Materials.Rubber) {
            ModHandler.addShapedRecipe("plunger_" + entry.material + "_" + entry.material, MetaItems.PLUNGER.getStackForm(entry.material, entry.material), "xRR", " SR", "S f", 'S', new UnificationEntry(OrePrefix.stick, entry.material), 'R', new UnificationEntry(OrePrefix.plate, Materials.Rubber));
        }
        if (!ModHandler.isMaterialWood(entry.material) && !entry.material.hasFlag(NO_SMASHING)) {
            if (entry.material instanceof SolidMaterial) {
                SolidMaterial solidMaterial = (SolidMaterial) entry.material;
                ModHandler.addShapedRecipe("screwdriver_" + solidMaterial + "_" + solidMaterial.handleMaterial, MetaItems.SCREWDRIVER.getStackForm(solidMaterial, solidMaterial.handleMaterial), " fS", " Sh", "W  ", 'S', OreDictUnifier.get(OrePrefix.stick, solidMaterial), 'W', OreDictUnifier.get(OrePrefix.stick, solidMaterial));
            }
            ModHandler.addShapedRecipe("wrench_" + entry.material + "_" + entry.material, MetaItems.WRENCH.getStackForm(entry.material, entry.material), "IhI", "III", " I ", 'I', OreDictUnifier.get(OrePrefix.ingot, entry.material));
            ModHandler.addShapedRecipe("crowbar_" + entry.material + "_" + entry.material, MetaItems.CROWBAR.getStackForm(entry.material, entry.material), "hDS", "DSD", "SDf", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'D', EnumDyeColor.BLUE);
            ModHandler.addShapedRecipe("wirecutter_" + entry.material + "_" + entry.material, MetaItems.WIRECUTTER.getStackForm(entry.material, entry.material), "PfP", "hPd", "STS", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'T', OreDictUnifier.get(OrePrefix.screw, entry.material));
            ModHandler.addShapedRecipe("scoop_" + entry.material + "_" + entry.material, MetaItems.SCOOP.getStackForm(entry.material, entry.material), "SWS", "SSS", "xSh", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'W', new ItemStack(Blocks.WOOL, 1, 32767));
            ModHandler.addShapedRecipe("branchcutter_" + entry.material + "_" + entry.material, MetaItems.BRANCHCUTTER.getStackForm(entry.material, entry.material), "PfP", "PdP", "STS", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'T', OreDictUnifier.get(OrePrefix.screw, entry.material));
            ModHandler.addShapedRecipe("knife_" + entry.material + "_" + entry.material, MetaItems.KNIFE.getStackForm(entry.material, entry.material), "fPh", " S ", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material));
            ModHandler.addShapedRecipe("butchknife_" + entry.material + "_" + entry.material, MetaItems.BUTCHERYKNIFE.getStackForm(entry.material, entry.material), "PPf", "PP ", "Sh ", 'S', OreDictUnifier.get(OrePrefix.stick, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material));
            ModHandler.addShapedRecipe("soldiron_lv_" + entry.material + "_" + Materials.Rubber, // TODO electric tools
            MetaItems.SOLDERING_IRON_LV.getStackForm(entry.material, Materials.Rubber), "LBf", "Sd ", "P  ", 'B', OreDictUnifier.get(OrePrefix.bolt, entry.material), 'P', OreDictUnifier.get(OrePrefix.plate, entry.material), 'S', OreDictUnifier.get(OrePrefix.stick, Materials.Iron), 'L', MetaItems.BATTERY_RE_LV_LITHIUM.getStackForm());
        }
    }
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) SimpleItemStack(gregtech.api.unification.stack.SimpleItemStack) ItemStack(net.minecraft.item.ItemStack)

Example 7 with SolidMaterial

use of gregtech.api.unification.material.type.SolidMaterial in project GregTech by GregTechCE.

the class ToolMetaItem method getPrimaryMaterial.

@Nullable
public static SolidMaterial getPrimaryMaterial(ItemStack itemStack) {
    NBTTagCompound statsTag = itemStack.getSubCompound("GT.ToolStats");
    if (statsTag == null || !statsTag.hasKey("GT.ToolPrimaryMaterial", Constants.NBT.TAG_STRING))
        return null;
    Material material = Material.MATERIAL_REGISTRY.getObject(statsTag.getString("GT.ToolPrimaryMaterial"));
    if (material instanceof SolidMaterial) {
        return (SolidMaterial) material;
    }
    return null;
}
Also used : SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) Material(gregtech.api.unification.material.type.Material) Nullable(javax.annotation.Nullable)

Example 8 with SolidMaterial

use of gregtech.api.unification.material.type.SolidMaterial in project GregTech by GregTechCE.

the class ToolMetaItem method getHandleMaterial.

@Nullable
public static SolidMaterial getHandleMaterial(ItemStack itemStack) {
    NBTTagCompound statsTag = itemStack.getSubCompound("GT.ToolStats");
    if (statsTag == null || !statsTag.hasKey("GT.ToolHandleMaterial", Constants.NBT.TAG_STRING))
        return null;
    Material material = Material.MATERIAL_REGISTRY.getObject(statsTag.getString("GT.ToolHandleMaterial"));
    if (material instanceof SolidMaterial) {
        return (SolidMaterial) material;
    }
    return null;
}
Also used : SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) Material(gregtech.api.unification.material.type.Material) Nullable(javax.annotation.Nullable)

Example 9 with SolidMaterial

use of gregtech.api.unification.material.type.SolidMaterial in project GregTech by GregTechCE.

the class ToolMetaItem method getColorForItemStack.

@Override
@SideOnly(Side.CLIENT)
protected int getColorForItemStack(ItemStack stack, int tintIndex) {
    SolidMaterial primaryMaterial = getPrimaryMaterial(stack);
    SolidMaterial handleMaterial = getHandleMaterial(stack);
    switch(tintIndex) {
        case 0:
            return primaryMaterial != null ? primaryMaterial.materialRGB : 0xFFFFFF;
        case 1:
            return 0xFFFFFF;
        case 2:
            return handleMaterial != null ? handleMaterial.materialRGB : 0xFFFFFF;
        case 3:
            return 0xFFFFFF;
    }
    return 0xFFFFFF;
}
Also used : SolidMaterial(gregtech.api.unification.material.type.SolidMaterial) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 10 with SolidMaterial

use of gregtech.api.unification.material.type.SolidMaterial in project GregTech by GregTechCE.

the class BlockOre method getHarvestLevel.

@Override
public int getHarvestLevel(IBlockState state) {
    StoneType stoneType = state.getValue(STONE_TYPE);
    boolean small = state.getValue(SMALL);
    if (material instanceof SolidMaterial) {
        int toolQuality = ((SolidMaterial) material).harvestLevel;
        return Math.max(stoneType.stoneMaterial.harvestLevel, toolQuality > 1 ? toolQuality - 1 : toolQuality);
    }
    return 1;
}
Also used : StoneType(gregtech.api.unification.ore.StoneType) PropertyStoneType(gregtech.common.blocks.properties.PropertyStoneType) SolidMaterial(gregtech.api.unification.material.type.SolidMaterial)

Aggregations

SolidMaterial (gregtech.api.unification.material.type.SolidMaterial)15 SimpleItemStack (gregtech.api.unification.stack.SimpleItemStack)9 ItemStack (net.minecraft.item.ItemStack)9 DustMaterial (gregtech.api.unification.material.type.DustMaterial)4 Material (gregtech.api.unification.material.type.Material)3 UnificationEntry (gregtech.api.unification.stack.UnificationEntry)3 Nullable (javax.annotation.Nullable)3 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3 HashMultimap (com.google.common.collect.HashMultimap)1 Multimap (com.google.common.collect.Multimap)1 GTValues (gregtech.api.GTValues)1 GregTechAPI (gregtech.api.GregTechAPI)1 IElectricItem (gregtech.api.capability.IElectricItem)1 EnchantmentData (gregtech.api.enchants.EnchantmentData)1 IDamagableItem (gregtech.api.items.IDamagableItem)1 ToolDictNames (gregtech.api.items.ToolDictNames)1 MetaItem (gregtech.api.items.metaitem.MetaItem)1 IMetaItemStats (gregtech.api.items.metaitem.stats.IMetaItemStats)1 Materials (gregtech.api.unification.material.Materials)1 GemMaterial (gregtech.api.unification.material.type.GemMaterial)1