Update all harvest-levels of materials before doing the custom changes so unlisted materials keep their intended harvest level (like Thermal Foundation materials)

This commit is contained in:
Bernhard Bonigl committed 2015-02-10 17:36:39 +01:00
1 parent c011d3b55b
commit eec9ed5b7a
1 file changed
+13
@@ -1,5 +1,8 @@
package iguanaman.iguanatweakstconstruct.harvestlevels;
import java.util.Collection;
import java.util.HashSet;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import iguanaman.iguanatweakstconstruct.reference.Config;
@@ -42,6 +45,16 @@ public final class TinkerMaterialTweaks {
durabilityMod = Config.durabilityPercentage / 100f;
speedMod = Config.miningSpeedPercentage / 100f;
// at first we update each material to keep the harvest levels on non-listed materials appropriate
Collection<ToolMaterial> copyOfMaterials = new HashSet<ToolMaterial>(TConstructRegistry.toolMaterials.values());
for(ToolMaterial material : copyOfMaterials)
{
// new harvest level
int newHlvl = HarvestLevelTweaks.getUpdatedHarvestLevel(material.harvestLevel());
updateMaterial(newHlvl, material.name(), material.durability(), material.toolSpeed(), material.attack(), material.handleDurability());
}
// modify the base materials added by tinkers construct
modifyTcon();
if(ModSupportHelper.ExtraTiC)