use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.
the class MetaFluids method init.
public static void init() {
fluidSprites.add(AUTO_GENERATED_PLASMA_TEXTURE);
registerIconFluidSprites();
// handle vanilla fluids
handleNonMaterialFluids(Materials.Water, FluidRegistry.WATER);
handleNonMaterialFluids(Materials.Lava, FluidRegistry.LAVA);
// alternative names for forestry fluids
addAlternativeNames();
// set custom textures for fluids
setCustomTextures();
for (Material material : GregTechAPI.MATERIAL_REGISTRY) {
FluidProperty fluidProperty = material.getProperty(PropertyKey.FLUID);
if (fluidProperty != null && fluidProperty.getFluid() == null) {
int temperature = Math.max(material.getBlastTemperature(), fluidProperty.getFluidTemperature());
Fluid fluid = registerFluid(material, fluidProperty.getFluidType(), temperature, fluidProperty.hasBlock());
fluidProperty.setFluid(fluid);
fluidProperty.setFluidTemperature(fluid.getTemperature(), fluid.getTemperature() >= 0);
}
PlasmaProperty plasmaProperty = material.getProperty(PropertyKey.PLASMA);
if (plasmaProperty != null && plasmaProperty.getPlasma() == null) {
int temperature = (fluidProperty == null ? 0 : fluidProperty.getFluidTemperature()) + 30000;
Fluid fluid = registerFluid(material, FluidTypes.PLASMA, temperature, false);
plasmaProperty.setPlasma(fluid);
}
}
}
use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.
the class MetaPrefixItem method isBeaconPayment.
@Override
public boolean isBeaconPayment(ItemStack stack) {
int damage = stack.getMetadata();
Material material = GregTechAPI.MATERIAL_REGISTRY.getObjectById(damage);
if (this.prefix != null && material != null) {
boolean isSolidState = this.prefix == OrePrefix.ingot || this.prefix == OrePrefix.gem;
DustProperty property = material.getProperty(PropertyKey.DUST);
boolean isMaterialTiered = property != null && property.getHarvestLevel() >= 2;
return isSolidState && isMaterialTiered;
}
return false;
}
use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.
the class MetaPrefixItem method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(@Nonnull ItemStack itemStack, @Nullable World worldIn, @Nonnull List<String> lines, @Nonnull ITooltipFlag tooltipFlag) {
super.addInformation(itemStack, worldIn, lines, tooltipFlag);
int damage = itemStack.getItemDamage();
Material material = GregTechAPI.MATERIAL_REGISTRY.getObjectById(damage);
if (prefix == null || material == null)
return;
addMaterialTooltip(lines, itemStack);
}
use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.
the class MetaPrefixItem method getItemBurnTime.
@Override
public int getItemBurnTime(@Nonnull ItemStack itemStack) {
int damage = itemStack.getItemDamage();
Material material = GregTechAPI.MATERIAL_REGISTRY.getObjectById(damage);
DustProperty property = material == null ? null : material.getProperty(PropertyKey.DUST);
if (property != null)
return (int) (property.getBurnTime() * prefix.getMaterialAmount(material) / GTValues.M);
return super.getItemBurnTime(itemStack);
}
use of gregtech.api.unification.material.Material in project GregTech by GregTechCEu.
the class ToolMetaItem method addInformation.
@Override
@SideOnly(Side.CLIENT)
public void addInformation(@Nonnull ItemStack itemStack, @Nullable World worldIn, @Nonnull List<String> lines, @Nonnull ITooltipFlag tooltipFlag) {
T item = getItem(itemStack);
if (item == null) {
return;
}
IToolStats toolStats = item.getToolStats();
Material primaryMaterial = getToolMaterial(itemStack);
int maxInternalDamage = getMaxItemDamage(itemStack);
if (toolStats.isUsingDurability(itemStack) && maxInternalDamage > 0) {
lines.add(I18n.format("metaitem.tool.tooltip.durability", maxInternalDamage - getItemDamage(itemStack), maxInternalDamage));
}
lines.add(I18n.format("metaitem.tool.tooltip.primary_material", primaryMaterial.getLocalizedName(), getHarvestLevel(itemStack)));
lines.add(I18n.format("metaitem.tool.tooltip.attack_damage", toolStats.getBaseDamage(itemStack) + primaryMaterial.getHarvestLevel()));
lines.add(I18n.format("metaitem.tool.tooltip.mining_speed", getToolDigSpeed(itemStack)));
super.addInformation(itemStack, worldIn, lines, tooltipFlag);
toolStats.addInformation(itemStack, lines, tooltipFlag.isAdvanced());
}
Aggregations