diff --git a/dependencies.gradle b/dependencies.gradle index c4f3f134..63831e58 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.14-GTNH:dev") + devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.38-GTNH:dev") compileOnly("com.github.GTNewHorizons:ForestryMC:4.9.7:api") { transitive = false diff --git a/src/main/java/fox/spiteful/avaritia/compat/nei/CompressionHandler.java b/src/main/java/fox/spiteful/avaritia/compat/nei/CompressionHandler.java index 0cf26e9e..944bc98f 100644 --- a/src/main/java/fox/spiteful/avaritia/compat/nei/CompressionHandler.java +++ b/src/main/java/fox/spiteful/avaritia/compat/nei/CompressionHandler.java @@ -34,40 +34,40 @@ public CompressionHandler() { public class CachedCompression extends CachedRecipe { + private PositionedStack ingred; + private PositionedStack result; + private int cost; + public CachedCompression(CompressorRecipe recipe) { - this.ingred = new PositionedStack(recipe.getIngredient(), 51, 16); - this.result = new PositionedStack(recipe.getOutput(), 111, 16); - this.cost = recipe.getCost(); + this(recipe.getOutput(), recipe.getCost(), recipe.getIngredient()); } - public CachedCompression(ItemStack output, int price, ItemStack ingredient) { + public CachedCompression(ItemStack output, int price, Object ingredient) { this.ingred = new PositionedStack(ingredient, 51, 16); this.result = new PositionedStack(output, 111, 16); - cost = price; + this.cost = price; } @Override public List getIngredients() { - return getCycledIngredients(cycleticks / 48, Arrays.asList(ingred)); + return getCycledIngredients(cycleticks / 48, Arrays.asList(this.ingred)); } @Override public PositionedStack getResult() { - return result; + return this.result; } public void computeVisuals() { - ingred.generatePermutations(); + for (ItemStack item : this.ingred.items) item.stackSize = this.cost; + this.ingred.item.stackSize = this.cost; + this.ingred.generatePermutations(); } public int getCost() { return cost; } - private int cost; - - PositionedStack ingred; - PositionedStack result; } @Override @@ -111,9 +111,11 @@ public void loadCraftingRecipes(ItemStack result) { @Override public void loadUsageRecipes(String inputId, Object... ingredients) { - if (inputId.equals("extreme_compression") && getClass() == CompressionHandler.class) + if (inputId.equals("extreme_compression") && getClass() == CompressionHandler.class) { loadCraftingRecipes("extreme_compression"); - else super.loadUsageRecipes(inputId, ingredients); + } else { + super.loadUsageRecipes(inputId, ingredients); + } } @Override @@ -121,6 +123,7 @@ public void loadUsageRecipes(ItemStack ingredient) { for (CompressorRecipe recipe : CompressorManager.getRecipes()) { if (safeOre(recipe) && recipe.validInput(ingredient)) { CachedCompression r = new CachedCompression(recipe.getOutput(), recipe.getCost(), ingredient); + r.computeVisuals(); arecipes.add(r); } } @@ -136,12 +139,6 @@ public String getGuiTexture() { return "avaritia:textures/gui/compressor.png"; } - @Override - public void drawForeground(int recipe) { - super.drawForeground(recipe); - fontRender.drawString(((CachedCompression) arecipes.get(recipe)).getCost() + "", 50, 38, 4210752); - } - @Override public void drawExtras(int recipe) { drawProgressBar(74, 15, 176, 14, 24, 16, 48, 0);