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