Got NEI working for SAG Mill and Alloy Furnace Recipes again.

This commit is contained in:
cp committed 2014-04-14 15:50:56 +08:00
1 parent 8bedb1d424
commit da2c946f48
9 files changed
+20 -125

No files matched your search

@@ -90,6 +90,9 @@ public class EnderIoRecipe implements IEnderIoRecipe {
@Override
public boolean isOutput(ItemStack output) {
if(output == null) {
return false;
}
for (IRecipeComponent rc : outputs) {
if(rc.isEquivalent(output)) {
return true;
@@ -38,8 +38,8 @@ public abstract class RecipeComponent implements IRecipeComponent {
}
protected boolean isEqual(ItemStack left, ItemStack right) {
if(left.isItemEqual(right)) {
return left.stackTagCompound == null ? true : left.stackTagCompound.equals(right.stackTagCompound);
if(left != null && left.isItemEqual(right)) {
return left.stackTagCompound == null ? true : right.stackTagCompound != null && left.stackTagCompound.equals(right.stackTagCompound);
}
return false;
}
@@ -1,8 +1,5 @@
package crazypants.enderio.nei;
import static codechicken.core.gui.GuiDraw.changeTexture;
import static codechicken.core.gui.GuiDraw.drawTexturedModalRect;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -56,6 +53,10 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(ItemStack result) {
if(result == null) {
return;
}
List<IEnderIoRecipe> recipes = RecipeReigistry.instance.getRecipesForOutput(IEnderIoRecipe.ALLOY_SMELTER_ID, result);
for (IEnderIoRecipe recipe : recipes) {
@@ -103,8 +104,9 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
@Override
public void drawBackground(int recipe) {
GL11.glColor4f(1, 1, 1, 1);
changeTexture(getGuiTexture());
drawTexturedModalRect(0, 0, 5, 3, 166, 73);
GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 5, 3, 166, 73);
}
@Override
@@ -136,7 +138,7 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 20, input);
return getCycledIngredients(cycleticks / 20, input);
}
@Override
@@ -1,5 +1,6 @@
package crazypants.enderio.nei;
import net.minecraft.item.ItemStack;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import crazypants.enderio.Config;
@@ -14,14 +15,15 @@ public class NEIEnderIOConfig implements IConfigureNEI {
API.registerRecipeHandler(new SagMillRecipeHandler());
API.registerUsageHandler(new AlloySmelterRecipeHandler());
API.registerUsageHandler(new SagMillRecipeHandler());
//TODO:
API.setGuiOffset(GuiAlloySmelter.class, 5, 3);
API.hideItem(EnderIO.blockConduitFacade.blockID);
API.hideItem(EnderIO.itemEnderface.itemID);
API.hideItem(new ItemStack(EnderIO.blockConduitFacade));
API.hideItem(new ItemStack(EnderIO.itemEnderface));
if(!Config.photovoltaicCellEnabled) {
API.hideItem(EnderIO.blockSolarPanel.blockID);
API.hideItem(new ItemStack(EnderIO.blockSolarPanel));
}
if(!Config.travelAnchorEnabled) {
API.hideItem(EnderIO.itemTravelStaff.itemID);
API.hideItem(new ItemStack(EnderIO.itemTravelStaff));
}
}