Working on some improvements to the DynEMC system to make it more reliable (and faster). Also added in a test suite system using a specially crafted json file. More user documentation on how to use this to come in the future
This commit is contained in:
parent
b88a99ccfb
commit
771c930c28
|
@ -15,6 +15,7 @@ import com.pahimar.ee3.recipe.RecipeRegistry;
|
|||
import com.pahimar.ee3.reference.Messages;
|
||||
import com.pahimar.ee3.reference.Reference;
|
||||
import com.pahimar.ee3.reference.Settings;
|
||||
import com.pahimar.ee3.test.EnergyValueMappingsTestSuite;
|
||||
import com.pahimar.ee3.util.FluidHelper;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import com.pahimar.ee3.util.SerializationHelper;
|
||||
|
@ -27,6 +28,8 @@ import cpw.mods.fml.common.event.*;
|
|||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
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, guiFactory = Reference.GUI_FACTORY_CLASS)
|
||||
public class EquivalentExchange3
|
||||
{
|
||||
|
@ -162,4 +165,14 @@ public class EquivalentExchange3
|
|||
{
|
||||
return TileEntityDataHelper.getInstance();
|
||||
}
|
||||
|
||||
public void runEnergyValueMappingTest(File file)
|
||||
{
|
||||
runEnergyValueMappingTest(file, false);
|
||||
}
|
||||
|
||||
public void runEnergyValueMappingTest(File file, boolean strict)
|
||||
{
|
||||
new EnergyValueMappingsTestSuite(file).runTestSuite(strict);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
package com.pahimar.ee3.api;
|
||||
|
||||
import com.pahimar.ee3.EquivalentExchange3;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class EnergyValueMappingsTester
|
||||
{
|
||||
public static void runTest(File file)
|
||||
{
|
||||
runTest(file, false);
|
||||
}
|
||||
|
||||
public static void runTest(File file, boolean strict)
|
||||
{
|
||||
init();
|
||||
|
||||
if (ee3Mod != null)
|
||||
{
|
||||
EE3Wrapper.ee3mod.runEnergyValueMappingTest(file, strict);
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.Instance("EE3")
|
||||
private static Object ee3Mod;
|
||||
|
||||
private static class EE3Wrapper
|
||||
{
|
||||
private static EquivalentExchange3 ee3mod;
|
||||
}
|
||||
|
||||
private static void init()
|
||||
{
|
||||
if (ee3Mod != null)
|
||||
{
|
||||
EE3Wrapper.ee3mod = (EquivalentExchange3) ee3Mod;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -82,6 +82,7 @@ public class CommandEE extends CommandBase
|
|||
modCommands.add(new CommandSetItemNotLearnable());
|
||||
modCommands.add(new CommandSetItemRecoverable());
|
||||
modCommands.add(new CommandSetItemNotRecoverable());
|
||||
modCommands.add(new CommandRunTest());
|
||||
|
||||
for (CommandBase commandBase : modCommands)
|
||||
{
|
||||
|
|
96
src/main/java/com/pahimar/ee3/command/CommandRunTest.java
Normal file
96
src/main/java/com/pahimar/ee3/command/CommandRunTest.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package com.pahimar.ee3.command;
|
||||
|
||||
import com.pahimar.ee3.reference.Messages;
|
||||
import com.pahimar.ee3.reference.Names;
|
||||
import com.pahimar.ee3.reference.Reference;
|
||||
import com.pahimar.ee3.test.EnergyValueMappingsTestSuite;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.WrongUsageException;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandRunTest extends CommandEE
|
||||
{
|
||||
@Override
|
||||
public String getCommandName()
|
||||
{
|
||||
return Names.Commands.RUN_TEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRequiredPermissionLevel()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender commandSender)
|
||||
{
|
||||
return Messages.Commands.RUN_TEST_USAGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender commandSender, String[] args)
|
||||
{
|
||||
if (args.length == 2)
|
||||
{
|
||||
File testCaseDirectory = new File(FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld().getSaveHandler().getWorldDirectory(), "data" + File.separator + Reference.LOWERCASE_MOD_ID + File.separator + "energyvalues" + File.separator + "testcases");
|
||||
testCaseDirectory.mkdirs();
|
||||
boolean testFound = false;
|
||||
|
||||
for (File testCaseFile : testCaseDirectory.listFiles())
|
||||
{
|
||||
if (testCaseFile.isFile() && testCaseFile.getName().equalsIgnoreCase(args[1]))
|
||||
{
|
||||
testFound = true;
|
||||
EnergyValueMappingsTestSuite energyValueMappingsTestSuite = new EnergyValueMappingsTestSuite(testCaseFile);
|
||||
LogHelper.info(String.format("BEGIN TEST (%s)", testCaseFile.getName()));
|
||||
energyValueMappingsTestSuite.runTestSuite();
|
||||
LogHelper.info(String.format("END TEST (%s)", testCaseFile.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
if (testFound)
|
||||
{
|
||||
commandSender.addChatMessage(new ChatComponentTranslation(Messages.Commands.RUN_TESTS_SUCCESS, args[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
commandSender.addChatMessage(new ChatComponentTranslation(Messages.Commands.RUN_TESTS_NOT_FOUND, args[1]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new WrongUsageException(Messages.Commands.RUN_TEST_USAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List addTabCompletionOptions(ICommandSender commandSender, String[] args)
|
||||
{
|
||||
if (args.length == 2)
|
||||
{
|
||||
File testCaseDirectory = new File(FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld().getSaveHandler().getWorldDirectory(), "data" + File.separator + Reference.LOWERCASE_MOD_ID + File.separator + "energyvalues" + File.separator + "testcases");
|
||||
testCaseDirectory.mkdirs();
|
||||
|
||||
ArrayList<String> fileNames = new ArrayList<String>();
|
||||
|
||||
for (File testCaseFile : testCaseDirectory.listFiles())
|
||||
{
|
||||
if (testCaseFile.isFile() && testCaseFile.getAbsolutePath().endsWith(".json"))
|
||||
{
|
||||
fileNames.add(testCaseFile.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return getListOfStringsMatchingLastWord(args, fileNames.toArray(new String[0]));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableMultimap;
|
|||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.TreeMultimap;
|
||||
import com.pahimar.ee3.reference.Comparators;
|
||||
import com.pahimar.ee3.util.ItemHelper;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
|
@ -16,13 +16,13 @@ public class CachedOreDictionary
|
|||
private static CachedOreDictionary cachedOreDictionary = null;
|
||||
private ImmutableMap<Integer, String> idToNameMap;
|
||||
private ImmutableMap<String, List<ItemStack>> oreNameToItemStackMap;
|
||||
private ImmutableMultimap<ItemStack, String> itemStackToOreNameMap;
|
||||
private ImmutableMultimap<WrappedStack, String> itemStackToOreNameMap;
|
||||
|
||||
private CachedOreDictionary()
|
||||
{
|
||||
Map<Integer, String> idToOreNameMap = new TreeMap<Integer, String>();
|
||||
Map<String, List<ItemStack>> nameToStackMap = new TreeMap<String, List<ItemStack>>(Comparators.stringComparator);
|
||||
Multimap<ItemStack, String> stackToNameMultiMap = TreeMultimap.create(ItemHelper.idComparator, Comparators.stringComparator);
|
||||
Multimap<WrappedStack, String> stackToNameMultiMap = TreeMultimap.create(WrappedStack.comparator, Comparators.stringComparator);
|
||||
|
||||
for (String oreName : OreDictionary.getOreNames())
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ public class CachedOreDictionary
|
|||
|
||||
for (ItemStack itemStack : oreNameItemStacks)
|
||||
{
|
||||
stackToNameMultiMap.put(itemStack, oreName);
|
||||
stackToNameMultiMap.put(new WrappedStack(itemStack), oreName);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,9 +70,10 @@ public class CachedOreDictionary
|
|||
public List<String> getOreNamesForItemStack(ItemStack itemStack)
|
||||
{
|
||||
List<String> oreNameList = new ArrayList<String>();
|
||||
if (itemStackToOreNameMap.containsKey(itemStack))
|
||||
WrappedStack wrappedStack = new WrappedStack(itemStack);
|
||||
if (itemStackToOreNameMap.containsKey(wrappedStack))
|
||||
{
|
||||
for (String oreName : itemStackToOreNameMap.get(itemStack))
|
||||
for (String oreName : itemStackToOreNameMap.get(wrappedStack))
|
||||
{
|
||||
oreNameList.add(oreName);
|
||||
}
|
||||
|
@ -80,4 +81,12 @@ public class CachedOreDictionary
|
|||
|
||||
return oreNameList;
|
||||
}
|
||||
|
||||
public void dumpCachedOreDictionaryToLog()
|
||||
{
|
||||
for (String oreName : CachedOreDictionary.getInstance().getOreNames())
|
||||
{
|
||||
LogHelper.info(String.format("OreName: %s, ItemStacks: %s", oreName, CachedOreDictionary.getInstance().getItemStacksForOreName(oreName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,26 +156,36 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
return getEnergyValue(object, strict) != null;
|
||||
}
|
||||
|
||||
public EnergyValue getEnergyValueFromMap(Map<WrappedStack, EnergyValue> stackEnergyValueMap, Object object, boolean strict)
|
||||
{
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
public EnergyValue getEnergyValue(Object object)
|
||||
{
|
||||
return getEnergyValue(object, false);
|
||||
return getEnergyValueFromMap(energyValueRegistry.stackMappings, object, false);
|
||||
}
|
||||
|
||||
public EnergyValue getEnergyValue(Object object, boolean strict)
|
||||
{
|
||||
return getEnergyValueFromMap(energyValueRegistry.stackMappings, object, strict);
|
||||
}
|
||||
|
||||
public EnergyValue getEnergyValueFromMap(Map<WrappedStack, EnergyValue> stackEnergyValueMap, Object object)
|
||||
{
|
||||
return getEnergyValueFromMap(stackEnergyValueMap, object, false);
|
||||
}
|
||||
|
||||
public EnergyValue getEnergyValueFromMap(Map<WrappedStack, EnergyValue> stackEnergyValueMap, Object object, boolean strict)
|
||||
{
|
||||
if (WrappedStack.canBeWrapped(object))
|
||||
{
|
||||
WrappedStack stack = new WrappedStack(object);
|
||||
WrappedStack wrappedStackObject = new WrappedStack(object);
|
||||
WrappedStack unitWrappedStackObject = new WrappedStack(object);
|
||||
unitWrappedStackObject.setStackSize(1);
|
||||
Object wrappedObject = wrappedStackObject.getWrappedObject();
|
||||
|
||||
if (stack.getWrappedStack() instanceof ItemStack && ((ItemStack) stack.getWrappedStack()).getItem() instanceof IEnergyValueProvider && !strict)
|
||||
/**
|
||||
* In the event that an Item has an IEnergyValueProvider implementation, route the call to the implementation
|
||||
*/
|
||||
if (wrappedObject instanceof ItemStack && ((ItemStack) wrappedObject).getItem() instanceof IEnergyValueProvider && !strict)
|
||||
{
|
||||
ItemStack itemStack = (ItemStack) stack.getWrappedStack();
|
||||
ItemStack itemStack = (ItemStack) wrappedObject;
|
||||
IEnergyValueProvider iEnergyValueProvider = (IEnergyValueProvider) itemStack.getItem();
|
||||
EnergyValue energyValue = iEnergyValueProvider.getEnergyValue(itemStack);
|
||||
|
||||
|
@ -184,107 +194,87 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
return energyValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (stackEnergyValueMap != null)
|
||||
{
|
||||
if (energyValueRegistry.stackMappings != null)
|
||||
/**
|
||||
* Check for a direct value mapping for the object
|
||||
*/
|
||||
if (stackEnergyValueMap.containsKey(unitWrappedStackObject))
|
||||
{
|
||||
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(stack.getWrappedStack())))
|
||||
return stackEnergyValueMap.get(unitWrappedStackObject);
|
||||
}
|
||||
else if (!strict)
|
||||
{
|
||||
if (wrappedObject instanceof ItemStack)
|
||||
{
|
||||
return energyValueRegistry.stackMappings.get(new WrappedStack(stack.getWrappedStack()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!strict)
|
||||
EnergyValue lowestValue = null;
|
||||
ItemStack wrappedItemStack = (ItemStack) wrappedObject;
|
||||
|
||||
/**
|
||||
* The ItemStack does not have a direct"mapping, so check if it is a member of an OreDictionary
|
||||
* entry. If it is a member of only one OreDictionary entry, check if that OreStack has a direct
|
||||
* mapping
|
||||
*/
|
||||
if (CachedOreDictionary.getInstance().getOreNamesForItemStack(wrappedItemStack).size() == 1)
|
||||
{
|
||||
if (stack.getWrappedStack() instanceof ItemStack)
|
||||
OreStack oreStack = new OreStack(wrappedItemStack);
|
||||
|
||||
if (stackEnergyValueMap.containsKey(new WrappedStack(oreStack)))
|
||||
{
|
||||
EnergyValue lowestValue = null;
|
||||
ItemStack wrappedItemStack = (ItemStack) stack.getWrappedStack();
|
||||
|
||||
if (OreDictionary.getOreIDs(wrappedItemStack).length > 0)
|
||||
{
|
||||
OreStack oreStack = new OreStack(wrappedItemStack);
|
||||
|
||||
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(oreStack)))
|
||||
{
|
||||
return energyValueRegistry.stackMappings.get(new WrappedStack(oreStack));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int oreId : OreDictionary.getOreIDs(wrappedItemStack))
|
||||
{
|
||||
for (ItemStack itemStack : OreDictionary.getOres(OreDictionary.getOreName(oreId)))
|
||||
{
|
||||
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(itemStack)))
|
||||
{
|
||||
if (lowestValue == null)
|
||||
{
|
||||
lowestValue = energyValueRegistry.stackMappings.get(new WrappedStack(itemStack));
|
||||
}
|
||||
else
|
||||
{
|
||||
EnergyValue itemValue = energyValueRegistry.stackMappings.get(new WrappedStack(itemStack));
|
||||
|
||||
if (itemValue.compareTo(lowestValue) < 0)
|
||||
{
|
||||
lowestValue = itemValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lowestValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (WrappedStack valuedStack : energyValueRegistry.stackMappings.keySet())
|
||||
{
|
||||
if (valuedStack.getWrappedStack() instanceof ItemStack)
|
||||
{
|
||||
ItemStack valuedItemStack = (ItemStack) valuedStack.getWrappedStack();
|
||||
|
||||
if (Item.getIdFromItem(valuedItemStack.getItem()) == Item.getIdFromItem(wrappedItemStack.getItem()))
|
||||
{
|
||||
if (valuedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || wrappedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
||||
{
|
||||
EnergyValue stackValue = energyValueRegistry.stackMappings.get(valuedStack);
|
||||
|
||||
if (stackValue.compareTo(lowestValue) < 0)
|
||||
{
|
||||
lowestValue = stackValue;
|
||||
}
|
||||
}
|
||||
else if (wrappedItemStack.getItem().isDamageable() && wrappedItemStack.isItemDamaged())
|
||||
{
|
||||
EnergyValue stackValue = new EnergyValue(energyValueRegistry.stackMappings.get(valuedStack).getEnergyValue() * (1 - (wrappedItemStack.getItemDamage() * 1.0F / wrappedItemStack.getMaxDamage())));
|
||||
|
||||
if (stackValue.compareTo(lowestValue) < 0)
|
||||
{
|
||||
lowestValue = stackValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lowestValue;
|
||||
}
|
||||
}
|
||||
else if (stack.getWrappedStack() instanceof OreStack)
|
||||
{
|
||||
OreStack oreStack = (OreStack) stack.getWrappedStack();
|
||||
for (ItemStack oreItemStack : OreDictionary.getOres(oreStack.oreName))
|
||||
{
|
||||
if (energyValueRegistry.stackMappings.containsKey(new WrappedStack(oreItemStack)))
|
||||
{
|
||||
return energyValueRegistry.stackMappings.get(new WrappedStack(oreItemStack));
|
||||
}
|
||||
}
|
||||
return stackEnergyValueMap.get(new WrappedStack(oreStack));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* Scan the stack value map for ItemStacks that have the same Item. If one is found, check
|
||||
* if it has a wildcard meta value (and therefore is considered the same). Otherwise, check
|
||||
* if the ItemStack is "damageable" and calculate the value for the damaged stack.
|
||||
*/
|
||||
for (WrappedStack valuedStack : stackEnergyValueMap.keySet())
|
||||
{
|
||||
if (valuedStack.getWrappedObject() instanceof ItemStack)
|
||||
{
|
||||
ItemStack valuedItemStack = (ItemStack) valuedStack.getWrappedObject();
|
||||
|
||||
if (Item.getIdFromItem(valuedItemStack.getItem()) == Item.getIdFromItem(wrappedItemStack.getItem()))
|
||||
{
|
||||
if (valuedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || wrappedItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
|
||||
{
|
||||
EnergyValue stackValue = stackEnergyValueMap.get(valuedStack);
|
||||
|
||||
if (stackValue.compareTo(lowestValue) < 0)
|
||||
{
|
||||
lowestValue = stackValue;
|
||||
}
|
||||
}
|
||||
else if (wrappedItemStack.getItem().isDamageable() && wrappedItemStack.isItemDamaged())
|
||||
{
|
||||
EnergyValue stackValue = new EnergyValue(stackEnergyValueMap.get(valuedStack).getEnergyValue() * (1 - (wrappedItemStack.getItemDamage() * 1.0F / wrappedItemStack.getMaxDamage())));
|
||||
|
||||
if (stackValue.compareTo(lowestValue) < 0)
|
||||
{
|
||||
lowestValue = stackValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lowestValue;
|
||||
}
|
||||
}
|
||||
// else if (wrappedObject instanceof OreStack)
|
||||
// {
|
||||
// OreStack oreStack = (OreStack) wrappedObject;
|
||||
// for (ItemStack oreItemStack : OreDictionary.getOres(oreStack.oreName))
|
||||
// {
|
||||
// if (stackEnergyValueMap.containsKey(new WrappedStack(oreItemStack)))
|
||||
// {
|
||||
// return stackEnergyValueMap.get(new WrappedStack(oreItemStack));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +303,13 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
|
||||
// Grab custom pre-assigned values from file
|
||||
Map<WrappedStack, EnergyValue> preAssignedValueMap = SerializationHelper.readEnergyValueStackMapFromJsonFile(Files.PRE_ASSIGNED_ENERGY_VALUES);
|
||||
stackValueMap.putAll(preAssignedValueMap);
|
||||
for (WrappedStack wrappedStack : preAssignedValueMap.keySet())
|
||||
{
|
||||
if (preAssignedValueMap.get(wrappedStack) != null)
|
||||
{
|
||||
stackValueMap.put(wrappedStack, preAssignedValueMap.get(wrappedStack));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Auto-assignment
|
||||
|
@ -328,11 +324,11 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
int passNumber = 0;
|
||||
long computationStartTime = System.currentTimeMillis();
|
||||
long passStartTime;
|
||||
int computedValueCount;
|
||||
int computedValueCount = 0;
|
||||
int totalComputedValueCount = 0;
|
||||
LogHelper.info("Beginning dynamic value computation");
|
||||
boolean isFirstPass = true;
|
||||
while ((isFirstPass || computedStackValues.size() > 0) && (passNumber < 16))
|
||||
while ((isFirstPass || computedValueCount > 0) && (passNumber < 16))
|
||||
{
|
||||
if (isFirstPass)
|
||||
{
|
||||
|
@ -344,20 +340,15 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
// Increment the pass counter
|
||||
passNumber++;
|
||||
|
||||
// Set the values for getStoredEnergyValue calls in the auto-assignment computation
|
||||
stackMappingsBuilder = ImmutableSortedMap.naturalOrder();
|
||||
stackMappingsBuilder.putAll(stackValueMap);
|
||||
stackMappings = stackMappingsBuilder.build();
|
||||
|
||||
// Compute stack mappings from existing stack mappings
|
||||
computedStackValues = computeStackMappings();
|
||||
computedStackValues = computeStackMappings(stackValueMap);
|
||||
|
||||
for (WrappedStack keyStack : computedStackValues.keySet())
|
||||
{
|
||||
EnergyValue factoredExchangeEnergyValue = null;
|
||||
WrappedStack factoredKeyStack = null;
|
||||
|
||||
if (keyStack != null && keyStack.getWrappedStack() != null && keyStack.getStackSize() > 0)
|
||||
if (keyStack != null && keyStack.getWrappedObject() != null && keyStack.getStackSize() > 0)
|
||||
{
|
||||
if (computedStackValues.get(keyStack) != null && Float.compare(computedStackValues.get(keyStack).getEnergyValue(), 0f) > 0)
|
||||
{
|
||||
|
@ -387,10 +378,6 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
}
|
||||
LogHelper.info(String.format("Finished dynamic value computation (computed %s values for objects in %s ms)", totalComputedValueCount, System.currentTimeMillis() - computationStartTime));
|
||||
|
||||
// stackMappingsBuilder = ImmutableSortedMap.naturalOrder();
|
||||
// stackMappingsBuilder.putAll(stackValueMap);
|
||||
// stackMappings = stackMappingsBuilder.build();
|
||||
//
|
||||
// /*
|
||||
// * Post-assigned values
|
||||
// */
|
||||
|
@ -427,7 +414,10 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
for (WrappedStack wrappedStack : postAssignedExactMappings.keySet())
|
||||
{
|
||||
stackValueMap.put(wrappedStack, postAssignedExactMappings.get(wrappedStack));
|
||||
if (postAssignedExactMappings.get(wrappedStack) != null)
|
||||
{
|
||||
stackValueMap.put(wrappedStack, postAssignedExactMappings.get(wrappedStack));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -437,7 +427,13 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
|
||||
// Grab custom post-assigned values from file
|
||||
Map<WrappedStack, EnergyValue> postAssignedValueMap = SerializationHelper.readEnergyValueStackMapFromJsonFile(Files.POST_ASSIGNED_ENERGY_VALUES);
|
||||
stackValueMap.putAll(postAssignedValueMap);
|
||||
for (WrappedStack wrappedStack : postAssignedValueMap.keySet())
|
||||
{
|
||||
if (postAssignedValueMap.get(wrappedStack) != null)
|
||||
{
|
||||
stackValueMap.put(wrappedStack, postAssignedValueMap.get(wrappedStack));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finalize the stack to value map
|
||||
|
@ -485,19 +481,19 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
valueMappings = ImmutableSortedMap.copyOf(tempValueMappings);
|
||||
}
|
||||
|
||||
private Map<WrappedStack, EnergyValue> computeStackMappings()
|
||||
private Map<WrappedStack, EnergyValue> computeStackMappings(Map<WrappedStack, EnergyValue> stackValueMappings)
|
||||
{
|
||||
Map<WrappedStack, EnergyValue> computedStackMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
|
||||
for (WrappedStack recipeOutput : RecipeRegistry.getInstance().getRecipeMappings().keySet())
|
||||
{
|
||||
if (!hasEnergyValue(recipeOutput.getWrappedStack(), false) && !computedStackMap.containsKey(recipeOutput))
|
||||
if (!hasEnergyValue(recipeOutput.getWrappedObject(), false) && !computedStackMap.containsKey(recipeOutput))
|
||||
{
|
||||
EnergyValue lowestValue = null;
|
||||
|
||||
for (List<WrappedStack> recipeInputs : RecipeRegistry.getInstance().getRecipeMappings().get(recipeOutput))
|
||||
{
|
||||
EnergyValue computedValue = EnergyValueHelper.computeEnergyValueFromRecipe(recipeOutput, recipeInputs);
|
||||
EnergyValue computedValue = EnergyValueHelper.computeEnergyValueFromRecipe(stackValueMappings, recipeOutput, recipeInputs);
|
||||
|
||||
if (computedValue != null)
|
||||
{
|
||||
|
@ -510,7 +506,7 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
|
||||
if ((lowestValue != null) && (lowestValue.getEnergyValue() > 0f))
|
||||
{
|
||||
computedStackMap.put(new WrappedStack(recipeOutput.getWrappedStack()), lowestValue);
|
||||
computedStackMap.put(new WrappedStack(recipeOutput.getWrappedObject()), lowestValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -560,13 +556,13 @@ public class EnergyValueRegistry implements INBTTaggable, JsonSerializer<EnergyV
|
|||
{
|
||||
for (WrappedStack wrappedStack : energyValueRegistry.valueMappings.get(value))
|
||||
{
|
||||
if (wrappedStack.getWrappedStack() instanceof ItemStack || wrappedStack.getWrappedStack() instanceof FluidStack)
|
||||
if (wrappedStack.getWrappedObject() instanceof ItemStack || wrappedStack.getWrappedObject() instanceof FluidStack)
|
||||
{
|
||||
stacksInRange.add(wrappedStack.getWrappedStack());
|
||||
stacksInRange.add(wrappedStack.getWrappedObject());
|
||||
}
|
||||
else if (wrappedStack.getWrappedStack() instanceof OreStack)
|
||||
else if (wrappedStack.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
for (ItemStack itemStack : OreDictionary.getOres(((OreStack) wrappedStack.getWrappedStack()).oreName))
|
||||
for (ItemStack itemStack : OreDictionary.getOres(((OreStack) wrappedStack.getWrappedObject()).oreName))
|
||||
{
|
||||
stacksInRange.add(itemStack);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class EnergyValueStackMapping implements JsonSerializer<EnergyValueStackM
|
|||
}
|
||||
}
|
||||
|
||||
if (wrappedStack != null && energyValue != null)
|
||||
if (wrappedStack != null)
|
||||
{
|
||||
return new EnergyValueStackMapping(wrappedStack, energyValue);
|
||||
}
|
||||
|
|
|
@ -65,9 +65,7 @@ public class OreStack implements Comparable<OreStack>
|
|||
this.stackSize = stackSize;
|
||||
}
|
||||
|
||||
// TODO Maybe this should return a List of OreStacks that match the OreDictionary entries this ItemStack belongs to
|
||||
// Ponder and test - changing this could have massive ramifications on DynEV
|
||||
// For now, this returns an OreStack for the first OreDictionary entry the ItemStack is associated with
|
||||
// TODO Refactor away, we shouldn't be building OreStacks from single ItemStacks
|
||||
public OreStack(ItemStack itemStack)
|
||||
{
|
||||
if (itemStack != null && OreDictionary.getOreIDs(itemStack).length > 0)
|
||||
|
|
|
@ -107,7 +107,7 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
{
|
||||
WrappedStack wrappedStackObject = (WrappedStack) object;
|
||||
|
||||
if (wrappedStackObject.getWrappedStack() != null)
|
||||
if (wrappedStackObject.getWrappedObject() != null)
|
||||
{
|
||||
this.objectType = wrappedStackObject.objectType;
|
||||
this.stackSize = wrappedStackObject.stackSize;
|
||||
|
@ -191,7 +191,7 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
{
|
||||
WrappedStack wrappedStackObject = (WrappedStack) object;
|
||||
|
||||
if (wrappedStackObject.getWrappedStack() != null)
|
||||
if (wrappedStackObject.getWrappedObject() != null)
|
||||
{
|
||||
this.objectType = wrappedStackObject.objectType;
|
||||
this.stackSize = stackSize;
|
||||
|
@ -212,7 +212,7 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
}
|
||||
}
|
||||
|
||||
public Object getWrappedStack()
|
||||
public Object getWrappedObject()
|
||||
{
|
||||
return wrappedStack;
|
||||
}
|
||||
|
@ -265,31 +265,31 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
|
|||
|
||||
public static NBTTagCompound toNBTTagCompound(WrappedStack wrappedStack)
|
||||
{
|
||||
if (wrappedStack != null && wrappedStack.getWrappedStack() != null)
|
||||
if (wrappedStack != null && wrappedStack.getWrappedObject() != null)
|
||||
{
|
||||
NBTTagCompound wrappedStackTagCompound = new NBTTagCompound();
|
||||
if (wrappedStack.getWrappedStack() instanceof ItemStack)
|
||||
if (wrappedStack.getWrappedObject() instanceof ItemStack)
|
||||
{
|
||||
NBTTagCompound wrappedItemTagCompound = new NBTTagCompound();
|
||||
((ItemStack) wrappedStack.getWrappedStack()).writeToNBT(wrappedItemTagCompound);
|
||||
((ItemStack) wrappedStack.getWrappedObject()).writeToNBT(wrappedItemTagCompound);
|
||||
wrappedStackTagCompound.setInteger("wrappedStack_type", 0);
|
||||
wrappedStackTagCompound.setTag("wrappedStack_data", wrappedItemTagCompound);
|
||||
wrappedStackTagCompound.setInteger("wrappedStack_stackSize", wrappedStack.getStackSize());
|
||||
return wrappedStackTagCompound;
|
||||
}
|
||||
else if (wrappedStack.getWrappedStack() instanceof OreStack)
|
||||
else if (wrappedStack.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
NBTTagCompound wrappedOreTagCompound = new NBTTagCompound();
|
||||
((OreStack) wrappedStack.getWrappedStack()).writeToNBT(wrappedOreTagCompound);
|
||||
((OreStack) wrappedStack.getWrappedObject()).writeToNBT(wrappedOreTagCompound);
|
||||
wrappedStackTagCompound.setInteger("wrappedStack_type", 1);
|
||||
wrappedStackTagCompound.setTag("wrappedStack_data", wrappedOreTagCompound);
|
||||
wrappedStackTagCompound.setInteger("wrappedStack_stackSize", wrappedStack.getStackSize());
|
||||
return wrappedStackTagCompound;
|
||||
}
|
||||
else if (wrappedStack.getWrappedStack() instanceof FluidStack)
|
||||
else if (wrappedStack.getWrappedObject() instanceof FluidStack)
|
||||
{
|
||||
NBTTagCompound wrappedFluidTagCompound = new NBTTagCompound();
|
||||
((FluidStack) wrappedStack.getWrappedStack()).writeToNBT(wrappedFluidTagCompound);
|
||||
((FluidStack) wrappedStack.getWrappedObject()).writeToNBT(wrappedFluidTagCompound);
|
||||
wrappedStackTagCompound.setInteger("wrappedStack_type", 2);
|
||||
wrappedStackTagCompound.setTag("wrappedStack_data", wrappedFluidTagCompound);
|
||||
wrappedStackTagCompound.setInteger("wrappedStack_stackSize", wrappedStack.getStackSize());
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.pahimar.ee3.init;
|
||||
|
||||
import com.pahimar.ee3.api.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.exchange.EnergyValueRegistry;
|
||||
import com.pahimar.ee3.exchange.OreStack;
|
||||
import com.pahimar.ee3.exchange.WrappedStack;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -25,17 +24,23 @@ public class EnergyValues
|
|||
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("logWood")), 32);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreDiamond")), 8192);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("gemDiamond")), 8192);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreEmerald")), 8192);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("gemEmerald")), 8192);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreGold")), 2048);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("ingotGold")), 2048);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreIron")), 256);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("ingotIron")), 256);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreLapis")), 864);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("gemLapis")), 864);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreQuartz")), 256);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("gemQuartz")), 256);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("oreRedstone")), 32);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("plankWood")), 8);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("record")), 2048);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("slabWood")), 4);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("stairWood")), 12);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("stick")), 4);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("stickWood")), 4);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("stone")), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("leaves")), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new OreStack("sapling")), 32);
|
||||
|
@ -57,14 +62,13 @@ public class EnergyValues
|
|||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.coal_ore), 32);
|
||||
// Sponge
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.glass), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.sandstone), 4);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Blocks.sandstone, 1, OreDictionary.WILDCARD_VALUE)), 4);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.mossy_cobblestone), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.obsidian), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.ice), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.pumpkin), 144);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.netherrack), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.soul_sand), 49);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Blocks.stonebrick, 1, 1)), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Blocks.stonebrick, 1, OreDictionary.WILDCARD_VALUE)), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.mycelium), 1);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.end_stone), 1);
|
||||
|
@ -78,7 +82,7 @@ public class EnergyValues
|
|||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Blocks.red_flower, 1, OreDictionary.WILDCARD_VALUE)), 16);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.brown_mushroom), 32);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.red_mushroom), 32);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.snow), 0.5f);
|
||||
// Snow Layer
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Blocks.cactus), 8);
|
||||
// Stone Monster Egg
|
||||
// Cobblestone Monster Egg
|
||||
|
@ -109,21 +113,21 @@ public class EnergyValues
|
|||
// Firework Star
|
||||
|
||||
/* Foodstuffs */
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.apple), 128);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.porkchop), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.cooked_porkchop), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Items.fish, 1, OreDictionary.WILDCARD_VALUE)), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Items.cooked_fished, 1, OreDictionary.WILDCARD_VALUE)), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.apple), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.porkchop), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.cooked_porkchop), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Items.fish, 1, OreDictionary.WILDCARD_VALUE)), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(Items.cooked_fished, 1, OreDictionary.WILDCARD_VALUE)), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.melon), 16);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.beef), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.cooked_beef), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.chicken), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.cooked_chicken), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.beef), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.cooked_beef), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.chicken), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.cooked_chicken), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.rotten_flesh), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.spider_eye), 128);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.carrot), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.potato), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.baked_potato), 64);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.baked_potato), 24);
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(Items.poisonous_potato), 24);
|
||||
|
||||
/* Tools */
|
||||
|
@ -177,21 +181,5 @@ public class EnergyValues
|
|||
* Minium Shard
|
||||
*/
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(new WrappedStack(new ItemStack(ModItems.shardMinium)), 8192);
|
||||
|
||||
// TODO Break this into a proper post-assignment method for logical delineation
|
||||
// EnergyValueRegistry.getInstance().addPostAssignedDependentEnergyValue(Items.water_bucket, Arrays.asList(Items.bucket, new WrappedStack(FluidRegistry.WATER)));
|
||||
EnergyValueRegistry.getInstance().addPostAssignedExactEnergyValue(Items.water_bucket, 769);
|
||||
EnergyValueRegistry.getInstance().addPostAssignedExactEnergyValue(Items.milk_bucket, 832);
|
||||
// if (!FluidRegistry.isFluidRegistered("milk"))
|
||||
// {
|
||||
// Fluid milk = new Fluid("milk").setUnlocalizedName(Items.milk_bucket.getUnlocalizedName());
|
||||
// FluidRegistry.registerFluid(milk);
|
||||
// FluidContainerRegistry.registerFluidContainer(new FluidStack(milk, 1000), new ItemStack(Items.milk_bucket), new ItemStack(Items.bucket));
|
||||
// EnergyValueRegistry.getInstance().addPostAssignedDependentEnergyValue(Items.milk_bucket, Arrays.asList(Items.bucket, new FluidStack(milk, 1000)));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// EnergyValueRegistry.getInstance().addPostAssignedDependentEnergyValue(Items.milk_bucket, Arrays.asList(Items.bucket, new FluidStack(FluidRegistry.getFluid("milk"), 1000)));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,20 +48,20 @@ public class RecipeAludel
|
|||
|
||||
private static boolean compareStacks(WrappedStack wrappedStack1, WrappedStack wrappedStack2)
|
||||
{
|
||||
if (wrappedStack1 != null && wrappedStack1.getWrappedStack() != null && wrappedStack2 != null && wrappedStack2.getWrappedStack() != null)
|
||||
if (wrappedStack1 != null && wrappedStack1.getWrappedObject() != null && wrappedStack2 != null && wrappedStack2.getWrappedObject() != null)
|
||||
{
|
||||
if (wrappedStack1.getWrappedStack() instanceof ItemStack && wrappedStack2.getWrappedStack() instanceof ItemStack)
|
||||
if (wrappedStack1.getWrappedObject() instanceof ItemStack && wrappedStack2.getWrappedObject() instanceof ItemStack)
|
||||
{
|
||||
ItemStack itemStack1 = (ItemStack) wrappedStack1.getWrappedStack();
|
||||
ItemStack itemStack1 = (ItemStack) wrappedStack1.getWrappedObject();
|
||||
itemStack1.stackSize = wrappedStack1.getStackSize();
|
||||
ItemStack itemStack2 = (ItemStack) wrappedStack2.getWrappedStack();
|
||||
ItemStack itemStack2 = (ItemStack) wrappedStack2.getWrappedObject();
|
||||
itemStack2.stackSize = wrappedStack2.getStackSize();
|
||||
|
||||
return compareItemStacks(itemStack1, itemStack2);
|
||||
}
|
||||
else if (wrappedStack1.getWrappedStack() instanceof OreStack && wrappedStack2.getWrappedStack() instanceof OreStack)
|
||||
else if (wrappedStack1.getWrappedObject() instanceof OreStack && wrappedStack2.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
if (((OreStack) wrappedStack1.getWrappedStack()).oreName.equalsIgnoreCase(((OreStack) wrappedStack2.getWrappedStack()).oreName))
|
||||
if (((OreStack) wrappedStack1.getWrappedObject()).oreName.equalsIgnoreCase(((OreStack) wrappedStack2.getWrappedObject()).oreName))
|
||||
{
|
||||
return wrappedStack2.getStackSize() >= wrappedStack1.getStackSize();
|
||||
}
|
||||
|
|
|
@ -63,16 +63,16 @@ public class AbilityRegistry implements JsonSerializer<AbilityRegistry>, JsonDes
|
|||
{
|
||||
if (isLearnable(wrappedStack) && EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack) != null)
|
||||
{
|
||||
if (wrappedStack.getWrappedStack() instanceof OreStack)
|
||||
if (wrappedStack.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
for (ItemStack itemStack : OreDictionary.getOres(((OreStack) wrappedStack.getWrappedStack()).oreName))
|
||||
for (ItemStack itemStack : OreDictionary.getOres(((OreStack) wrappedStack.getWrappedObject()).oreName))
|
||||
{
|
||||
this.allLearnableItemStacks.add(itemStack);
|
||||
}
|
||||
}
|
||||
else if (wrappedStack.getWrappedStack() instanceof ItemStack)
|
||||
else if (wrappedStack.getWrappedObject() instanceof ItemStack)
|
||||
{
|
||||
this.allLearnableItemStacks.add((ItemStack) wrappedStack.getWrappedStack());
|
||||
this.allLearnableItemStacks.add((ItemStack) wrappedStack.getWrappedObject());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class AludelRecipeHandler extends TemplateRecipeHandler
|
|||
public CachedAludelRecipe(RecipeAludel recipe)
|
||||
{
|
||||
WrappedStack[] wrappedInputs = recipe.getRecipeInputs();
|
||||
inputs = Arrays.asList(new PositionedStack(new ItemStack(((ItemStack) wrappedInputs[0].getWrappedStack()).getItem(), wrappedInputs[0].getStackSize(), ((ItemStack) wrappedInputs[0].getWrappedStack()).getItemDamage()), 37, 7), new PositionedStack(new ItemStack(((ItemStack) wrappedInputs[1].getWrappedStack()).getItem(), wrappedInputs[1].getStackSize(), ((ItemStack) wrappedInputs[1].getWrappedStack()).getItemDamage()), 37, 28));
|
||||
inputs = Arrays.asList(new PositionedStack(new ItemStack(((ItemStack) wrappedInputs[0].getWrappedObject()).getItem(), wrappedInputs[0].getStackSize(), ((ItemStack) wrappedInputs[0].getWrappedObject()).getItemDamage()), 37, 7), new PositionedStack(new ItemStack(((ItemStack) wrappedInputs[1].getWrappedObject()).getItem(), wrappedInputs[1].getStackSize(), ((ItemStack) wrappedInputs[1].getWrappedObject()).getItemDamage()), 37, 28));
|
||||
|
||||
output = new PositionedStack(recipe.getRecipeOutput(), 113, 28);
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class AludelRecipeHandler extends TemplateRecipeHandler
|
|||
{
|
||||
for (WrappedStack wrappedStack : recipe.getRecipeInputs())
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting((ItemStack) wrappedStack.getWrappedStack(), ingredient))
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting((ItemStack) wrappedStack.getWrappedObject(), ingredient))
|
||||
{
|
||||
arecipes.add(new CachedAludelRecipe(recipe));
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class RecipeRegistry
|
|||
for (WrappedStack wrappedStack : getRecipeMappings().keySet())
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append(String.format("-Output: %s, Inputs: ", wrappedStack.toString()));
|
||||
stringBuilder.append(String.format("- Output: %s, Inputs: ", wrappedStack.toString()));
|
||||
for (List<WrappedStack> listStacks : getRecipeMappings().get(wrappedStack))
|
||||
{
|
||||
for (WrappedStack listStack : listStacks)
|
||||
|
|
|
@ -25,77 +25,77 @@ public class RecipesPotions
|
|||
private static WrappedStack reagentBlazePowder = new WrappedStack(new ItemStack(Items.blaze_powder));
|
||||
|
||||
private static WrappedStack bottleEmpty = new WrappedStack(Items.glass_bottle);
|
||||
private static WrappedStack bottleWater = new WrappedStack(new ItemStack(Items.potionitem, 1, 0));
|
||||
public static WrappedStack bottleWater = new WrappedStack(new ItemStack(Items.potionitem, 1, 0));
|
||||
|
||||
private static WrappedStack potionAwkward = new WrappedStack(new ItemStack(Items.potionitem, 1, 16));
|
||||
private static WrappedStack potionThick = new WrappedStack(new ItemStack(Items.potionitem, 1, 32));
|
||||
private static WrappedStack potionMundane = new WrappedStack(new ItemStack(Items.potionitem, 1, 128));
|
||||
private static WrappedStack potionMundaneExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 64));
|
||||
private static WrappedStack potionMundaneSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16512));
|
||||
private static WrappedStack potionMundaneSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16448));
|
||||
public static WrappedStack potionAwkward = new WrappedStack(new ItemStack(Items.potionitem, 1, 16));
|
||||
public static WrappedStack potionThick = new WrappedStack(new ItemStack(Items.potionitem, 1, 32));
|
||||
public static WrappedStack potionMundane = new WrappedStack(new ItemStack(Items.potionitem, 1, 128));
|
||||
public static WrappedStack potionMundaneExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 64));
|
||||
public static WrappedStack potionMundaneSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16512));
|
||||
public static WrappedStack potionMundaneSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16448));
|
||||
|
||||
private static WrappedStack potionRegeneration = new WrappedStack(new ItemStack(Items.potionitem, 1, 8193));
|
||||
private static WrappedStack potionRegenerationEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8225));
|
||||
private static WrappedStack potionRegenerationExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8257));
|
||||
private static WrappedStack potionRegenerationSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16385));
|
||||
private static WrappedStack potionRegenerationSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16417));
|
||||
private static WrappedStack potionRegenerationSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16449));
|
||||
public static WrappedStack potionRegeneration = new WrappedStack(new ItemStack(Items.potionitem, 1, 8193));
|
||||
public static WrappedStack potionRegenerationEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8225));
|
||||
public static WrappedStack potionRegenerationExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8257));
|
||||
public static WrappedStack potionRegenerationSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16385));
|
||||
public static WrappedStack potionRegenerationSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16417));
|
||||
public static WrappedStack potionRegenerationSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16449));
|
||||
|
||||
private static WrappedStack potionSwiftness = new WrappedStack(new ItemStack(Items.potionitem, 1, 8194));
|
||||
private static WrappedStack potionSwiftnessEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8226));
|
||||
private static WrappedStack potionSwiftnessExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8258));
|
||||
private static WrappedStack potionSwiftnessSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16386));
|
||||
private static WrappedStack potionSwiftnessSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16418));
|
||||
private static WrappedStack potionSwiftnessSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16450));
|
||||
public static WrappedStack potionSwiftness = new WrappedStack(new ItemStack(Items.potionitem, 1, 8194));
|
||||
public static WrappedStack potionSwiftnessEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8226));
|
||||
public static WrappedStack potionSwiftnessExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8258));
|
||||
public static WrappedStack potionSwiftnessSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16386));
|
||||
public static WrappedStack potionSwiftnessSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16418));
|
||||
public static WrappedStack potionSwiftnessSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16450));
|
||||
|
||||
private static WrappedStack potionFireResist = new WrappedStack(new ItemStack(Items.potionitem, 1, 8195));
|
||||
private static WrappedStack potionFireResistExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8259));
|
||||
private static WrappedStack potionFireResistSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16387));
|
||||
private static WrappedStack potionFireResistSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16451));
|
||||
public static WrappedStack potionFireResist = new WrappedStack(new ItemStack(Items.potionitem, 1, 8195));
|
||||
public static WrappedStack potionFireResistExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8259));
|
||||
public static WrappedStack potionFireResistSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16387));
|
||||
public static WrappedStack potionFireResistSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16451));
|
||||
|
||||
private static WrappedStack potionPoison = new WrappedStack(new ItemStack(Items.potionitem, 1, 8196));
|
||||
private static WrappedStack potionPoisonEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8228));
|
||||
private static WrappedStack potionPoisonExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8260));
|
||||
private static WrappedStack potionPoisonSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16388));
|
||||
private static WrappedStack potionPoisonSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16420));
|
||||
private static WrappedStack potionPoisonSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16452));
|
||||
public static WrappedStack potionPoison = new WrappedStack(new ItemStack(Items.potionitem, 1, 8196));
|
||||
public static WrappedStack potionPoisonEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8228));
|
||||
public static WrappedStack potionPoisonExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8260));
|
||||
public static WrappedStack potionPoisonSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16388));
|
||||
public static WrappedStack potionPoisonSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16420));
|
||||
public static WrappedStack potionPoisonSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16452));
|
||||
|
||||
private static WrappedStack potionHealing = new WrappedStack(new ItemStack(Items.potionitem, 1, 8197));
|
||||
private static WrappedStack potionHealingEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8229));
|
||||
private static WrappedStack potionHealingSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16389));
|
||||
private static WrappedStack potionHealingSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16421));
|
||||
public static WrappedStack potionHealing = new WrappedStack(new ItemStack(Items.potionitem, 1, 8197));
|
||||
public static WrappedStack potionHealingEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8229));
|
||||
public static WrappedStack potionHealingSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16389));
|
||||
public static WrappedStack potionHealingSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16421));
|
||||
|
||||
private static WrappedStack potionNightVision = new WrappedStack(new ItemStack(Items.potionitem, 1, 8198));
|
||||
private static WrappedStack potionNightVisionExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8262));
|
||||
private static WrappedStack potionNightVisionSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16390));
|
||||
private static WrappedStack potionNightVisionSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16454));
|
||||
public static WrappedStack potionNightVision = new WrappedStack(new ItemStack(Items.potionitem, 1, 8198));
|
||||
public static WrappedStack potionNightVisionExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8262));
|
||||
public static WrappedStack potionNightVisionSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16390));
|
||||
public static WrappedStack potionNightVisionSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16454));
|
||||
|
||||
private static WrappedStack potionWeakness = new WrappedStack(new ItemStack(Items.potionitem, 1, 8200));
|
||||
private static WrappedStack potionWeaknessExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8264));
|
||||
private static WrappedStack potionWeaknessSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16392));
|
||||
private static WrappedStack potionWeaknessSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16456));
|
||||
public static WrappedStack potionWeakness = new WrappedStack(new ItemStack(Items.potionitem, 1, 8200));
|
||||
public static WrappedStack potionWeaknessExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8264));
|
||||
public static WrappedStack potionWeaknessSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16392));
|
||||
public static WrappedStack potionWeaknessSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16456));
|
||||
|
||||
private static WrappedStack potionStrength = new WrappedStack(new ItemStack(Items.potionitem, 1, 8201));
|
||||
private static WrappedStack potionStrengthEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8233));
|
||||
private static WrappedStack potionStrengthExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8265));
|
||||
private static WrappedStack potionStrengthSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16393));
|
||||
private static WrappedStack potionStrengthSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16425));
|
||||
private static WrappedStack potionStrengthSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16457));
|
||||
public static WrappedStack potionStrength = new WrappedStack(new ItemStack(Items.potionitem, 1, 8201));
|
||||
public static WrappedStack potionStrengthEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8233));
|
||||
public static WrappedStack potionStrengthExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8265));
|
||||
public static WrappedStack potionStrengthSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16393));
|
||||
public static WrappedStack potionStrengthSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16425));
|
||||
public static WrappedStack potionStrengthSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16457));
|
||||
|
||||
private static WrappedStack potionSlowness = new WrappedStack(new ItemStack(Items.potionitem, 1, 8202));
|
||||
private static WrappedStack potionSlownessExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8266));
|
||||
private static WrappedStack potionSlownessSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16394));
|
||||
private static WrappedStack potionSlownessSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16458));
|
||||
public static WrappedStack potionSlowness = new WrappedStack(new ItemStack(Items.potionitem, 1, 8202));
|
||||
public static WrappedStack potionSlownessExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8266));
|
||||
public static WrappedStack potionSlownessSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16394));
|
||||
public static WrappedStack potionSlownessSplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16458));
|
||||
|
||||
private static WrappedStack potionHarming = new WrappedStack(new ItemStack(Items.potionitem, 1, 8204));
|
||||
private static WrappedStack potionHarmingEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8236));
|
||||
private static WrappedStack potionHarmingSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16396));
|
||||
private static WrappedStack potionHarmingSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16428));
|
||||
public static WrappedStack potionHarming = new WrappedStack(new ItemStack(Items.potionitem, 1, 8204));
|
||||
public static WrappedStack potionHarmingEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 8236));
|
||||
public static WrappedStack potionHarmingSplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16396));
|
||||
public static WrappedStack potionHarmingSplashEnhanced = new WrappedStack(new ItemStack(Items.potionitem, 1, 16428));
|
||||
|
||||
private static WrappedStack potionInvisibility = new WrappedStack(new ItemStack(Items.potionitem, 1, 8206));
|
||||
private static WrappedStack potionInvisibilityExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8270));
|
||||
private static WrappedStack potionInvisibilitySplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16398));
|
||||
private static WrappedStack potionInvisibilitySplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16462));
|
||||
public static WrappedStack potionInvisibility = new WrappedStack(new ItemStack(Items.potionitem, 1, 8206));
|
||||
public static WrappedStack potionInvisibilityExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 8270));
|
||||
public static WrappedStack potionInvisibilitySplash = new WrappedStack(new ItemStack(Items.potionitem, 1, 16398));
|
||||
public static WrappedStack potionInvisibilitySplashExtended = new WrappedStack(new ItemStack(Items.potionitem, 1, 16462));
|
||||
|
||||
public static void registerRecipes()
|
||||
{
|
||||
|
|
|
@ -98,6 +98,10 @@ public final class Messages
|
|||
|
||||
public static final String SET_ITEM_NOT_RECOVERABLE_USAGE = COMMAND_PREFIX + Names.Commands.SET_ITEM_NOT_RECOVERABLE + ".usage";
|
||||
public static final String SET_ITEM_NOT_RECOVERABLE_SUCCESS = COMMAND_PREFIX + Names.Commands.SET_ITEM_NOT_RECOVERABLE + ".success";
|
||||
|
||||
public static final String RUN_TEST_USAGE = COMMAND_PREFIX + Names.Commands.RUN_TEST + ".usage";
|
||||
public static final String RUN_TESTS_SUCCESS = COMMAND_PREFIX + Names.Commands.RUN_TEST + ".success";
|
||||
public static final String RUN_TESTS_NOT_FOUND = COMMAND_PREFIX + Names.Commands.RUN_TEST + ".notfound";
|
||||
}
|
||||
|
||||
public static final class Configuration
|
||||
|
|
|
@ -158,6 +158,7 @@ public class Names
|
|||
public static final String SET_ITEM_NOT_LEARNABLE = "set-item-not-learnable";
|
||||
public static final String SET_ITEM_RECOVERABLE = "set-item-recoverable";
|
||||
public static final String SET_ITEM_NOT_RECOVERABLE = "set-item-not-recoverable";
|
||||
public static final String RUN_TEST = "run-tests";
|
||||
}
|
||||
|
||||
public static final class AlchemyArrays
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
package com.pahimar.ee3.test;
|
||||
|
||||
import com.pahimar.ee3.api.EnergyValue;
|
||||
import com.pahimar.ee3.api.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.exchange.WrappedStack;
|
||||
import com.pahimar.ee3.util.LogHelper;
|
||||
import com.pahimar.ee3.util.SerializationHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class EnergyValueMappingsTestSuite
|
||||
{
|
||||
Map<WrappedStack, EnergyValue> testSuiteValueMap;
|
||||
|
||||
public EnergyValueMappingsTestSuite()
|
||||
{
|
||||
testSuiteValueMap = new TreeMap<WrappedStack, EnergyValue>();
|
||||
}
|
||||
|
||||
public EnergyValueMappingsTestSuite(File jsonFile)
|
||||
{
|
||||
if (jsonFile != null && jsonFile.exists() && jsonFile.isFile())
|
||||
{
|
||||
testSuiteValueMap = SerializationHelper.readEnergyValueStackMapFromJsonFile(jsonFile);
|
||||
}
|
||||
}
|
||||
|
||||
public void add(Object object, Object value)
|
||||
{
|
||||
if (WrappedStack.canBeWrapped(object) && value instanceof Number)
|
||||
{
|
||||
Number number = (Number) value;
|
||||
WrappedStack wrappedStack = new WrappedStack(object);
|
||||
wrappedStack.setStackSize(1);
|
||||
testSuiteValueMap.put(wrappedStack, new EnergyValue(number.floatValue()));
|
||||
}
|
||||
else if (value == null)
|
||||
{
|
||||
WrappedStack wrappedStack = new WrappedStack(object);
|
||||
wrappedStack.setStackSize(1);
|
||||
testSuiteValueMap.put(wrappedStack, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove(Object object)
|
||||
{
|
||||
if (WrappedStack.canBeWrapped(object))
|
||||
{
|
||||
WrappedStack wrappedStack = new WrappedStack(object);
|
||||
wrappedStack.setStackSize(1);
|
||||
testSuiteValueMap.remove(wrappedStack);
|
||||
}
|
||||
}
|
||||
|
||||
public void loadTestSuite(File jsonFile)
|
||||
{
|
||||
if (jsonFile != null && jsonFile.exists() && jsonFile.isFile())
|
||||
{
|
||||
testSuiteValueMap = SerializationHelper.readEnergyValueStackMapFromJsonFile(jsonFile);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveTestSuite(File jsonFile)
|
||||
{
|
||||
if (jsonFile != null)
|
||||
{
|
||||
SerializationHelper.writeEnergyValueStackMapToJsonFile(jsonFile, testSuiteValueMap);
|
||||
}
|
||||
}
|
||||
|
||||
public void runTestSuite()
|
||||
{
|
||||
runTestSuite(false);
|
||||
}
|
||||
|
||||
public void runTestSuite(boolean strict)
|
||||
{
|
||||
List<String> successMessages = new ArrayList<String>();
|
||||
List<String> failureMessages = new ArrayList<String>();
|
||||
for (WrappedStack wrappedStack : testSuiteValueMap.keySet())
|
||||
{
|
||||
EnergyValue registryEnergyValue = EnergyValueRegistryProxy.getEnergyValue(wrappedStack, strict);
|
||||
EnergyValue testSuiteEnergryValue = testSuiteValueMap.get(wrappedStack);
|
||||
|
||||
if (registryEnergyValue == null && testSuiteEnergryValue == null)
|
||||
{
|
||||
/**
|
||||
* Success - anticipated that no value was found and no value was found
|
||||
*/
|
||||
successMessages.add(String.format("SUCCESS: Object '%s' had the expected energy value [Expected (%s), Found (%s)]", wrappedStack, testSuiteEnergryValue, registryEnergyValue));
|
||||
}
|
||||
else if (registryEnergyValue == null)
|
||||
{
|
||||
/**
|
||||
* Failure - anticipated that a value would be found but no value was found
|
||||
*/
|
||||
failureMessages.add(String.format("FAILURE: Object '%s' did not have the expected energy value [Expected (%s), Found (%s)]", wrappedStack, testSuiteEnergryValue, registryEnergyValue));
|
||||
}
|
||||
else if (registryEnergyValue != null && testSuiteEnergryValue != null)
|
||||
{
|
||||
if (registryEnergyValue.equals(testSuiteEnergryValue))
|
||||
{
|
||||
/**
|
||||
* Success - anticipated that a specific value would be found and the anticipated value was found
|
||||
*/
|
||||
successMessages.add(String.format("SUCCESS: Object '%s' had the expected energy value [Expected (%s), Found (%s)]", wrappedStack, testSuiteEnergryValue, registryEnergyValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* Failure - anticipated that a specific value would be found and while a value was found it was not the anticipated one
|
||||
*/
|
||||
failureMessages.add(String.format("FAILURE: Object '%s' did not have the expected energy value [Expected (%s), Found (%s)]", wrappedStack, testSuiteEnergryValue, registryEnergyValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String successMessage : successMessages)
|
||||
{
|
||||
LogHelper.info(successMessage);
|
||||
}
|
||||
|
||||
for (String failureMessage : failureMessages)
|
||||
{
|
||||
LogHelper.warn(failureMessage);
|
||||
}
|
||||
}
|
||||
}
|
598
src/main/java/com/pahimar/ee3/test/VanillaEnergyValueTest.java
Normal file
598
src/main/java/com/pahimar/ee3/test/VanillaEnergyValueTest.java
Normal file
|
@ -0,0 +1,598 @@
|
|||
package com.pahimar.ee3.test;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class VanillaEnergyValueTest extends EnergyValueMappingsTestSuite
|
||||
{
|
||||
public VanillaEnergyValueTest()
|
||||
{
|
||||
buildTestSuite();
|
||||
}
|
||||
|
||||
private void buildTestSuite()
|
||||
{
|
||||
addBuildingBlocksTabTestCases();
|
||||
addDecorationBlocksTabTestCases();
|
||||
addRedstoneTabTestCases();
|
||||
addTransportationTabTestCases();
|
||||
addMiscellaneousTabTestCases();
|
||||
addFoodstuffsTabTestCases();
|
||||
addToolsTabTestCases();
|
||||
addCombatTabTestCases();
|
||||
addBrewingTabTestCases();
|
||||
addMaterialsTabTestCases();
|
||||
}
|
||||
|
||||
private void addBuildingBlocksTabTestCases()
|
||||
{
|
||||
add(Blocks.stone, 1);
|
||||
add(Blocks.grass, 1);
|
||||
add(Blocks.dirt, 1);
|
||||
add(new ItemStack(Blocks.dirt, 1, 2), 1);
|
||||
add(Blocks.cobblestone, 1);
|
||||
add(new ItemStack(Blocks.planks, 1, 0), 8);
|
||||
add(new ItemStack(Blocks.planks, 1, 1), 8);
|
||||
add(new ItemStack(Blocks.planks, 1, 2), 8);
|
||||
add(new ItemStack(Blocks.planks, 1, 3), 8);
|
||||
add(new ItemStack(Blocks.planks, 1, 4), 8);
|
||||
add(new ItemStack(Blocks.planks, 1, 5), 8);
|
||||
add(Blocks.bedrock, null);
|
||||
add(Blocks.sand, 1);
|
||||
add(Blocks.gravel, 4);
|
||||
add(Blocks.gold_ore, 2048);
|
||||
add(Blocks.iron_ore, 256);
|
||||
add(Blocks.coal_ore, 32);
|
||||
add(new ItemStack(Blocks.log, 1, 0), 32);
|
||||
add(new ItemStack(Blocks.log, 1, 1), 32);
|
||||
add(new ItemStack(Blocks.log, 1, 2), 32);
|
||||
add(new ItemStack(Blocks.log, 1, 3), 32);
|
||||
add(Blocks.sponge, null);
|
||||
add(Blocks.glass, 1);
|
||||
add(Blocks.lapis_ore, 864);
|
||||
add(Blocks.lapis_block, 9 * 864);
|
||||
add(new ItemStack(Blocks.sandstone, 1, 0), 4);
|
||||
add(new ItemStack(Blocks.sandstone, 1, 1), 4);
|
||||
add(new ItemStack(Blocks.sandstone, 1, 2), 4);
|
||||
add(new ItemStack(Blocks.wool, 1, 0), 48);
|
||||
add(new ItemStack(Blocks.wool, 1, 1), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 2), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 3), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 4), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 5), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 6), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 7), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 8), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 9), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 10), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 11), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 12), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 13), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 14), 56);
|
||||
add(new ItemStack(Blocks.wool, 1, 15), 56);
|
||||
add(Blocks.gold_block, 9 * 2048);
|
||||
add(Blocks.iron_block, 9 * 256);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 0), 0.5);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 1), 2);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 3), 0.5);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 4), 128);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 5), 0.5);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 6), 2);
|
||||
add(new ItemStack(Blocks.stone_slab, 1, 7), 512);
|
||||
add(Blocks.brick_block, 256);
|
||||
add(Blocks.bookshelf, 528);
|
||||
add(Blocks.mossy_cobblestone, 1);
|
||||
add(Blocks.obsidian, 64);
|
||||
add(Blocks.oak_stairs, 12);
|
||||
add(Blocks.diamond_ore, 8192);
|
||||
add(Blocks.diamond_block, 9 * 8192);
|
||||
add(Blocks.stone_stairs, 1.5);
|
||||
add(Blocks.redstone_ore, 32);
|
||||
add(Blocks.ice, 1);
|
||||
add(Blocks.snow, 1);
|
||||
add(Blocks.clay, 256);
|
||||
add(Blocks.pumpkin, 144);
|
||||
add(Blocks.netherrack, 1);
|
||||
add(Blocks.soul_sand, 49);
|
||||
add(Blocks.glowstone, 1536);
|
||||
add(Blocks.lit_pumpkin, 153);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 0), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 1), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 2), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 3), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 4), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 5), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 6), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 7), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 8), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 9), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 10), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 11), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 12), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 13), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 14), 9);
|
||||
add(new ItemStack(Blocks.stained_glass, 1, 15), 9);
|
||||
add(new ItemStack(Blocks.stonebrick, 1, 0), 1);
|
||||
add(new ItemStack(Blocks.stonebrick, 1, 1), 1);
|
||||
add(new ItemStack(Blocks.stonebrick, 1, 2), 1);
|
||||
add(new ItemStack(Blocks.stonebrick, 1, 3), 1);
|
||||
add(Blocks.melon_block, 144);
|
||||
add(Blocks.brick_stairs, 384);
|
||||
add(Blocks.stone_brick_stairs, 1.5);
|
||||
add(Blocks.mycelium, 1);
|
||||
add(Blocks.nether_brick, 4);
|
||||
add(Blocks.nether_brick_stairs, 6);
|
||||
add(Blocks.end_stone, 1);
|
||||
add(new ItemStack(Blocks.wooden_slab, 1, 0), 4);
|
||||
add(new ItemStack(Blocks.wooden_slab, 1, 1), 4);
|
||||
add(new ItemStack(Blocks.wooden_slab, 1, 2), 4);
|
||||
add(new ItemStack(Blocks.wooden_slab, 1, 3), 4);
|
||||
add(new ItemStack(Blocks.wooden_slab, 1, 4), 4);
|
||||
add(new ItemStack(Blocks.wooden_slab, 1, 5), 4);
|
||||
add(Blocks.sandstone_stairs, 6);
|
||||
add(Blocks.emerald_ore, 8192);
|
||||
add(Blocks.emerald_block, 9 * 8192);
|
||||
add(Blocks.spruce_stairs, 12);
|
||||
add(Blocks.birch_stairs, 12);
|
||||
add(Blocks.jungle_stairs, 12);
|
||||
add(new ItemStack(Blocks.cobblestone_wall, 1, 0), 1);
|
||||
add(new ItemStack(Blocks.cobblestone_wall, 1, 1), 1);
|
||||
add(Blocks.quartz_ore, 256);
|
||||
add(new ItemStack(Blocks.quartz_block, 1, 0), 1024);
|
||||
add(new ItemStack(Blocks.quartz_block, 1, 1), 1024);
|
||||
add(new ItemStack(Blocks.quartz_block, 1, 2), 1024);
|
||||
add(Blocks.quartz_stairs, 1536);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 0), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 1), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 2), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 3), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 4), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 5), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 6), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 7), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 8), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 9), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 10), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 11), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 12), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 13), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 14), 257);
|
||||
add(new ItemStack(Blocks.stained_hardened_clay, 1, 15), 257);
|
||||
add(new ItemStack(Blocks.log2, 1, 0), 32);
|
||||
add(new ItemStack(Blocks.log2, 1, 1), 32);
|
||||
add(Blocks.acacia_stairs, 12);
|
||||
add(Blocks.dark_oak_stairs, 12);
|
||||
add(Blocks.hay_block, 216);
|
||||
add(Blocks.hardened_clay, 256);
|
||||
add(Blocks.coal_block, 288);
|
||||
add(Blocks.packed_ice, null);
|
||||
}
|
||||
|
||||
private void addDecorationBlocksTabTestCases()
|
||||
{
|
||||
add(new ItemStack(Blocks.sapling, 1, 0), 32);
|
||||
add(new ItemStack(Blocks.sapling, 1, 1), 32);
|
||||
add(new ItemStack(Blocks.sapling, 1, 2), 32);
|
||||
add(new ItemStack(Blocks.sapling, 1, 3), 32);
|
||||
add(new ItemStack(Blocks.sapling, 1, 4), 32);
|
||||
add(new ItemStack(Blocks.sapling, 1, 5), 32);
|
||||
add(new ItemStack(Blocks.leaves, 1, 0), 1);
|
||||
add(new ItemStack(Blocks.leaves, 1, 1), 1);
|
||||
add(new ItemStack(Blocks.leaves, 1, 2), 1);
|
||||
add(new ItemStack(Blocks.leaves, 1, 3), 1);
|
||||
add(Blocks.web, 12);
|
||||
add(new ItemStack(Blocks.tallgrass, 1, 0), 1);
|
||||
add(new ItemStack(Blocks.tallgrass, 1, 1), 1);
|
||||
add(Blocks.deadbush, 1);
|
||||
add(Blocks.yellow_flower, 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 0), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 1), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 2), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 3), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 4), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 5), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 6), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 7), 16);
|
||||
add(new ItemStack(Blocks.red_flower, 1, 8), 16);
|
||||
add(Blocks.brown_mushroom, 32);
|
||||
add(Blocks.red_mushroom, 32);
|
||||
add(Blocks.torch, 9);
|
||||
add(Blocks.chest, 64);
|
||||
add(Blocks.crafting_table, 32);
|
||||
add(Blocks.furnace, 8);
|
||||
add(Blocks.ladder, 9.333);
|
||||
add(Blocks.snow_layer, 0.125);
|
||||
add(Blocks.cactus, 8);
|
||||
add(Blocks.jukebox, 8256);
|
||||
add(Blocks.fence, 12);
|
||||
add(new ItemStack(Blocks.monster_egg, 1, 0), null);
|
||||
add(new ItemStack(Blocks.monster_egg, 1, 1), null);
|
||||
add(new ItemStack(Blocks.monster_egg, 1, 2), null);
|
||||
add(new ItemStack(Blocks.monster_egg, 1, 3), null);
|
||||
add(new ItemStack(Blocks.monster_egg, 1, 4), null);
|
||||
add(new ItemStack(Blocks.monster_egg, 1, 5), null);
|
||||
add(Blocks.iron_bars, 96);
|
||||
add(Blocks.glass_pane, 0.375);
|
||||
add(Blocks.vine, 8);
|
||||
add(Blocks.waterlily, 16);
|
||||
add(Blocks.nether_brick_fence, 4);
|
||||
add(Blocks.enchanting_table, 16800);
|
||||
add(Blocks.end_portal_frame, null);
|
||||
add(Blocks.ender_chest, 2304);
|
||||
add(new ItemStack(Blocks.anvil, 1, 0), 7936);
|
||||
add(new ItemStack(Blocks.anvil, 1, 1), 5290.666);
|
||||
add(new ItemStack(Blocks.anvil, 1, 2), 2645.333);
|
||||
add(Blocks.trapped_chest, 198);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 0), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 1), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 2), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 3), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 4), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 5), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 6), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 7), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 8), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 9), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 10), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 11), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 12), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 13), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 14), 3.375);
|
||||
add(new ItemStack(Blocks.stained_glass_pane, 1, 15), 3.375);
|
||||
add(new ItemStack(Blocks.leaves2, 1, 0), 1);
|
||||
add(new ItemStack(Blocks.leaves2, 1, 1), 1);
|
||||
add(new ItemStack(Blocks.carpet, 1, 0), 32);
|
||||
add(new ItemStack(Blocks.carpet, 1, 1), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 2), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 3), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 4), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 5), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 6), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 7), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 8), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 9), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 10), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 11), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 12), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 13), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 14), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 15), 37.333);
|
||||
add(new ItemStack(Blocks.carpet, 1, 15), 37.333);
|
||||
add(new ItemStack(Blocks.double_plant, 1, 0), 16);
|
||||
add(new ItemStack(Blocks.double_plant, 1, 1), 16);
|
||||
add(new ItemStack(Blocks.double_plant, 1, 2), 16);
|
||||
add(new ItemStack(Blocks.double_plant, 1, 3), 16);
|
||||
add(new ItemStack(Blocks.double_plant, 1, 4), 16);
|
||||
add(new ItemStack(Blocks.double_plant, 1, 5), 16);
|
||||
add(Items.painting, 80);
|
||||
add(Items.sign, 52);
|
||||
add(Items.flower_pot, 192);
|
||||
add(new ItemStack(Blocks.skull, 1, 0), null);
|
||||
add(new ItemStack(Blocks.skull, 1, 1), null);
|
||||
add(new ItemStack(Blocks.skull, 1, 2), null);
|
||||
add(new ItemStack(Blocks.skull, 1, 3), null);
|
||||
add(new ItemStack(Blocks.skull, 1, 4), null);
|
||||
}
|
||||
|
||||
private void addRedstoneTabTestCases()
|
||||
{
|
||||
add(Blocks.dispenser, 87);
|
||||
add(Blocks.noteblock, 96);
|
||||
add(Blocks.sticky_piston, 340);
|
||||
add(Blocks.piston, 316);
|
||||
add(Blocks.tnt, 964);
|
||||
add(Blocks.lever, 5);
|
||||
add(Blocks.stone_pressure_plate, 2);
|
||||
add(Blocks.wooden_pressure_plate, 16);
|
||||
add(Blocks.redstone_torch, 36);
|
||||
add(Blocks.stone_button, 1);
|
||||
add(Blocks.trapdoor, 48);
|
||||
add(Blocks.fence_gate, 32);
|
||||
add(Blocks.redstone_lamp, 1664);
|
||||
add(Blocks.tripwire_hook, 134);
|
||||
add(Blocks.wooden_button, 8);
|
||||
add(Blocks.light_weighted_pressure_plate, 4096);
|
||||
add(Blocks.heavy_weighted_pressure_plate, 512);
|
||||
add(Blocks.daylight_detector, 783);
|
||||
add(Blocks.redstone_block, 288);
|
||||
add(Blocks.hopper, 1344);
|
||||
add(Blocks.dropper, 39);
|
||||
add(Blocks.wooden_door, 48);
|
||||
add(Blocks.iron_door, 1536);
|
||||
add(Items.redstone, 32);
|
||||
add(Items.repeater, 107);
|
||||
add(Items.comparator, 367);
|
||||
}
|
||||
|
||||
private void addTransportationTabTestCases()
|
||||
{
|
||||
add(Blocks.golden_rail, 2054);
|
||||
add(Blocks.detector_rail, 261.666);
|
||||
add(Blocks.rail, 96.25);
|
||||
add(Blocks.activator_rail, 263.333);
|
||||
add(Items.minecart, 1280);
|
||||
add(Items.saddle, 192);
|
||||
add(Items.boat, 40);
|
||||
add(Items.chest_minecart, 1344);
|
||||
add(Items.furnace_minecart, 1288);
|
||||
add(Items.carrot_on_a_stick, 60);
|
||||
add(Items.tnt_minecart, 2244);
|
||||
add(Items.hopper_minecart, 2624);
|
||||
}
|
||||
|
||||
private void addMiscellaneousTabTestCases()
|
||||
{
|
||||
add(Blocks.beacon, 24773);
|
||||
add(Items.bucket, 768);
|
||||
add(Items.water_bucket, 769);
|
||||
add(Items.lava_bucket, 832);
|
||||
add(Items.snowball, 0.25);
|
||||
add(Items.milk_bucket, 832);
|
||||
add(Items.paper, 32);
|
||||
add(Items.book, 160);
|
||||
add(Items.slime_ball, 24);
|
||||
add(Items.bone, 24);
|
||||
add(Items.ender_pearl, 1024);
|
||||
add(Items.ender_eye, 1792);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 50), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 51), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 52), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 54), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 55), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 56), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 57), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 58), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 59), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 60), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 61), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 62), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 65), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 66), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 90), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 91), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 92), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 93), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 94), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 95), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 96), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 98), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 100), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 120), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 97), null);
|
||||
add(new ItemStack(Items.spawn_egg, 1, 99), null);
|
||||
add(Items.experience_bottle, null);
|
||||
add(Items.fire_charge, 330.666);
|
||||
add(Items.writable_book, 216);
|
||||
add(Items.map, 1312);
|
||||
add(Items.firework_charge, null);
|
||||
add(Items.iron_horse_armor, null);
|
||||
add(Items.golden_horse_armor, null);
|
||||
add(Items.diamond_horse_armor, null);
|
||||
add(Items.record_13, 2048);
|
||||
add(Items.record_cat, 2048);
|
||||
add(Items.record_blocks, 2048);
|
||||
add(Items.record_chirp, 2048);
|
||||
add(Items.record_far, 2048);
|
||||
add(Items.record_mellohi, 2048);
|
||||
add(Items.record_stal, 2048);
|
||||
add(Items.record_strad, 2048);
|
||||
add(Items.record_ward, 2048);
|
||||
add(Items.record_11, 2048);
|
||||
add(Items.record_wait, 2048);
|
||||
}
|
||||
|
||||
private void addFoodstuffsTabTestCases()
|
||||
{
|
||||
add(Items.apple, 24);
|
||||
add(Items.mushroom_stew, 68);
|
||||
add(Items.bread, 72);
|
||||
add(Items.porkchop, 24);
|
||||
add(Items.cooked_porkchop, 24);
|
||||
add(new ItemStack(Items.golden_apple, 1, 0), 16408);
|
||||
add(new ItemStack(Items.golden_apple, 1, 1), 147480);
|
||||
add(new ItemStack(Items.fish, 1, 0), 24);
|
||||
add(new ItemStack(Items.fish, 1, 1), 24);
|
||||
add(new ItemStack(Items.fish, 1, 2), 24);
|
||||
add(new ItemStack(Items.fish, 1, 3), 24);
|
||||
add(new ItemStack(Items.cooked_fished, 1, 0), 24);
|
||||
add(new ItemStack(Items.cooked_fished, 1, 1), 24);
|
||||
add(Items.cake, 360);
|
||||
add(Items.cookie, 7);
|
||||
add(Items.melon, 16);
|
||||
add(Items.beef, 24);
|
||||
add(Items.cooked_beef, 24);
|
||||
add(Items.chicken, 24);
|
||||
add(Items.cooked_chicken, 24);
|
||||
add(Items.rotten_flesh, 24);
|
||||
add(Items.spider_eye, 128);
|
||||
add(Items.carrot, 24);
|
||||
add(Items.potato, 24);
|
||||
add(Items.baked_potato, 24);
|
||||
add(Items.poisonous_potato, 24);
|
||||
add(Items.golden_carrot, 1844.444);
|
||||
add(Items.pumpkin_pie, 208);
|
||||
}
|
||||
|
||||
private void addToolsTabTestCases()
|
||||
{
|
||||
add(Items.iron_shovel, 264);
|
||||
add(Items.iron_pickaxe, 776);
|
||||
add(Items.iron_axe, 776);
|
||||
add(Items.flint_and_steel, 260);
|
||||
add(Items.wooden_shovel, 16);
|
||||
add(Items.wooden_pickaxe, 32);
|
||||
add(Items.wooden_axe, 32);
|
||||
add(Items.stone_shovel, 9);
|
||||
add(Items.stone_pickaxe, 11);
|
||||
add(Items.stone_axe, 11);
|
||||
add(Items.diamond_shovel, 8200);
|
||||
add(Items.diamond_pickaxe, 24584);
|
||||
add(Items.diamond_axe, 24584);
|
||||
add(Items.golden_shovel, 2056);
|
||||
add(Items.golden_pickaxe, 6152);
|
||||
add(Items.golden_axe, 6152);
|
||||
add(Items.wooden_hoe, 24);
|
||||
add(Items.stone_hoe, 10);
|
||||
add(Items.iron_hoe, 520);
|
||||
add(Items.diamond_hoe, 16392);
|
||||
add(Items.golden_hoe, 4104);
|
||||
add(Items.compass, 1056);
|
||||
add(Items.fishing_rod, 36);
|
||||
add(Items.clock, 8224);
|
||||
add(Items.shears, 512);
|
||||
add(Items.lead, 72);
|
||||
add(Items.name_tag, null);
|
||||
add(new ItemStack(Items.enchanted_book, 1, OreDictionary.WILDCARD_VALUE), null);
|
||||
}
|
||||
|
||||
private void addCombatTabTestCases()
|
||||
{
|
||||
add(Items.bow, 48);
|
||||
add(Items.arrow, 14);
|
||||
add(Items.iron_sword, 516);
|
||||
add(Items.wooden_sword, 20);
|
||||
add(Items.stone_sword, 6);
|
||||
add(Items.diamond_sword, 16388);
|
||||
add(Items.golden_sword, 4100);
|
||||
add(Items.leather_helmet, 320);
|
||||
add(Items.leather_chestplate, 512);
|
||||
add(Items.leather_leggings, 448);
|
||||
add(Items.leather_boots, 256);
|
||||
add(Items.chainmail_helmet, null);
|
||||
add(Items.chainmail_chestplate, null);
|
||||
add(Items.chainmail_leggings, null);
|
||||
add(Items.chainmail_boots, null);
|
||||
add(Items.iron_helmet, 1280);
|
||||
add(Items.iron_chestplate, 2048);
|
||||
add(Items.iron_leggings, 1792);
|
||||
add(Items.iron_boots, 1024);
|
||||
add(Items.diamond_helmet, 40960);
|
||||
add(Items.diamond_chestplate, 65536);
|
||||
add(Items.diamond_leggings, 57344);
|
||||
add(Items.diamond_boots, 32768);
|
||||
add(Items.golden_helmet, 10240);
|
||||
add(Items.golden_chestplate, 16384);
|
||||
add(Items.golden_leggings, 14336);
|
||||
add(Items.golden_boots, 8192);
|
||||
}
|
||||
|
||||
private void addBrewingTabTestCases()
|
||||
{
|
||||
add(Items.ghast_tear, 4096);
|
||||
add(new ItemStack(Items.potionitem, 1, 0), 2);
|
||||
add(new ItemStack(Items.potionitem, 1, 16), 26);
|
||||
add(new ItemStack(Items.potionitem, 1, 8193), 4122);
|
||||
add(new ItemStack(Items.potionitem, 1, 8225), 4506);
|
||||
add(new ItemStack(Items.potionitem, 1, 8257), 4154);
|
||||
add(new ItemStack(Items.potionitem, 1, 16385), 4314);
|
||||
add(new ItemStack(Items.potionitem, 1, 16417), 4698);
|
||||
add(new ItemStack(Items.potionitem, 1, 16449), 4346);
|
||||
add(new ItemStack(Items.potionitem, 1, 8194), 58);
|
||||
add(new ItemStack(Items.potionitem, 1, 8226), 442);
|
||||
add(new ItemStack(Items.potionitem, 1, 8258), 90);
|
||||
add(new ItemStack(Items.potionitem, 1, 16386), 250);
|
||||
add(new ItemStack(Items.potionitem, 1, 16418), 634);
|
||||
add(new ItemStack(Items.potionitem, 1, 16450), 282);
|
||||
add(new ItemStack(Items.potionitem, 1, 8227), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8259), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16419), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16451), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8196), 154);
|
||||
add(new ItemStack(Items.potionitem, 1, 8228), 538);
|
||||
add(new ItemStack(Items.potionitem, 1, 8260), 570);
|
||||
add(new ItemStack(Items.potionitem, 1, 16388), 346);
|
||||
add(new ItemStack(Items.potionitem, 1, 16420), 730);
|
||||
add(new ItemStack(Items.potionitem, 1, 16452), 762);
|
||||
add(new ItemStack(Items.potionitem, 1, 8261), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8229), 2246.444);
|
||||
add(new ItemStack(Items.potionitem, 1, 16453), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16421), 2438.444);
|
||||
add(new ItemStack(Items.potionitem, 1, 8230), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8262), 1902.444);
|
||||
add(new ItemStack(Items.potionitem, 1, 16422), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16454), 2094.444);
|
||||
add(new ItemStack(Items.potionitem, 1, 8232), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8264), 226);
|
||||
add(new ItemStack(Items.potionitem, 1, 16424), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16456), 418);
|
||||
add(new ItemStack(Items.potionitem, 1, 8201), 794);
|
||||
add(new ItemStack(Items.potionitem, 1, 8233), 1178);
|
||||
add(new ItemStack(Items.potionitem, 1, 8265), 826);
|
||||
add(new ItemStack(Items.potionitem, 1, 16393), 986);
|
||||
add(new ItemStack(Items.potionitem, 1, 16425), 1370);
|
||||
add(new ItemStack(Items.potionitem, 1, 16457), 1018);
|
||||
add(new ItemStack(Items.potionitem, 1, 8234), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8266), 634);
|
||||
add(new ItemStack(Items.potionitem, 1, 16426), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16458), 826);
|
||||
add(new ItemStack(Items.potionitem, 1, 8268), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8236), 730);
|
||||
add(new ItemStack(Items.potionitem, 1, 16460), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16428), 922);
|
||||
add(new ItemStack(Items.potionitem, 1, 8237), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8269), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16429), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16461), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8238), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 8270), 2094.444);
|
||||
add(new ItemStack(Items.potionitem, 1, 16430), null);
|
||||
add(new ItemStack(Items.potionitem, 1, 16462), 2286.444);
|
||||
add(Items.glass_bottle, 1);
|
||||
add(Items.fermented_spider_eye, 192);
|
||||
add(Items.blaze_powder, 768);
|
||||
add(Items.magma_cream, 792);
|
||||
add(Items.brewing_stand, 1539);
|
||||
add(Items.speckled_melon, 1836.444);
|
||||
}
|
||||
|
||||
private void addMaterialsTabTestCases()
|
||||
{
|
||||
add(new ItemStack(Items.coal, 1, 0), 32);
|
||||
add(new ItemStack(Items.coal, 1, 1), 32);
|
||||
add(Items.diamond, 8192);
|
||||
add(Items.iron_ingot, 256);
|
||||
add(Items.gold_ingot, 2048);
|
||||
add(Items.stick, 4);
|
||||
add(Items.bowl, 4);
|
||||
add(Items.string, 12);
|
||||
add(Items.feather, 48);
|
||||
add(Items.gunpowder, 192);
|
||||
add(Items.wheat_seeds, 16);
|
||||
add(Items.wheat, 24);
|
||||
add(Items.flint, 4);
|
||||
add(Items.leather, 64);
|
||||
add(Items.brick, 64);
|
||||
add(Items.clay_ball, 64);
|
||||
add(Items.reeds, 32);
|
||||
add(Items.egg, 32);
|
||||
add(Items.glowstone_dust, 384);
|
||||
add(new ItemStack(Items.dye, 1, 0), 8);
|
||||
add(new ItemStack(Items.dye, 1, 1), 8);
|
||||
add(new ItemStack(Items.dye, 1, 2), 8);
|
||||
add(new ItemStack(Items.dye, 1, 3), 8);
|
||||
add(new ItemStack(Items.dye, 1, 4), 864);
|
||||
add(new ItemStack(Items.dye, 1, 5), 8);
|
||||
add(new ItemStack(Items.dye, 1, 6), 8);
|
||||
add(new ItemStack(Items.dye, 1, 7), 8);
|
||||
add(new ItemStack(Items.dye, 1, 8), 8);
|
||||
add(new ItemStack(Items.dye, 1, 9), 8);
|
||||
add(new ItemStack(Items.dye, 1, 10), 8);
|
||||
add(new ItemStack(Items.dye, 1, 11), 8);
|
||||
add(new ItemStack(Items.dye, 1, 12), 8);
|
||||
add(new ItemStack(Items.dye, 1, 13), 8);
|
||||
add(new ItemStack(Items.dye, 1, 14), 8);
|
||||
add(new ItemStack(Items.dye, 1, 15), 8);
|
||||
add(Items.sugar, 32);
|
||||
add(Items.pumpkin_seeds, 36);
|
||||
add(Items.melon_seeds, 16);
|
||||
add(Items.blaze_rod, 1536);
|
||||
add(Items.gold_nugget, 227.556);
|
||||
add(Items.nether_wart, 24);
|
||||
add(Items.emerald, 8192);
|
||||
add(Items.nether_star, 24576);
|
||||
add(Items.netherbrick, 1);
|
||||
add(Items.quartz, 256);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.pahimar.ee3.tileentity;
|
|||
import com.pahimar.ee3.api.AlchemyArray;
|
||||
import com.pahimar.ee3.network.PacketHandler;
|
||||
import com.pahimar.ee3.network.message.MessageTileEntityAlchemyArray;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -357,7 +358,7 @@ public class TileEntityAlchemyArray extends TileEntityEE implements ISidedInvent
|
|||
alchemyArray = AlchemyArray.readArrayFromNBT(alchemyArrayTagCompound);
|
||||
try
|
||||
{
|
||||
Class clazz = Class.forName(alchemyArray.getClassName());
|
||||
Class clazz = Class.forName(alchemyArray.getClassName(), true, Loader.instance().getModClassLoader());
|
||||
alchemyArray = (AlchemyArray) clazz.getConstructor().newInstance();
|
||||
alchemyArray.readFromNBT(alchemyArrayTagCompound);
|
||||
}
|
||||
|
|
|
@ -9,10 +9,11 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
|||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class EnergyValueHelper
|
||||
{
|
||||
public static EnergyValue computeEnergyValueFromRecipe(WrappedStack outputStack, List<WrappedStack> inputStacks)
|
||||
public static EnergyValue computeEnergyValueFromRecipe(Map<WrappedStack, EnergyValue> stackValueMappings, WrappedStack outputStack, List<WrappedStack> inputStacks)
|
||||
{
|
||||
float computedValue = 0f;
|
||||
|
||||
|
@ -20,9 +21,9 @@ public class EnergyValueHelper
|
|||
{
|
||||
EnergyValue wrappedStackValue;
|
||||
int stackSize = -1;
|
||||
if (wrappedStack.getWrappedStack() instanceof ItemStack)
|
||||
if (wrappedStack.getWrappedObject() instanceof ItemStack)
|
||||
{
|
||||
ItemStack itemStack = (ItemStack) wrappedStack.getWrappedStack();
|
||||
ItemStack itemStack = (ItemStack) wrappedStack.getWrappedObject();
|
||||
|
||||
// Check if we are dealing with a potential fluid
|
||||
if (FluidContainerRegistry.getFluidForFilledItem(itemStack) != null)
|
||||
|
@ -30,11 +31,11 @@ public class EnergyValueHelper
|
|||
if (itemStack.getItem().getContainerItem(itemStack) != null)
|
||||
{
|
||||
stackSize = FluidContainerRegistry.getFluidForFilledItem(itemStack).amount;
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(FluidContainerRegistry.getFluidForFilledItem(itemStack));
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, FluidContainerRegistry.getFluidForFilledItem(itemStack));
|
||||
}
|
||||
else
|
||||
{
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack);
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, wrappedStack);
|
||||
}
|
||||
}
|
||||
else if (itemStack.getItem().getContainerItem(itemStack) != null)
|
||||
|
@ -43,8 +44,8 @@ public class EnergyValueHelper
|
|||
|
||||
if (EnergyValueRegistry.getInstance().hasEnergyValue(itemStack) && EnergyValueRegistry.getInstance().hasEnergyValue(containerItemStack))
|
||||
{
|
||||
float itemStackValue = EnergyValueRegistry.getInstance().getEnergyValue(itemStack).getEnergyValue();
|
||||
float containerStackValue = EnergyValueRegistry.getInstance().getEnergyValue(containerItemStack).getEnergyValue();
|
||||
float itemStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, itemStack).getEnergyValue();
|
||||
float containerStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, containerItemStack).getEnergyValue();
|
||||
wrappedStackValue = new EnergyValue(itemStackValue - containerStackValue);
|
||||
}
|
||||
else
|
||||
|
@ -58,17 +59,17 @@ public class EnergyValueHelper
|
|||
}
|
||||
else if (OreDictionary.getOreIDs(itemStack).length > 0)
|
||||
{
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack, true);
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, wrappedStack, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack);
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, wrappedStack);
|
||||
}
|
||||
}
|
||||
else if (wrappedStack.getWrappedStack() instanceof OreStack)
|
||||
else if (wrappedStack.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
OreStack oreStack = (OreStack) wrappedStack.getWrappedStack();
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack);
|
||||
OreStack oreStack = (OreStack) wrappedStack.getWrappedObject();
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, wrappedStack);
|
||||
for (ItemStack itemStack : OreDictionary.getOres(oreStack.oreName))
|
||||
{
|
||||
if (!itemStack.getItem().doesContainerItemLeaveCraftingGrid(itemStack))
|
||||
|
@ -79,7 +80,7 @@ public class EnergyValueHelper
|
|||
}
|
||||
else
|
||||
{
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValue(wrappedStack);
|
||||
wrappedStackValue = EnergyValueRegistry.getInstance().getEnergyValueFromMap(stackValueMappings, wrappedStack);
|
||||
}
|
||||
|
||||
if (wrappedStackValue != null)
|
||||
|
|
|
@ -88,7 +88,7 @@ public class RecipeHelper
|
|||
{
|
||||
WrappedStack oreStack = new WrappedStack(shapedOreRecipe.getInput()[i]);
|
||||
|
||||
if (oreStack.getWrappedStack() instanceof OreStack)
|
||||
if (oreStack.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
recipeInputs.add(oreStack);
|
||||
}
|
||||
|
@ -171,19 +171,19 @@ public class RecipeHelper
|
|||
|
||||
for (WrappedStack collatedStack : collatedStacks)
|
||||
{
|
||||
if (collatedStack.getWrappedStack() != null)
|
||||
if (collatedStack.getWrappedObject() != null)
|
||||
{
|
||||
if (stack.getWrappedStack() instanceof ItemStack && collatedStack.getWrappedStack() instanceof ItemStack)
|
||||
if (stack.getWrappedObject() instanceof ItemStack && collatedStack.getWrappedObject() instanceof ItemStack)
|
||||
{
|
||||
if (ItemHelper.equals((ItemStack) stack.getWrappedStack(), (ItemStack) collatedStack.getWrappedStack()))
|
||||
if (ItemHelper.equals((ItemStack) stack.getWrappedObject(), (ItemStack) collatedStack.getWrappedObject()))
|
||||
{
|
||||
collatedStack.setStackSize(collatedStack.getStackSize() + stack.getStackSize());
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
else if (stack.getWrappedStack() instanceof OreStack && collatedStack.getWrappedStack() instanceof OreStack)
|
||||
else if (stack.getWrappedObject() instanceof OreStack && collatedStack.getWrappedObject() instanceof OreStack)
|
||||
{
|
||||
if (OreStack.compareOreNames((OreStack) stack.getWrappedStack(), (OreStack) collatedStack.getWrappedStack()))
|
||||
if (OreStack.compareOreNames((OreStack) stack.getWrappedObject(), (OreStack) collatedStack.getWrappedObject()))
|
||||
{
|
||||
collatedStack.setStackSize(collatedStack.getStackSize() + stack.getStackSize());
|
||||
found = true;
|
||||
|
|
|
@ -158,6 +158,9 @@ commands.ee3.set-item-recoverable.usage=/ee3 set-item-recoverable <item> <data>
|
|||
commands.ee3.set-item-recoverable.success=%s set %s as being able to have its energy value recovered
|
||||
commands.ee3.set-item-not-recoverable.usage=/ee3 set-item-not-recoverable <item> <data> [dataTag]
|
||||
commands.ee3.set-item-not-recoverable.success=%s set %s as not being able to have its energy value recovered
|
||||
commands.ee3.run-tests.usage=/ee3 run-tests <file-name>
|
||||
commands.ee3.run-tests.success=Executed test file '%s', check server log for results
|
||||
commands.ee3.run-tests.notfound=Test file '%s' was not found!
|
||||
|
||||
# Tooltips
|
||||
tooltip.ee3:belongsTo=Belongs to %s
|
||||
|
|
6595
src/test/resources/minecraft-v1710-vanilla-test-suite.json
Normal file
6595
src/test/resources/minecraft-v1710-vanilla-test-suite.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue