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());
}
}
}
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;
}
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;
}
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;
}
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;
}
Aggregations