mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-20 03:59:37 +00:00
Massive recipe system overhaul.
They should be much more efficient now (this reduced the tick time of the CI Chamber by 3-4x in my testing), due to being able to just use the HashMap's get() instead of being limited to iterating through entries. NEI integration code now a lot more readable and type-safe as well.
This commit is contained in:
1 parent
4dd3d4ba01
commit
ce6946c669
77 files changed
+1294
-486
No files matched your search
@@ -9,7 +9,7 @@ import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.api.recipe.AdvancedInput;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismItems;
|
||||
@@ -140,11 +140,11 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
||||
|
||||
for(Object obj : getRecipes().entrySet())
|
||||
{
|
||||
if(((Map.Entry)obj).getKey() instanceof AdvancedInput)
|
||||
if(((Map.Entry)obj).getKey() instanceof AdvancedMachineInput)
|
||||
{
|
||||
Map.Entry entry = (Map.Entry)obj;
|
||||
|
||||
ItemStack stack = ((AdvancedInput)entry.getKey()).itemStack;
|
||||
ItemStack stack = ((AdvancedMachineInput)entry.getKey()).itemStack;
|
||||
|
||||
if(StackUtils.equalsWildcard(stack, itemStack))
|
||||
{
|
||||
@@ -207,7 +207,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
||||
@Override
|
||||
public void operate()
|
||||
{
|
||||
ItemStack itemstack = RecipeHandler.getOutput(new AdvancedInput(inventory[0], gasTank.getGas().getGas()), true, getRecipes());
|
||||
ItemStack itemstack = RecipeHandler.getOutput(new AdvancedMachineInput(inventory[0], gasTank.getGas().getGas()), true, getRecipes());
|
||||
|
||||
if(inventory[0].stackSize <= 0)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemstack = RecipeHandler.getOutput(new AdvancedInput(inventory[0], gasTank.getGas().getGas()), false, getRecipes());
|
||||
ItemStack itemstack = RecipeHandler.getOutput(new AdvancedMachineInput(inventory[0], gasTank.getGas().getGas()), false, getRecipes());
|
||||
|
||||
if(itemstack == null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user