Transfer Rects now work

This commit is contained in:
Alex_hawks 2014-02-25 23:36:51 +08:00
parent 47b845a67a
commit 728e5a6dd7
6 changed files with 38 additions and 35 deletions

View file

@ -12,12 +12,6 @@ public class RICrusherRecipeHandler extends RITemplateRecipeHandler
return LanguageUtility.getLocal("resonantinduction.machine.crusher"); return LanguageUtility.getLocal("resonantinduction.machine.crusher");
} }
@Override
public void loadTransferRects()
{
}
@Override @Override
public RecipeType getMachine() public RecipeType getMachine()
{ {

View file

@ -12,12 +12,6 @@ public class RIGrinderRecipeHandler extends RITemplateRecipeHandler
return LanguageUtility.getLocal("resonantinduction.machine.grinder"); return LanguageUtility.getLocal("resonantinduction.machine.grinder");
} }
@Override
public void loadTransferRects()
{
}
@Override @Override
public RecipeType getMachine() public RecipeType getMachine()
{ {

View file

@ -12,12 +12,6 @@ public class RIMixerRecipeHandler extends RITemplateRecipeHandler
return LanguageUtility.getLocal("resonantinduction.machine.mixer"); return LanguageUtility.getLocal("resonantinduction.machine.mixer");
} }
@Override
public void loadTransferRects()
{
}
@Override @Override
public RecipeType getMachine() public RecipeType getMachine()
{ {

View file

@ -12,12 +12,6 @@ public class RISawmillRecipeHandler extends RITemplateRecipeHandler
return LanguageUtility.getLocal("resonantinduction.machine.sawmill"); return LanguageUtility.getLocal("resonantinduction.machine.sawmill");
} }
@Override
public void loadTransferRects()
{
}
@Override @Override
public RecipeType getMachine() public RecipeType getMachine()
{ {

View file

@ -12,12 +12,6 @@ public class RISmelterRecipeHandler extends RITemplateRecipeHandler
return LanguageUtility.getLocal("resonantinduction.machine.smelter"); return LanguageUtility.getLocal("resonantinduction.machine.smelter");
} }
@Override
public void loadTransferRects()
{
}
@Override @Override
public RecipeType getMachine() public RecipeType getMachine()
{ {

View file

@ -1,5 +1,6 @@
package resonantinduction.core.nei; package resonantinduction.core.nei;
import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -35,15 +36,13 @@ public abstract class RITemplateRecipeHandler extends TemplateRecipeHandler
@Override @Override
public void loadTransferRects() public void loadTransferRects()
{ {
// transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(57, 26, 52, transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(57, 26, 52, 22), getMachine().name().toLowerCase(), new Object[0]));
// 22), getMachine().name().toLowerCase(), new Object[0]));
// No point, there is no GUI class to use it... :(
} }
@Override @Override
public int recipiesPerPage() public int recipiesPerPage()
{ {
return 1; return 2;
} }
@Override @Override
@ -58,6 +57,23 @@ public abstract class RITemplateRecipeHandler extends TemplateRecipeHandler
return null; return null;
} }
@Override
public void loadCraftingRecipes(String outputId, Object... results)
{
if (outputId.equals(this.getOverlayIdentifier()))
{
for (Map.Entry<RecipeResource[], RecipeResource[]> irecipe : MachineRecipes.INSTANCE.getRecipes(getMachine()).entrySet())
{
CachedRIRecipe recipe = new CachedRIRecipe(irecipe);
this.arecipes.add(recipe);
}
}
else
{
super.loadCraftingRecipes(outputId, results);
}
}
@Override @Override
public void loadCraftingRecipes(ItemStack result) public void loadCraftingRecipes(ItemStack result)
{ {
@ -71,6 +87,23 @@ public abstract class RITemplateRecipeHandler extends TemplateRecipeHandler
} }
} }
@Override
public void loadUsageRecipes(String inputId, Object... ingredients)
{
if (inputId.equals(this.getOverlayIdentifier()))
{
for (Map.Entry<RecipeResource[], RecipeResource[]> irecipe : MachineRecipes.INSTANCE.getRecipes(getMachine()).entrySet())
{
CachedRIRecipe recipe = new CachedRIRecipe(irecipe);
this.arecipes.add(recipe);
}
}
else
{
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override @Override
public void loadUsageRecipes(ItemStack ingredient) public void loadUsageRecipes(ItemStack ingredient)
{ {
@ -147,7 +180,7 @@ public abstract class RITemplateRecipeHandler extends TemplateRecipeHandler
// inputSlots[i][0], inputSlots[i++][1])); // inputSlots[i][0], inputSlots[i++][1]));
// TODO fluidstack compatibility // TODO fluidstack compatibility
} }
if (this.inputs.size() > 0) if (this.inputs.size() > 0)
this.inputs.get(this.inputs.size() - 1).generatePermutations(); this.inputs.get(this.inputs.size() - 1).generatePermutations();
} }