From b08372609415dc4beedcfec73fc7ae689f685f0d Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 20 Dec 2022 16:27:35 +0100 Subject: [PATCH 01/11] Bump to v1.11.5. --- CHANGELOG.md | 2 ++ build.gradle | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd861a945..d0ade6513 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [v1.11.4] - 2022-12-20 + ### Fixed - Fixed duplication bug in the Interface. diff --git a/build.gradle b/build.gradle index 5874083b8..e8d1de153 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ apply plugin: 'maven-publish' group = 'com.refinedmods' archivesBaseName = 'refinedstorage' -version = '1.11.4' +version = '1.11.5' if (System.getenv('GITHUB_SHA') != null) { version += '+' + System.getenv('GITHUB_SHA').substring(0, 7) From 93cead379cb330103985ffd961dd4ca2ece5070f Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Tue, 20 Dec 2022 16:57:02 +0100 Subject: [PATCH 02/11] Add changelog from v1.10.4. --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ade6513..ffd08e8e1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,20 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Ported to Minecraft 1.19.2. +## [v1.10.4] - 2022-12-20 + +### Fixed + +- Fixed external storage cache being de-synced from the network cache. +- Fixed external storage using an out of date block entity for getting handler. +- Fixed chained crafters not taking over the name of the root crafter. +- Made Refined Storage more robust against crashes when moving network blocks by unconventional means. +- Fixed duplication bug in the Interface. + +### Changed + +- Increased packet size limit. + ## [v1.10.3] - 2022-08-06 ### Fixed From 1ac11ad5d307437c04483ebcc9d2b33d611edad1 Mon Sep 17 00:00:00 2001 From: Darkere Date: Tue, 27 Dec 2022 21:32:56 +0100 Subject: [PATCH 03/11] fix some craftable items getting not showing as craftable in JEI --- CHANGELOG.md | 4 ++++ .../refinedstorage/integration/jei/IngredientTracker.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffd08e8e1..9edf7366a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- Fixed some craftable items not showing as craftable in JEI + ## [v1.11.4] - 2022-12-20 ### Fixed diff --git a/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java b/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java index 064bfa4e5..1bc8b4a98 100644 --- a/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java +++ b/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java @@ -164,7 +164,9 @@ public class IngredientTracker { for (Ingredient ingredient : ingredientList.ingredients) { ingredient.getSlotView().getIngredients(VanillaTypes.ITEM_STACK).takeWhile(stack -> !ingredient.isAvailable()).forEach(stack -> { - ingredient.setCraftStackId(craftableItems.get(new ItemStackKey(stack))); + if(ingredient.getCraftStackId() == null) { + ingredient.setCraftStackId(craftableItems.get(new ItemStackKey(stack))); + } // Check grid crafting slots if (gridContainer.getGrid().getGridType().equals(GridType.CRAFTING)) { CraftingContainer craftingMatrix = gridContainer.getGrid().getCraftingMatrix(); From f4e9d5d9e65ac6a83d94c6f9776838a36d776180 Mon Sep 17 00:00:00 2001 From: Robin Govers Date: Mon, 2 Jan 2023 15:36:07 +0100 Subject: [PATCH 04/11] Removed direct references to VanillaTypes.ITEM_STACK The constant value causes the JVM to try to link JEI classes at runtime when the callers class is loaded Luckily JEI added convenience functions to remove the need for VanillaTypes.ITEM_STACK ( https://github.com/mezz/JustEnoughItems/commit/6a332a73f789565001677f5e814533d675d35fed ) --- .../jei/CoverCraftingCategoryExtension.java | 5 ++--- .../jei/GridRecipeTransferHandler.java | 15 +++++++-------- .../jei/HollowCoverCraftingCategoryExtension.java | 5 ++--- .../integration/jei/IngredientTracker.java | 3 +-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/refinedmods/refinedstorage/integration/jei/CoverCraftingCategoryExtension.java b/src/main/java/com/refinedmods/refinedstorage/integration/jei/CoverCraftingCategoryExtension.java index 19474496e..41c24d927 100644 --- a/src/main/java/com/refinedmods/refinedstorage/integration/jei/CoverCraftingCategoryExtension.java +++ b/src/main/java/com/refinedmods/refinedstorage/integration/jei/CoverCraftingCategoryExtension.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage.RSItems; import com.refinedmods.refinedstorage.apiimpl.network.node.cover.CoverManager; import com.refinedmods.refinedstorage.item.CoverItem; import com.refinedmods.refinedstorage.recipe.CoverRecipe; -import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; import mezz.jei.api.gui.builder.IRecipeSlotBuilder; import mezz.jei.api.gui.ingredient.ICraftingGridHelper; @@ -55,8 +54,8 @@ public class CoverCraftingCategoryExtension implements ICraftingCategoryExtensio List> inputs = new ArrayList<>(Collections.nCopies(9, new ArrayList<>())); inputs.set(3, nuggets); inputs.set(4, input); - List inputSlots = craftingGridHelper.createAndSetInputs(builder, VanillaTypes.ITEM_STACK, inputs, 3, 3); - IRecipeSlotBuilder outputSlot = craftingGridHelper.createAndSetOutputs(builder, VanillaTypes.ITEM_STACK, output); + List inputSlots = craftingGridHelper.createAndSetInputs(builder, inputs, 3, 3); + IRecipeSlotBuilder outputSlot = craftingGridHelper.createAndSetOutputs(builder, output); builder.createFocusLink(inputSlots.get(4), outputSlot); } diff --git a/src/main/java/com/refinedmods/refinedstorage/integration/jei/GridRecipeTransferHandler.java b/src/main/java/com/refinedmods/refinedstorage/integration/jei/GridRecipeTransferHandler.java index c85ae911a..a8027d27a 100644 --- a/src/main/java/com/refinedmods/refinedstorage/integration/jei/GridRecipeTransferHandler.java +++ b/src/main/java/com/refinedmods/refinedstorage/integration/jei/GridRecipeTransferHandler.java @@ -8,7 +8,6 @@ import com.refinedmods.refinedstorage.network.grid.GridCraftingPreviewRequestMes import com.refinedmods.refinedstorage.network.grid.GridProcessingTransferMessage; import com.refinedmods.refinedstorage.network.grid.GridTransferMessage; import com.refinedmods.refinedstorage.screen.grid.GridScreen; -import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.forge.ForgeTypes; import mezz.jei.api.gui.ingredient.IRecipeSlotView; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; @@ -67,7 +66,7 @@ public class GridRecipeTransferHandler implements IRecipeTransferHandler firstStack = slotView.getIngredients(VanillaTypes.ITEM_STACK).findAny(); + Optional firstStack = slotView.getItemStacks().findAny(); ingredientList.add(new Ingredient(slotView, firstStack.map(ItemStack::getCount).orElse(0))); } @@ -139,10 +138,10 @@ public class GridRecipeTransferHandler implements IRecipeTransferHandler> inputs = recipeSlotsView.getSlotViews(RecipeIngredientRole.INPUT).stream().map(view -> { //Creating a mutable list - List stacks = view.getIngredients(VanillaTypes.ITEM_STACK).collect(Collectors.toCollection(ArrayList::new)); + List stacks = view.getItemStacks().collect(Collectors.toCollection(ArrayList::new)); //moving the displayed stack to first - Optional displayStack = view.getDisplayedIngredient(VanillaTypes.ITEM_STACK); + Optional displayStack = view.getDisplayedItemStack(); displayStack.ifPresent(stack -> { int index = stacks.indexOf(stack); if (index > -1) { @@ -185,11 +184,11 @@ public class GridRecipeTransferHandler implements IRecipeTransferHandler list, IRecipeSlotView slotView, GridContainerMenu gridContainer, Player player) { - if (slotView != null && slotView.getIngredients(VanillaTypes.ITEM_STACK).findAny().isPresent()) { - ItemStack stack = IngredientTracker.getTracker(gridContainer).findBestMatch(gridContainer, player, slotView.getIngredients(VanillaTypes.ITEM_STACK).toList()); + if (slotView != null && slotView.getItemStacks().findAny().isPresent()) { + ItemStack stack = IngredientTracker.getTracker(gridContainer).findBestMatch(gridContainer, player, slotView.getItemStacks().toList()); - if (stack.isEmpty() && slotView.getDisplayedIngredient(VanillaTypes.ITEM_STACK).isPresent()) { - stack = slotView.getDisplayedIngredient(VanillaTypes.ITEM_STACK).get(); + if (stack.isEmpty() && slotView.getDisplayedItemStack().isPresent()) { + stack = slotView.getDisplayedItemStack().get(); } if (!stack.isEmpty()) { list.add(stack); diff --git a/src/main/java/com/refinedmods/refinedstorage/integration/jei/HollowCoverCraftingCategoryExtension.java b/src/main/java/com/refinedmods/refinedstorage/integration/jei/HollowCoverCraftingCategoryExtension.java index ceac5b2c8..f68260ef8 100644 --- a/src/main/java/com/refinedmods/refinedstorage/integration/jei/HollowCoverCraftingCategoryExtension.java +++ b/src/main/java/com/refinedmods/refinedstorage/integration/jei/HollowCoverCraftingCategoryExtension.java @@ -4,7 +4,6 @@ import com.refinedmods.refinedstorage.RSItems; import com.refinedmods.refinedstorage.apiimpl.network.node.cover.CoverManager; import com.refinedmods.refinedstorage.item.CoverItem; import com.refinedmods.refinedstorage.recipe.HollowCoverRecipe; -import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; import mezz.jei.api.gui.builder.IRecipeSlotBuilder; import mezz.jei.api.gui.ingredient.ICraftingGridHelper; @@ -52,8 +51,8 @@ public class HollowCoverCraftingCategoryExtension implements ICraftingCategoryEx } stacks.set(4, input); - List inputSlots = craftingGridHelper.createAndSetInputs(builder, VanillaTypes.ITEM_STACK, stacks, 0, 0); - IRecipeSlotBuilder outputSlot = craftingGridHelper.createAndSetOutputs(builder, VanillaTypes.ITEM_STACK, output); + List inputSlots = craftingGridHelper.createAndSetInputs(builder, stacks, 0, 0); + IRecipeSlotBuilder outputSlot = craftingGridHelper.createAndSetOutputs(builder, output); builder.createFocusLink(inputSlots.get(4), outputSlot); } diff --git a/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java b/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java index 1bc8b4a98..f1831d4dc 100644 --- a/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java +++ b/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java @@ -12,7 +12,6 @@ import com.refinedmods.refinedstorage.screen.grid.stack.IGridStack; import com.refinedmods.refinedstorage.screen.grid.stack.ItemGridStack; import com.refinedmods.refinedstorage.screen.grid.view.IGridView; import com.refinedmods.refinedstorage.util.ItemStackKey; -import mezz.jei.api.constants.VanillaTypes; import net.minecraft.client.Minecraft; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.CraftingContainer; @@ -162,7 +161,7 @@ public class IngredientTracker { //Gather available Stacks for (Ingredient ingredient : ingredientList.ingredients) { - ingredient.getSlotView().getIngredients(VanillaTypes.ITEM_STACK).takeWhile(stack -> !ingredient.isAvailable()).forEach(stack -> { + ingredient.getSlotView().getItemStacks().takeWhile(stack -> !ingredient.isAvailable()).forEach(stack -> { if(ingredient.getCraftStackId() == null) { ingredient.setCraftStackId(craftableItems.get(new ItemStackKey(stack))); From 99a671223de8791ff81d334e8b142bba5a702789 Mon Sep 17 00:00:00 2001 From: Robin Govers Date: Mon, 2 Jan 2023 21:32:59 +0100 Subject: [PATCH 05/11] * Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edf7366a..c609032b9 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed some craftable items not showing as craftable in JEI +- Fixed grid crashing on exit if JEI mod is not used ## [v1.11.4] - 2022-12-20 From 0706726b305d309bbb9edd91167b651379beda71 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Fri, 3 Feb 2023 21:15:22 +0100 Subject: [PATCH 06/11] Add resolved issue locking --- .github/workflows/resolved-issue-locking.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/resolved-issue-locking.yml diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml new file mode 100644 index 000000000..4cbc15d68 --- /dev/null +++ b/.github/workflows/resolved-issue-locking.yml @@ -0,0 +1,13 @@ +name: Lock resolved issues and PRs +on: + schedule: + - cron: '0 0 * * *' +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v2 + with: + github-token: ${{ github.token }} + issue-lock-inactive-days: '30' + pr-lock-inactive-days: '30' \ No newline at end of file From 2a5c4e77e2a0701be1094d11555edc9ec5831044 Mon Sep 17 00:00:00 2001 From: Darkere Date: Mon, 6 Feb 2023 22:43:14 +0100 Subject: [PATCH 07/11] fix racecondition with Itemstack.EMPTY --- .../storage/externalstorage/ItemExternalStorageCache.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/refinedmods/refinedstorage/apiimpl/storage/externalstorage/ItemExternalStorageCache.java b/src/main/java/com/refinedmods/refinedstorage/apiimpl/storage/externalstorage/ItemExternalStorageCache.java index 7353c64ca..3cc4b7367 100644 --- a/src/main/java/com/refinedmods/refinedstorage/apiimpl/storage/externalstorage/ItemExternalStorageCache.java +++ b/src/main/java/com/refinedmods/refinedstorage/apiimpl/storage/externalstorage/ItemExternalStorageCache.java @@ -62,6 +62,10 @@ public class ItemExternalStorageCache { ItemStack cached = cache.get(i); + //ItemStack.EMPTY can be accidentally modified by other mods on any thread. This makes sure we ignore that. + if (actual == ItemStack.EMPTY && actual == cached) + continue; + if (!cached.isEmpty() && actual.isEmpty()) { // REMOVED network.getItemStorageCache().remove(cached, cached.getCount(), true); From 428c76275b1be465b231e681f94baf74921983f7 Mon Sep 17 00:00:00 2001 From: Darkere Date: Mon, 6 Feb 2023 22:48:15 +0100 Subject: [PATCH 08/11] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c609032b9..d85e0e8ee 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed some craftable items not showing as craftable in JEI - Fixed grid crashing on exit if JEI mod is not used +- Fixed rare multithreading crash ## [v1.11.4] - 2022-12-20 From f16b737d9ce69eaba7c8840dc5dba74d512d04db Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 12 Feb 2023 10:06:10 +0100 Subject: [PATCH 09/11] Update license --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 0ad0fa679..52d00fe80 100755 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright © 2015 - 2022 Refined Mods +Copyright © 2015 - 2023 Refined Mods Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation From 4836c6fa9d291d6fbab347aac4267ce4f3ee0cca Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 12 Feb 2023 10:07:07 +0100 Subject: [PATCH 10/11] Add Mastodon announce --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48c036573..4eca4ff34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,3 +83,9 @@ jobs: consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} + - name: Announce to Mastodon + uses: rzr/fediverse-action@master + with: + access-token: ${{ secrets.MASTODON_TOKEN }} + host: 'anvil.social' + message: "Refined Storage ${{ env.GIT_TAG_NAME }} has been released! ${{ env.RELEASE_URL }}" From 036e6807951447bb3503ffaace4781abbf626197 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 12 Feb 2023 10:16:36 +0100 Subject: [PATCH 11/11] Fixed Constructor being able to drop more than the maximum stack size for an item. Fixes #3455 --- CHANGELOG.md | 3 ++- .../apiimpl/network/node/ConstructorNetworkNode.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d85e0e8ee..b9ef0cc9f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed some craftable items not showing as craftable in JEI -- Fixed grid crashing on exit if JEI mod is not used +- Fixed Grid crashing on exit if JEI mod is not used - Fixed rare multithreading crash +- Fixed Constructor being able to drop more than the maximum stack size for an item ## [v1.11.4] - 2022-12-20 diff --git a/src/main/java/com/refinedmods/refinedstorage/apiimpl/network/node/ConstructorNetworkNode.java b/src/main/java/com/refinedmods/refinedstorage/apiimpl/network/node/ConstructorNetworkNode.java index da1a613a4..5a4e6c344 100644 --- a/src/main/java/com/refinedmods/refinedstorage/apiimpl/network/node/ConstructorNetworkNode.java +++ b/src/main/java/com/refinedmods/refinedstorage/apiimpl/network/node/ConstructorNetworkNode.java @@ -134,7 +134,8 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable, } private void extractAndDropItem(ItemStack stack) { - ItemStack took = network.extractItem(stack, upgrades.getStackInteractCount(), compare, Action.PERFORM); + int dropCount = Math.min(upgrades.getStackInteractCount(), stack.getMaxStackSize()); + ItemStack took = network.extractItem(stack, dropCount, compare, Action.PERFORM); if (!took.isEmpty()) { DefaultDispenseItemBehavior.spawnItem(level, took, 6, getDirection(), new PositionImpl(getDispensePositionX(), getDispensePositionY(), getDispensePositionZ()));