use of gregtech.api.unification.material.properties.DustProperty in project gregicality-science by GregTechCEu.
the class GCYSPropertyAddition method init.
public static void init() {
// Dusts
Praseodymium.setProperty(PropertyKey.DUST, new DustProperty());
Scandium.setProperty(PropertyKey.DUST, new DustProperty());
Gadolinium.setProperty(PropertyKey.DUST, new DustProperty());
Terbium.setProperty(PropertyKey.DUST, new DustProperty());
Dysprosium.setProperty(PropertyKey.DUST, new DustProperty());
Holmium.setProperty(PropertyKey.DUST, new DustProperty());
Erbium.setProperty(PropertyKey.DUST, new DustProperty());
Thulium.setProperty(PropertyKey.DUST, new DustProperty());
Ytterbium.setProperty(PropertyKey.DUST, new DustProperty());
RhodiumSulfate.setProperty(PropertyKey.DUST, new DustProperty());
RhodiumSulfate.setMaterialIconSet(MaterialIconSet.ROUGH);
Zirconium.setProperty(PropertyKey.DUST, new DustProperty());
}
use of gregtech.api.unification.material.properties.DustProperty 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.properties.DustProperty 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.properties.DustProperty in project GregTech by GregTechCEu.
the class CommonProxy method modifyFuelBurnTime.
@SubscribeEvent
public static void modifyFuelBurnTime(FurnaceFuelBurnTimeEvent event) {
ItemStack stack = event.getItemStack();
Block block = Block.getBlockFromItem(stack.getItem());
// handle sapling and log burn rates
if (block == RUBBER_LOG || block == PLANKS) {
event.setBurnTime(300);
} else if (block == RUBBER_SAPLING) {
event.setBurnTime(100);
}
// handle material blocks burn value
if (stack.getItem() instanceof CompressedItemBlock) {
CompressedItemBlock itemBlock = (CompressedItemBlock) stack.getItem();
Material material = itemBlock.getBlockState(stack).getValue(itemBlock.compressedBlock.variantProperty);
DustProperty property = material.getProperty(PropertyKey.DUST);
if (property != null && property.getBurnTime() > 0) {
// compute burn value for block prefix, taking amount of material in block into account
double materialUnitsInBlock = OrePrefix.block.getMaterialAmount(material) / (GTValues.M * 1.0);
event.setBurnTime((int) (materialUnitsInBlock * property.getBurnTime()));
}
}
}
use of gregtech.api.unification.material.properties.DustProperty in project GregTech by GregTechCEu.
the class ToolMetaItem method getHarvestLevel.
public int getHarvestLevel(ItemStack itemStack) {
T metaToolValueItem = getItem(itemStack);
if (metaToolValueItem != null) {
NBTTagCompound toolTag = getToolStatsTag(itemStack);
Material toolMaterial = getToolMaterial(itemStack);
IToolStats toolStats = metaToolValueItem.getToolStats();
int harvestLevel = 0;
if (toolTag != null && toolTag.hasKey("HarvestLevel")) {
harvestLevel = toolTag.getInteger("HarvestLevel");
} else if (toolMaterial != null) {
DustProperty prop = toolMaterial.getProperty(PropertyKey.DUST);
if (prop != null)
harvestLevel = prop.getHarvestLevel();
else
return 0;
}
int baseHarvestLevel = toolStats.getBaseQuality(itemStack);
return baseHarvestLevel + harvestLevel;
}
return 0;
}
Aggregations