Search in sources :

Example 16 with Material

use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.

the class MetaBlocks method createSurfaceRockBlock.

private static void createSurfaceRockBlock(Material[] materials, int index) {
    BlockSurfaceRock block = new BlockSurfaceRock(materials);
    block.setRegistryName("meta_block_surface_rock_" + index);
    for (Material material : materials) {
        SURFACE_ROCK.put(material, block);
    }
}
Also used : Material(gregtech.api.unification.material.Material)

Example 17 with Material

use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.

the class MetaBlocks method createFrameBlock.

private static void createFrameBlock(Material[] materials, int index) {
    BlockFrame block = new BlockFrame(materials);
    block.setRegistryName("meta_block_frame_" + index);
    for (Material m : materials) {
        FRAMES.put(m, block);
    }
}
Also used : Material(gregtech.api.unification.material.Material)

Example 18 with Material

use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.

the class AbstractMaterialPartBehavior method addInformation.

@Override
public void addInformation(ItemStack stack, List<String> lines) {
    Material material = getPartMaterial(stack);
    int maxDurability = getPartMaxDurability(stack);
    int damage = getPartDamage(stack);
    lines.add(I18n.format("metaitem.tool.tooltip.durability", maxDurability - damage, maxDurability));
    lines.add(I18n.format("metaitem.tool.tooltip.primary_material", material.getLocalizedName(), material.getHarvestLevel()));
}
Also used : Material(gregtech.api.unification.material.Material)

Example 19 with Material

use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.

the class EnchantmentTableTweaks method isValidForEnchantment.

private static boolean isValidForEnchantment(ItemStack itemStack) {
    UnificationEntry entry = OreDictUnifier.getUnificationEntry(itemStack);
    if (entry == null || entry.orePrefix != OrePrefix.gem || entry.material == null) {
        return false;
    }
    Material material = entry.material;
    return material == Materials.Lapis || material == Materials.Lazurite || material == Materials.Sodalite;
}
Also used : UnificationEntry(gregtech.api.unification.stack.UnificationEntry) Material(gregtech.api.unification.material.Material)

Example 20 with Material

use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.

the class TurbineRotorBehavior method getPartMaxDurability.

// TODO rework rotor stats once material stats are also reworked
@Override
public int getPartMaxDurability(ItemStack itemStack) {
    Material material = getPartMaterial(itemStack);
    ToolProperty property = material.getProperty(PropertyKey.TOOL);
    return property == null ? -1 : 800 * (int) Math.pow(property.getToolDurability(), 0.65);
}
Also used : Material(gregtech.api.unification.material.Material) ToolProperty(gregtech.api.unification.material.properties.ToolProperty)

Aggregations

Material (gregtech.api.unification.material.Material)76 ItemStack (net.minecraft.item.ItemStack)31 UnificationEntry (gregtech.api.unification.stack.UnificationEntry)19 OrePrefix (gregtech.api.unification.ore.OrePrefix)13 MaterialStack (gregtech.api.unification.stack.MaterialStack)12 Nonnull (javax.annotation.Nonnull)10 PropertyKey (gregtech.api.unification.material.properties.PropertyKey)9 Block (net.minecraft.block.Block)8 IBlockState (net.minecraft.block.state.IBlockState)8 GTValues (gregtech.api.GTValues)7 Collectors (java.util.stream.Collectors)7 Nullable (javax.annotation.Nullable)7 Materials (gregtech.api.unification.material.Materials)6 DustProperty (gregtech.api.unification.material.properties.DustProperty)6 ToolProperty (gregtech.api.unification.material.properties.ToolProperty)6 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)6 GregTechAPI (gregtech.api.GregTechAPI)5 OreDictUnifier (gregtech.api.unification.OreDictUnifier)5 MarkerMaterial (gregtech.api.unification.material.MarkerMaterial)5 ItemMaterialInfo (gregtech.api.unification.stack.ItemMaterialInfo)5