From b5c1aa2ad00fe6f192e63da759e44ec4f2774ab6 Mon Sep 17 00:00:00 2001 From: pahimar Date: Sun, 2 Jun 2013 17:23:30 -0400 Subject: [PATCH] Removed a dead constant, and more work on edge problem resolution --- ee3_common/com/pahimar/ee3/emc/DynEMC.java | 22 +++++++++++++------ .../pahimar/ee3/item/CustomWrappedStack.java | 2 +- ee3_common/com/pahimar/ee3/lib/Textures.java | 3 +-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ee3_common/com/pahimar/ee3/emc/DynEMC.java b/ee3_common/com/pahimar/ee3/emc/DynEMC.java index 73d09a15..6cb24347 100644 --- a/ee3_common/com/pahimar/ee3/emc/DynEMC.java +++ b/ee3_common/com/pahimar/ee3/emc/DynEMC.java @@ -157,23 +157,31 @@ public class DynEMC { for (CustomWrappedStack wrappedRecipeInput : recipeInputs) { + float weight = wrappedRecipeInput.getStackSize(); + + CustomWrappedStack recipeInput = null; + if (wrappedRecipeInput.getItemStack() != null) { ItemStack itemStack = wrappedRecipeInput.getItemStack(); - itemStack.stackSize = wrappedRecipeInput.getStackSize(); if (OreDictionary.getOreID(itemStack) != -1) { - wrappedRecipeInput = new CustomWrappedStack(new OreStack(itemStack)); + recipeInput = new CustomWrappedStack(new OreStack(itemStack)); + } + else { + recipeInput = new CustomWrappedStack(itemStack); } } - - float weight = wrappedRecipeInput.getStackSize(); - wrappedRecipeInput.setStackSize(1); + else if (wrappedRecipeInput.getOreStack() != null) { + recipeInput = new CustomWrappedStack(wrappedRecipeInput.getOreStack()); + } try { - graph.addEdge(customWrappedStack, wrappedRecipeInput, weight); + if (recipeInput != null) { + graph.addEdge(customWrappedStack, recipeInput, weight); + } } catch (NoSuchElementException e) { - LogHelper.log(Level.SEVERE, e.getMessage() + " from: [" + customWrappedStack + "], to: [" + wrappedRecipeInput + "]"); + LogHelper.log(Level.SEVERE, e.getMessage() + ";\nFrom: [" + customWrappedStack + "]\nTo: [" + wrappedRecipeInput + "]"); } } } diff --git a/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java b/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java index f0222748..c98bc9e3 100644 --- a/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java +++ b/ee3_common/com/pahimar/ee3/item/CustomWrappedStack.java @@ -11,7 +11,7 @@ public class CustomWrappedStack { private int stackSize; private ItemStack itemStack; private OreStack oreStack; - + public CustomWrappedStack(ItemStack itemStack) { this.itemStack = itemStack; diff --git a/ee3_common/com/pahimar/ee3/lib/Textures.java b/ee3_common/com/pahimar/ee3/lib/Textures.java index 88951857..acaf0268 100644 --- a/ee3_common/com/pahimar/ee3/lib/Textures.java +++ b/ee3_common/com/pahimar/ee3/lib/Textures.java @@ -11,8 +11,7 @@ package com.pahimar.ee3.lib; */ public class Textures { - // Base file pathes - public static final String ITEM_TEXTURE_LOCATION = "/mods/ee3/textures/items/"; + // Base file paths public static final String MODEL_SHEET_LOCATION = "/mods/ee3/textures/models/"; public static final String ARMOR_SHEET_LOCATION = "/mods/ee3/textures/armor/"; public static final String GUI_SHEET_LOCATION = "/mods/ee3/textures/gui/";