use of gregtech.api.unification.material.type.Material in project GregTech by GregTechCE.
the class BlockCompressedFactory method fillSample.
@Override
protected String fillSample(Block block, String blockStateSample) {
ImmutableList<Material> allowedValues = ((BlockCompressed) block).variantProperty.getAllowedValues();
ArrayList<String> variants = new ArrayList<>();
for (Material material : allowedValues) {
variants.add(VARIANT_DEFINITION.replace("$MATERIAL$", material.toString()).replace("$TEXTURE$", MaterialIconType.block.getBlockPath(material.materialIconSet).toString()));
}
return blockStateSample.replace("$VARIANTS$", COMMA_JOINER.join(variants));
}
use of gregtech.api.unification.material.type.Material in project GregTech by GregTechCE.
the class MetaItem1 method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemStack, @Nullable World world, List<String> lines, ITooltipFlag tooltipFlag) {
super.addInformation(itemStack, world, lines, tooltipFlag);
int damage = itemStack.getItemDamage();
if (damage < this.metaItemOffset && damage >= 0) {
Material material = Material.MATERIAL_REGISTRY.getObjectById(damage % 1000);
if (material != null) {
OrePrefix prefix = this.orePrefixes[(damage / 1000)];
if (prefix == OrePrefix.dustImpure || prefix == OrePrefix.dustPure) {
lines.add(I18n.format("metaitem.dust.tooltip.purify"));
}
}
}
}
Aggregations