Clearing more chaff out
This commit is contained in:
parent
ebf4fe90d0
commit
f3011f091c
|
@ -52,24 +52,20 @@ public class EquivalentExchange3
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onServerStarting(FMLServerStartingEvent event)
|
public void onServerStarting(FMLServerStartingEvent event) {
|
||||||
{
|
|
||||||
SerializationHelper.initModDataDirectories();
|
SerializationHelper.initModDataDirectories();
|
||||||
|
|
||||||
TransmutationKnowledgeRegistry.getInstance();
|
TransmutationKnowledgeRegistry.getInstance();
|
||||||
|
|
||||||
AbilityRegistry.getInstance().loadAbilityRegistryFromFile(ConfigurationHandler.Settings.onlyLoadFile);
|
AbilityRegistry.getInstance().loadAbilityRegistryFromFile(ConfigurationHandler.Settings.onlyLoadFile);
|
||||||
|
|
||||||
event.registerServerCommand(new CommandEE());
|
event.registerServerCommand(new CommandEE());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event)
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
{
|
|
||||||
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
|
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
|
||||||
|
|
||||||
Files.init(event);
|
Files.init(event);
|
||||||
Files.Global.init(event);
|
|
||||||
|
|
||||||
PacketHandler.init();
|
PacketHandler.init();
|
||||||
|
|
||||||
|
@ -87,8 +83,8 @@ public class EquivalentExchange3
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void init(FMLInitializationEvent event)
|
public void init(FMLInitializationEvent event) {
|
||||||
{
|
|
||||||
// Register the GUI Handler
|
// Register the GUI Handler
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
|
||||||
|
|
||||||
|
@ -127,14 +123,11 @@ public class EquivalentExchange3
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void handleMissingMappingEvent(FMLMissingMappingsEvent event)
|
public void handleMissingMappingEvent(FMLMissingMappingsEvent event) {
|
||||||
{
|
|
||||||
for (FMLMissingMappingsEvent.MissingMapping mapping : event.get())
|
for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
|
||||||
{
|
if (mapping.type == GameRegistry.Type.ITEM) {
|
||||||
if (mapping.type == GameRegistry.Type.ITEM)
|
if (mapping.name.equals("EE3:alchemicalTome")) {
|
||||||
{
|
|
||||||
if (mapping.name.equals("EE3:alchemicalTome"))
|
|
||||||
{
|
|
||||||
mapping.remap(ModItems.alchenomicon);
|
mapping.remap(ModItems.alchenomicon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,15 +7,15 @@ import java.io.File;
|
||||||
|
|
||||||
public class Files {
|
public class Files {
|
||||||
|
|
||||||
public static final String ENERGY_VALUES_JSON = "energy-values.json";
|
public static File dataDirectory;
|
||||||
public static final String PRE_CALCULATION_ENERGY_VALUES = "pre-calculation-energy-values.json";
|
|
||||||
public static final String POST_CALCULATION_ENERGY_VALUES = "post-calculation-energy-values.json";
|
private static final String ENERGY_VALUES_JSON = "energy-values.json";
|
||||||
|
private static final String PRE_CALCULATION_ENERGY_VALUES = "pre-calculation-energy-values.json";
|
||||||
|
private static final String POST_CALCULATION_ENERGY_VALUES = "post-calculation-energy-values.json";
|
||||||
|
|
||||||
public static final String TEMPLATE_JSON_FILE = "template.json";
|
public static final String TEMPLATE_JSON_FILE = "template.json";
|
||||||
public static final String ABILITIES_JSON_FILE = "abilities.json";
|
public static final String ABILITIES_JSON_FILE = "abilities.json";
|
||||||
|
|
||||||
public static File dataDirectory;
|
|
||||||
|
|
||||||
public static File abilitiesDataDirectory;
|
public static File abilitiesDataDirectory;
|
||||||
public static File knowledgeDataDirectory;
|
public static File knowledgeDataDirectory;
|
||||||
|
|
||||||
|
@ -40,35 +40,4 @@ public class Files {
|
||||||
knowledgeDataDirectory.mkdirs();
|
knowledgeDataDirectory.mkdirs();
|
||||||
knowledgeDataFile = new File(knowledgeDataDirectory, TEMPLATE_JSON_FILE);
|
knowledgeDataFile = new File(knowledgeDataDirectory, TEMPLATE_JSON_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Global
|
|
||||||
{
|
|
||||||
public static File dataDirectory;
|
|
||||||
|
|
||||||
public static File preCalcluationEnergyValueFile;
|
|
||||||
public static File postCalcluationEnergyValueFile;
|
|
||||||
|
|
||||||
public static File abilityFile;
|
|
||||||
|
|
||||||
public static File templateTransmutationKnowledgeFile;
|
|
||||||
|
|
||||||
public static void init(FMLPreInitializationEvent event)
|
|
||||||
{
|
|
||||||
dataDirectory = new File(event.getModConfigurationDirectory().getParentFile(), "data" + File.separator + Reference.LOWERCASE_MOD_ID);
|
|
||||||
dataDirectory.mkdirs();
|
|
||||||
|
|
||||||
File energyValueDataDirectory = new File(dataDirectory, "energy-values");
|
|
||||||
energyValueDataDirectory.mkdirs();
|
|
||||||
preCalcluationEnergyValueFile = new File(energyValueDataDirectory, PRE_CALCULATION_ENERGY_VALUES);
|
|
||||||
postCalcluationEnergyValueFile = new File(energyValueDataDirectory, POST_CALCULATION_ENERGY_VALUES);
|
|
||||||
|
|
||||||
File abilityDataDirectory = new File(dataDirectory, "abilities");
|
|
||||||
abilityDataDirectory.mkdirs();
|
|
||||||
abilityFile = new File(abilityDataDirectory, ABILITIES_JSON_FILE);
|
|
||||||
|
|
||||||
File knowledgeDataDirectory = new File(dataDirectory, "knowledge");
|
|
||||||
knowledgeDataDirectory.mkdirs();
|
|
||||||
templateTransmutationKnowledgeFile = new File(knowledgeDataDirectory, TEMPLATE_JSON_FILE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,13 @@ import com.pahimar.ee3.knowledge.TransmutationKnowledge;
|
||||||
import com.pahimar.ee3.reference.Reference;
|
import com.pahimar.ee3.reference.Reference;
|
||||||
import com.pahimar.ee3.util.serialize.*;
|
import com.pahimar.ee3.util.serialize.*;
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.Loader;
|
|
||||||
import cpw.mods.fml.common.ModContainer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.*;
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
public class SerializationHelper {
|
public class SerializationHelper {
|
||||||
|
|
||||||
|
@ -71,26 +69,6 @@ public class SerializationHelper {
|
||||||
instancePlayerDataDirectory.mkdirs();
|
instancePlayerDataDirectory.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getModListMD5()
|
|
||||||
{
|
|
||||||
List<String> modList = new ArrayList<String>();
|
|
||||||
|
|
||||||
for (ModContainer modContainer : Loader.instance().getModList())
|
|
||||||
{
|
|
||||||
modList.add("[" + modContainer.getModId() + "-" + modContainer.getName() + "-" + modContainer.getVersion() + "]");
|
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(modList);
|
|
||||||
|
|
||||||
StringBuilder modListString = new StringBuilder();
|
|
||||||
for (String modEntry : modList)
|
|
||||||
{
|
|
||||||
modListString.append(modEntry);
|
|
||||||
}
|
|
||||||
|
|
||||||
return DigestUtils.md5Hex(modListString.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TransmutationKnowledge readTransmutationKnowledgeFromFile(File directory, String fileName)
|
public static TransmutationKnowledge readTransmutationKnowledgeFromFile(File directory, String fileName)
|
||||||
{
|
{
|
||||||
if (!directory.exists())
|
if (!directory.exists())
|
||||||
|
|
Loading…
Reference in a new issue