From 2f5cac0a709daf8dc4cbf4a9fb79fb0abeef7768 Mon Sep 17 00:00:00 2001 From: tth05 <36999320+tth05@users.noreply.github.com> Date: Mon, 14 Jun 2021 20:38:11 +0200 Subject: [PATCH] v2.2.10 --- .github/workflows/release.yml | 5 ++--- CHANGELOG.md | 4 ++++ build.gradle | 2 +- .../apiimpl/autocrafting/CraftingPattern.java | 17 +++++++++++++++++ .../apiimpl/autocrafting/engine/task/Task.java | 9 ++++++++- .../integration/oc/EnvironmentNetwork.java | 12 ++++++------ 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 028ae782d..155fe4289 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,9 +35,8 @@ jobs: release_name: Release ${{ github.ref }} body: | Changes in this Release - - Fixed importer using FluidHandler instead of tank properties when extracting. This fixes extracting from some GregTech machines - - Fixed holding shift in grid sometimes hiding all items - - Small performance improvement when importing items while a crafting task is running + - Fixed items with different capabilities stacking + - Improved the OC integration draft: false prerelease: false - name: Upload jars to release diff --git a/CHANGELOG.md b/CHANGELOG.md index b4c99d974..c95c3cc5f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # More Refined Storage Changelog +# 2.2.10 +- Fixed items with different capabilities stacking +- Improved the OC integration + # 2.2.9 - Fixed importer using FluidHandler instead of tank properties when extracting. This fixes extracting from some GregTech machines - Fixed holding shift in grid sometimes hiding all items diff --git a/build.gradle b/build.gradle index b9b07cdba..79c2a7f16 100755 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'net.minecraftforge.gradle.forge' -version = "2.2.9" +version = "2.2.10" group = "refinedstorage" archivesBaseName = "morerefinedstorage" diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/CraftingPattern.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/CraftingPattern.java index c5140ff8e..4d299487c 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/CraftingPattern.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/CraftingPattern.java @@ -414,6 +414,23 @@ public boolean equals(Object obj) { return false; } + @Override + public String toString() { + return "CraftingPattern{" + + "processing=" + processing + + ", oredict=" + oredict + + ", valid=" + valid + + ", recipe=" + recipe + + ", inputs=" + inputs + + ", outputs=" + outputs + + ", byproducts=" + byproducts + + ", fluidInputs=" + fluidInputs + + ", fluidOutputs=" + fluidOutputs + + ", blacklistedItems=" + blacklistedItems + + ", blacklistedFluids=" + blacklistedFluids + + '}'; + } + private static class InventoryCraftingDummy extends InventoryCrafting { public InventoryCraftingDummy() { super(new Container() { diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/engine/task/Task.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/engine/task/Task.java index b3e9c6a1f..39db088c8 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/engine/task/Task.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/engine/task/Task.java @@ -235,7 +235,14 @@ public Task(@Nonnull ICraftingPattern pattern, ICraftingRequestInfo requestInfo) } if (outputStackSize < 1) - throw new IllegalStateException("This pattern does not seem to create the requested item!?"); + throw new IllegalStateException( + String.format( + "This pattern does not seem to create the requested item!? outputStackSize: %d, requested: %s, my pattern: %s", + outputStackSize, + requestInfo.getFluid() != null ? requestInfo.getFluid().toString() : requestInfo.getItem().toString(), + this.pattern + ) + ); //calculate actual needed amount, basically the amount of iterations that have to be run this.amountNeeded = (long) Math.ceil((double) amountNeeded / (double) outputStackSize); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/oc/EnvironmentNetwork.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/oc/EnvironmentNetwork.java index d0b1a3d94..9c00807d0 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/oc/EnvironmentNetwork.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/integration/oc/EnvironmentNetwork.java @@ -408,11 +408,11 @@ public Object[] getItems(final Context context, final Arguments args) { @Callback(doc = "function():table -- Gets a list of all connected storage disks and blocks in this network.") public Object[] getStorages(final Context context, final Arguments args) { - int totalItemStored = 0; - int totalItemCapacity = 0; + long totalItemStored = 0; + long totalItemCapacity = 0; - int totalFluidStored = 0; - int totalFluidCapacity = 0; + long totalFluidStored = 0; + long totalFluidCapacity = 0; List> devices = new ArrayList<>(); @@ -452,11 +452,11 @@ public Object[] getStorages(final Context context, final Arguments args) { } } - Map itemTotals = new HashMap<>(); + Map itemTotals = new HashMap<>(); itemTotals.put("usage", totalItemStored); itemTotals.put("capacity", totalItemCapacity); - Map fluidTotals = new HashMap<>(); + Map fluidTotals = new HashMap<>(); fluidTotals.put("usage", totalFluidStored); fluidTotals.put("capacity", totalFluidCapacity);