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 }}" 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index dd861a945..b9ef0cc9f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ 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 rare multithreading crash +- Fixed Constructor being able to drop more than the maximum stack size for an item + +## [v1.11.4] - 2022-12-20 + +### Fixed + - Fixed duplication bug in the Interface. ## [v1.11.3] - 2022-12-20 @@ -48,6 +57,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 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 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) 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())); 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); 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 064bfa4e5..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,9 +161,11 @@ 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 -> { - 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();