Merge remote-tracking branch 'origin/master'

This commit is contained in:
pahimar 2015-05-07 16:18:20 -04:00
commit d487598aa0
18 changed files with 125 additions and 15 deletions

View File

@ -50,10 +50,31 @@ minecraft {
version = config.minecraft_version + "-" + config.forge_version
replaceIn "reference/Reference.java"
replace "@VERSION@", "${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
replace "@MOD_VERSION@", "${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"
if (project.hasProperty("ee3_sha1_signature")) {
replace "@FINGERPRINT@", project.ee3_sha1_signature
}
replaceIn "api/package-info.java"
replace "@API_VERSION@", config.api_version
replaceIn "api/array/package-info.java"
replace "@API_VERSION@", config.api_version
replaceIn "api/event/package-info.java"
replace "@API_VERSION@", config.api_version
replaceIn "api/exchange/package-info.java"
replace "@API_VERSION@", config.api_version
replaceIn "api/knowledge/package-info.java"
replace "@API_VERSION@", config.api_version
replaceIn "api/recipe/package-info.java"
replace "@API_VERSION@", config.api_version
replaceIn "api/util/package-info.java"
replace "@API_VERSION@", config.api_version
}
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 0}"

View File

@ -3,4 +3,5 @@
minecraft_version = 1.7.10
forge_version = 10.13.3.1399-1.7.10
mod_version = 0.3
api_version = 1.2
release_type = beta

View File

@ -30,7 +30,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import java.io.File;
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, certificateFingerprint = Reference.FINGERPRINT, version = Reference.VERSION, dependencies = Reference.DEPENDENCIES, guiFactory = Reference.GUI_FACTORY_CLASS)
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, certificateFingerprint = Reference.FINGERPRINT, version = Reference.MOD_VERSION, dependencies = Reference.DEPENDENCIES, guiFactory = Reference.GUI_FACTORY_CLASS)
public class EquivalentExchange3
{
@Instance(Reference.MOD_ID)

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|array") package com.pahimar.ee3.api.array;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|array") package com.pahimar.ee3.api.array;
import cpw.mods.fml.common.API;

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|event") package com.pahimar.ee3.api.event;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|event") package com.pahimar.ee3.api.event;
import cpw.mods.fml.common.API;

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|exchange") package com.pahimar.ee3.api.exchange;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|exchange") package com.pahimar.ee3.api.exchange;
import cpw.mods.fml.common.API;

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|knowledge") package com.pahimar.ee3.api.knowledge;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|knowledge") package com.pahimar.ee3.api.knowledge;
import cpw.mods.fml.common.API;

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|core") package com.pahimar.ee3.api;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|core") package com.pahimar.ee3.api;
import cpw.mods.fml.common.API;

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|recipe") package com.pahimar.ee3.api.recipe;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|recipe") package com.pahimar.ee3.api.recipe;
import cpw.mods.fml.common.API;

View File

@ -1,3 +1,3 @@
@API(owner = "EE3", apiVersion = "1.2", provides = "EE3-API|util") package com.pahimar.ee3.api.util;
@API(owner = "EE3", apiVersion = "@API_VERSION@", provides = "EE3-API|util") package com.pahimar.ee3.api.util;
import cpw.mods.fml.common.API;

View File

@ -2,6 +2,9 @@ package com.pahimar.ee3.array;
import com.google.common.collect.ImmutableSortedSet;
import com.pahimar.ee3.api.array.AlchemyArray;
import com.pahimar.ee3.util.LoaderHelper;
import com.pahimar.ee3.util.LogHelper;
import cpw.mods.fml.common.Loader;
import java.util.SortedSet;
import java.util.TreeSet;
@ -56,6 +59,7 @@ public class AlchemyArrayRegistry
{
if (!registeredAlchemyArrays.contains(alchemyArray))
{
LogHelper.trace(String.format("AbilityRegistry[%s]: Mod with ID '%s' added alchemy array %s", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), alchemyArray));
return registeredAlchemyArrays.add(alchemyArray);
}

View File

