use of slimeknights.tconstruct.library.materials.HandleMaterialStats in project SilentGems by SilentChaos512.
the class TConstructGemsCompat method register.
private static void register(EnumGem gem, EnumMaterialTier tier) {
Material material = new TConstructMaterialGem(gem, tier);
String itemOreName = tier == EnumMaterialTier.SUPER ? gem.getItemSuperOreName() : gem.getItemOreName();
material.addItem(itemOreName, 1, Material.VALUE_Ingot);
material.setCraftable(true);
SilentGems.proxy.setTinkersRenderColor(material, gem.getColor());
int durability = gem.getDurability(tier);
float miningSpeed = gem.getMiningSpeed(tier);
float meleeDamage = gem.getMeleeDamage(tier);
float meleeSpeed = gem.getMeleeSpeed(tier);
int harvestLevel = gem.getHarvestLevel(tier);
float drawDelay = Math.max(38.4f - 1.4f * meleeSpeed * miningSpeed, 10);
TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(durability, miningSpeed, meleeDamage, harvestLevel), new HandleMaterialStats(0.875f, durability / 8), new ExtraMaterialStats(durability / 8), new BowMaterialStats(20f / drawDelay, 1f, 0.4f * meleeDamage - 1), new ArrowShaftMaterialStats(1.0f, 0));
materials.put(material.identifier, material);
}
use of slimeknights.tconstruct.library.materials.HandleMaterialStats in project BaseMetals by MinecraftModDevelopmentMods.
the class TinkersConstructRegistry method addMaterialStats.
/**
*/
public void addMaterialStats() {
final String curMod = Loader.instance().activeModContainer().getModId();
for (final Entry<String, TCMaterial> entry : registry.get(curMod).entrySet()) {
// be double sure!
entry.getValue().settle();
final HeadMaterialStats headStats = entry.getValue().getHeadStats();
final HandleMaterialStats handleStats = entry.getValue().getHandleStats();
final ExtraMaterialStats extraStats = entry.getValue().getExtraStats();
final BowMaterialStats bowStats = entry.getValue().getBowStats();
final ArrowShaftMaterialStats arrowStats = entry.getValue().getArrowStats();
final FletchingMaterialStats fletchingStats = entry.getValue().getFletchingStats();
if (TinkerRegistry.getMaterial(entry.getKey()) == entry.getValue().getMaterial()) {
// the material was properly registered
final Material work = entry.getValue().getMaterial();
TinkerRegistry.addMaterialStats(work, headStats, handleStats, extraStats);
TinkerRegistry.addMaterialStats(work, bowStats);
TinkerRegistry.addMaterialStats(work, arrowStats);
TinkerRegistry.addMaterialStats(work, fletchingStats);
}
}
}
Aggregations