Fixed the Dynamic Value system
This commit is contained in:
parent
118228b828
commit
18564da7d2
|
@ -364,8 +364,14 @@ public class EnergyValueRegistry
|
|||
// Increment the pass counter
|
||||
passNumber++;
|
||||
|
||||
// Set the values for getEnergyValue calls in the auto-assignment computation
|
||||
stackMappingsBuilder = ImmutableSortedMap.naturalOrder();
|
||||
stackMappingsBuilder.putAll(stackValueMap);
|
||||
stackMappings = stackMappingsBuilder.build();
|
||||
|
||||
// Compute stack mappings from existing stack mappings
|
||||
computedStackValues = computeStackMappings();
|
||||
|
||||
for (WrappedStack keyStack : computedStackValues.keySet())
|
||||
{
|
||||
EnergyValue factoredExchangeEnergyValue = null;
|
||||
|
@ -397,8 +403,6 @@ public class EnergyValueRegistry
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Post-assigned values
|
||||
*/
|
||||
|
|
|
@ -12,7 +12,6 @@ import net.minecraft.item.crafting.ShapelessRecipes;
|
|||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipesVanilla
|
||||
|
@ -45,7 +44,7 @@ public class RecipesVanilla
|
|||
|
||||
if (recipeOutput != null)
|
||||
{
|
||||
ArrayList<WrappedStack> recipeInputs = RecipeHelper.getRecipeInputs(recipe);
|
||||
List<WrappedStack> recipeInputs = RecipeHelper.getRecipeInputs(recipe);
|
||||
|
||||
if (!recipeInputs.isEmpty())
|
||||
{
|
||||
|
|
|
@ -26,10 +26,12 @@ public class RecipeHelper
|
|||
/**
|
||||
* Returns a list of elements that constitute the input in a crafting recipe
|
||||
*
|
||||
* @param recipe The IRecipe being examined
|
||||
* @param recipe
|
||||
* The IRecipe being examined
|
||||
*
|
||||
* @return List of elements that constitute the input of the given IRecipe. Could be an ItemStack or an Arraylist
|
||||
*/
|
||||
public static ArrayList<WrappedStack> getRecipeInputs(IRecipe recipe)
|
||||
public static List<WrappedStack> getRecipeInputs(IRecipe recipe)
|
||||
{
|
||||
ArrayList<WrappedStack> recipeInputs = new ArrayList<WrappedStack>();
|
||||
|
||||
|
@ -129,13 +131,15 @@ public class RecipeHelper
|
|||
}
|
||||
}
|
||||
|
||||
return recipeInputs;
|
||||
return collateInputStacks(recipeInputs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Collates an uncollated, unsorted List of Objects into a sorted, collated List of WrappedStacks
|
||||
*
|
||||
* @param uncollatedStacks List of objects for collating
|
||||
* @param uncollatedStacks
|
||||
* List of objects for collating
|
||||
*
|
||||
* @return A sorted, collated List of WrappedStacks
|
||||
*/
|
||||
public static List<WrappedStack> collateInputStacks(List<?> uncollatedStacks)
|
||||
|
|
Loading…
Reference in a new issue