@ -11,9 +11,11 @@ import com.pahimar.ee3.reference.Files;
import com.pahimar.ee3.reference.Reference;
import com.pahimar.ee3.reference.Settings;
import com.pahimar.ee3.util.EnergyValueHelper;
import com.pahimar.ee3.util.LoaderHelper;
import com.pahimar.ee3.util.LogHelper;
import com.pahimar.ee3.util.SerializationHelper;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
@ -74,11 +76,13 @@ public class EnergyValueRegistry implements JsonSerializer<EnergyValueRegistry>,
{
if (factoredEnergyValue.compareTo(preAssignedMappings.get(factoredWrappedStack)) < 0)
{
LogHelper.trace(String.format("EnergyValueRegistry[%s]: Mod with ID '%s' added a pre-assignment energy value of %s for object %s", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), energyValue, wrappedStack));
preAssignedMappings.put(factoredWrappedStack, factoredEnergyValue);
}
}
else
{
LogHelper.trace(String.format("EnergyValueRegistry[%s]: Mod with ID '%s' added a pre-assignment energy value of %s for object %s", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), energyValue, wrappedStack));
preAssignedMappings.put(factoredWrappedStack, factoredEnergyValue);
}
}
@ -106,6 +110,7 @@ public class EnergyValueRegistry implements JsonSerializer<EnergyValueRegistry>,
WrappedStack factoredWrappedStack = WrappedStack.wrap(wrappedStack, 1);
EnergyValue factoredEnergyValue = EnergyValueHelper.factorEnergyValue(energyValue, wrappedStack.getStackSize());
LogHelper.trace(String.format("EnergyValueRegistry[%s]: Mod with ID '%s' added a post-assignment energy value of %s for object %s", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), energyValue, wrappedStack));
postAssignedMappings.put(factoredWrappedStack, factoredEnergyValue);
}
}

View File

@ -9,8 +9,10 @@ import com.pahimar.ee3.exchange.OreStack;
import com.pahimar.ee3.exchange.WrappedStack;
import com.pahimar.ee3.reference.Comparators;
import com.pahimar.ee3.reference.Files;
import com.pahimar.ee3.util.LoaderHelper;
import com.pahimar.ee3.util.LogHelper;
import com.pahimar.ee3.util.SerializationHelper;
import cpw.mods.fml.common.Loader;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@ -111,7 +113,13 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
{
if (WrappedStack.canBeWrapped(object))
{
hasBeenModified = notLearnableSet.remove(WrappedStack.wrap(object));
WrappedStack wrappedStack = WrappedStack.wrap(object);
if (wrappedStack != null && notLearnableSet.remove(wrappedStack))
{
hasBeenModified = true;
LogHelper.trace(String.format("AbilityRegistry[%s]: Mod with ID '%s' set object %s as LEARNABLE", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), wrappedStack));
}
}
}
@ -119,7 +127,13 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
{
if (WrappedStack.canBeWrapped(object))
{
hasBeenModified = notLearnableSet.add(WrappedStack.wrap(object));
WrappedStack wrappedStack = WrappedStack.wrap(object);
if (wrappedStack != null && notLearnableSet.add(wrappedStack))
{
hasBeenModified = true;
LogHelper.trace(String.format("AbilityRegistry[%s]: Mod with ID '%s' set object %s as NOT LEARNABLE", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), wrappedStack));
}
}
}
@ -143,7 +157,13 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
{
if (WrappedStack.canBeWrapped(object))
{
hasBeenModified = notRecoverableSet.remove(WrappedStack.wrap(object));
WrappedStack wrappedStack = WrappedStack.wrap(object);
if (wrappedStack != null && notRecoverableSet.remove(wrappedStack))
{
hasBeenModified = true;
LogHelper.trace(String.format("AbilityRegistry[%s]: Mod with ID '%s' set object %s as RECOVERABLE", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), wrappedStack));
}
}
}
@ -151,7 +171,13 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
{
if (WrappedStack.canBeWrapped(object))
{
hasBeenModified = notRecoverableSet.add(WrappedStack.wrap(object));
WrappedStack wrappedStack = WrappedStack.wrap(object);
if (wrappedStack != null && notRecoverableSet.add(wrappedStack))
{
hasBeenModified = true;
LogHelper.trace(String.format("AbilityRegistry[%s]: Mod with ID '%s' set object %s as NOT RECOVERABLE", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), wrappedStack));
}
}
}

View File

@ -17,7 +17,7 @@ public class NEIConfig implements IConfigureNEI
@Override
public String getVersion()
{
return Reference.VERSION;
return Reference.MOD_VERSION;
}
@Override

View File

@ -3,6 +3,9 @@ package com.pahimar.ee3.recipe;
import com.google.common.collect.ImmutableList;
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
import com.pahimar.ee3.item.crafting.RecipeAludel;
import com.pahimar.ee3.util.LoaderHelper;
import com.pahimar.ee3.util.LogHelper;
import cpw.mods.fml.common.Loader;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
@ -38,6 +41,7 @@ public class AludelRecipeManager
{
if (!aludelRecipes.contains(recipeAludel))
{
LogHelper.trace(String.format("AludelRecipeManager[%s]: Mod with ID '%s' added Aludel recipe '%s'", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), recipeAludel));
aludelRecipes.add(recipeAludel);
}
}

View File

@ -4,7 +4,9 @@ import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import com.pahimar.ee3.exchange.WrappedStack;
import com.pahimar.ee3.util.LoaderHelper;
import com.pahimar.ee3.util.LogHelper;
import cpw.mods.fml.common.Loader;
import java.util.ArrayList;
import java.util.List;
@ -41,12 +43,15 @@ public class RecipeRegistry
}
List<WrappedStack> wrappedRecipeInputList = new ArrayList<WrappedStack>();
StringBuilder stringBuilder = new StringBuilder();
for (Object recipeInputObject : recipeInputList)
{
WrappedStack wrappedInputObject = WrappedStack.wrap(recipeInputObject);
if (wrappedInputObject != null)
{
wrappedRecipeInputList.add(wrappedInputObject);
stringBuilder.append(wrappedInputObject);
stringBuilder.append(" ");
}
else
{
@ -57,6 +62,7 @@ public class RecipeRegistry
// Add the recipe mapping only if we don't already have it
if (!recipeMap.get(wrappedRecipeOutput).contains(wrappedRecipeInputList))
{
LogHelper.trace(String.format("RecipeRegistry[%s]: Mod with ID '%s' added recipe (Output: %s, Inputs: %s)", LoaderHelper.getLoaderState(), Loader.instance().activeModContainer().getModId(), wrappedRecipeOutput, stringBuilder.toString().trim()));
recipeMap.put(wrappedRecipeOutput, wrappedRecipeInputList);
}
}

View File

@ -6,7 +6,7 @@ public class Reference
public static final String LOWERCASE_MOD_ID = MOD_ID.toLowerCase();
public static final String MOD_NAME = "Equivalent Exchange 3";
public static final String FINGERPRINT = "@FINGERPRINT@";
public static final String VERSION = "@VERSION@";
public static final String MOD_VERSION = "@MOD_VERSION@";
public static final String DEPENDENCIES = "required-after:Forge@[10.13.3,)";
public static final String SERVER_PROXY_CLASS = "com.pahimar.ee3.proxy.ServerProxy";
public static final String CLIENT_PROXY_CLASS = "com.pahimar.ee3.proxy.ClientProxy";

View File

@ -0,0 +1,43 @@
package com.pahimar.ee3.util;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.LoaderState;
public class LoaderHelper
{
public static LoaderState getLoaderState()
{
if (Loader.instance().isInState(LoaderState.SERVER_STARTED))
{
return LoaderState.SERVER_STARTED;
}
else if (Loader.instance().isInState(LoaderState.SERVER_STARTING))
{
return LoaderState.SERVER_STARTING;
}
else if (Loader.instance().isInState(LoaderState.SERVER_ABOUT_TO_START))
{
return LoaderState.SERVER_ABOUT_TO_START;
}
else if (Loader.instance().isInState(LoaderState.AVAILABLE))
{
return LoaderState.AVAILABLE;
}
else if (Loader.instance().isInState(LoaderState.POSTINITIALIZATION))
{
return LoaderState.POSTINITIALIZATION;
}
else if (Loader.instance().isInState(LoaderState.INITIALIZATION))
{
return LoaderState.INITIALIZATION;
}
else if (Loader.instance().isInState(LoaderState.PREINITIALIZATION))
{
return LoaderState.PREINITIALIZATION;
}
else
{
return null;
}
}
}