Added in an "Always" option for regenerating Energy Values (useful for mod addon authors, thanks for the suggestion @Dynious!)
This commit is contained in:
parent
90e89673d3
commit
75cc883063
|
@ -8,6 +8,7 @@ import com.pahimar.ee3.knowledge.AbilityRegistry;
|
||||||
import com.pahimar.ee3.recipe.RecipeRegistry;
|
import com.pahimar.ee3.recipe.RecipeRegistry;
|
||||||
import com.pahimar.ee3.reference.Files;
|
import com.pahimar.ee3.reference.Files;
|
||||||
import com.pahimar.ee3.reference.Reference;
|
import com.pahimar.ee3.reference.Reference;
|
||||||
|
import com.pahimar.ee3.reference.Settings;
|
||||||
import com.pahimar.ee3.util.*;
|
import com.pahimar.ee3.util.*;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -755,21 +756,28 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// else if (md5EnergyValuesFile.exists())
|
// else if (md5EnergyValuesFile.exists())
|
||||||
if (md5EnergyValuesFile.exists())
|
if (!Settings.DynamicEnergyValueGeneration.regenerateEnergyValuesWhen.equalsIgnoreCase("Always"))
|
||||||
{
|
{
|
||||||
LogHelper.info("Attempting to load energy values from file: " + md5EnergyValuesFile.getAbsolutePath());
|
if (md5EnergyValuesFile.exists())
|
||||||
nbtTagCompound = SerializationHelper.readNBTFromFile(md5EnergyValuesFile);
|
{
|
||||||
}
|
LogHelper.info("Attempting to load energy values from file: " + md5EnergyValuesFile.getAbsolutePath());
|
||||||
|
nbtTagCompound = SerializationHelper.readNBTFromFile(md5EnergyValuesFile);
|
||||||
|
}
|
||||||
|
|
||||||
if (nbtTagCompound != null)
|
if (nbtTagCompound != null)
|
||||||
{
|
{
|
||||||
energyValueRegistry.readFromNBT(nbtTagCompound);
|
energyValueRegistry.readFromNBT(nbtTagCompound);
|
||||||
LogHelper.info("Successfully loaded energy values from file");
|
LogHelper.info("Successfully loaded energy values from file");
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogHelper.info("No energy value file to load values from, generating new values");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogHelper.info("No energy value file to load values from, generating new values");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue