Skip to content

Commit

Permalink
chore: upgrade refined storage
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Dec 8, 2024
1 parent 560fa34 commit 4fa2091
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [ opened, synchronize, reopened ]
jobs:
build:
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.20.0
with:
mutation-testing: false
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
jobs:
draft:
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.20.0
with:
release-type: ${{ inputs.release-type }}
version-number-override: ${{ inputs.version-number-override }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-for-unsupported-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ labeled, unlabeled, reopened ]
jobs:
unsupported-labeler:
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.20.0
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- closed
jobs:
publish-release:
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.20.0
secrets: inherit
with:
project-name: 'Refined Storage - REI Integration'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/resolved-issue-locking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
- cron: '0 0 * * *'
jobs:
lock:
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.20.0
2 changes: 1 addition & 1 deletion .github/workflows/validate-branch-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate branch name
on: [ pull_request ]
jobs:
validate-branch-name:
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.20.0
2 changes: 1 addition & 1 deletion .github/workflows/validate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on:
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
jobs:
validate-changelog:
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.20.0
2 changes: 1 addition & 1 deletion .github/workflows/validate-commit-messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: Validate commit messages
on: [ pull_request ]
jobs:
validate-commit-messages:
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.19.1
uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.20.0
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Support for Refined Storage v2.0.0-milestone.4.11.
- Recipe transfer not working in the Wireless Crafting Grid.

## [0.4.0] - 2024-10-12

### Added
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
refinedarchitectVersion=0.19.1
refinedstorageVersion=2.0.0-milestone.4.8
refinedarchitectVersion=0.20.0
refinedstorageVersion=2.0.0-milestone.4.11
# https://linkie.shedaniel.dev/dependencies?loader=neoforge&version=1.21
# https://linkie.shedaniel.dev/dependencies?loader=fabric&version=1.21
architecturyVersion=13.0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.list.MutableResourceList;
import com.refinedmods.refinedstorage.common.api.RefinedStorageApi;
import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu;
import com.refinedmods.refinedstorage.common.api.RefinedStorageClientApi;
import com.refinedmods.refinedstorage.common.grid.AbstractCraftingGridContainerMenu;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.awt.Color;
Expand Down Expand Up @@ -45,7 +45,7 @@ class CraftingGridTransferHandler extends AbstractTransferHandler {

@Override
public Result handle(final Context context) {
if (!(context.getMenu() instanceof CraftingGridContainerMenu containerMenu)
if (!(context.getMenu() instanceof AbstractCraftingGridContainerMenu containerMenu)
|| !context.getDisplay().getCategoryIdentifier().equals(BuiltinPlugin.CRAFTING)
|| !(context.getDisplay() instanceof DefaultCraftingDisplay<?> defaultCraftingDisplay)) {
return Result.createNotApplicable();
Expand All @@ -68,12 +68,12 @@ public Result handle(final Context context) {
.blocksFurtherHandling();
}

private Result doActuallyCrafting(final Context context, final CraftingGridContainerMenu containerMenu,
private Result doActuallyCrafting(final Context context, final AbstractCraftingGridContainerMenu containerMenu,
final TransferType type, final TransferInputs transferInputs,
final List<EntryIngredient> ingredients) {
if (type.canOpenAutocraftingPreview() && Screen.hasControlDown()) {
final List<ResourceAmount> craftingRequests = transferInputs.createCraftingRequests();
RefinedStorageApi.INSTANCE.openAutocraftingPreview(craftingRequests, context.getContainerScreen());
RefinedStorageClientApi.INSTANCE.openAutocraftingPreview(craftingRequests, context.getContainerScreen());
return Result.createSuccessful().blocksFurtherHandling(false);
} else {
doTransfer(ingredients, containerMenu);
Expand All @@ -98,7 +98,8 @@ private static Component getTooltip(final TransferType type) {
};
}

private void doTransfer(final List<EntryIngredient> ingredients, final CraftingGridContainerMenu containerMenu) {
private void doTransfer(final List<EntryIngredient> ingredients,
final AbstractCraftingGridContainerMenu containerMenu) {
final List<List<ItemResource>> inputs = getInputs(ingredients);
containerMenu.transferRecipe(inputs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.common.api.RefinedStorageApi;
import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu;
import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"fabricloader": ">=0.14.6",
"fabric-api": "*",
"minecraft": "~1.21",
"refinedstorage": ">=2.0.0-milestone.4.8",
"refinedstorage": ">=2.0.0-milestone.4.11",
"roughlyenoughitems": ">=16",
"java": ">=17"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.api.resource.list.MutableResourceList;
import com.refinedmods.refinedstorage.common.api.RefinedStorageApi;
import com.refinedmods.refinedstorage.common.grid.CraftingGridContainerMenu;
import com.refinedmods.refinedstorage.common.api.RefinedStorageClientApi;
import com.refinedmods.refinedstorage.common.grid.AbstractCraftingGridContainerMenu;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.awt.Color;
Expand Down Expand Up @@ -45,7 +45,7 @@ class CraftingGridTransferHandler extends AbstractTransferHandler {

@Override
public Result handle(final Context context) {
if (!(context.getMenu() instanceof CraftingGridContainerMenu containerMenu)
if (!(context.getMenu() instanceof AbstractCraftingGridContainerMenu containerMenu)
|| !context.getDisplay().getCategoryIdentifier().equals(BuiltinPlugin.CRAFTING)
|| !(context.getDisplay() instanceof DefaultCraftingDisplay<?> defaultCraftingDisplay)) {
return Result.createNotApplicable();
Expand All @@ -68,12 +68,12 @@ public Result handle(final Context context) {
.blocksFurtherHandling();
}

private Result doActuallyCrafting(final Context context, final CraftingGridContainerMenu containerMenu,
private Result doActuallyCrafting(final Context context, final AbstractCraftingGridContainerMenu containerMenu,
final TransferType type, final TransferInputs transferInputs,
final List<EntryIngredient> ingredients) {
if (type.canOpenAutocraftingPreview() && Screen.hasControlDown()) {
final List<ResourceAmount> craftingRequests = transferInputs.createCraftingRequests();
RefinedStorageApi.INSTANCE.openAutocraftingPreview(craftingRequests, context.getContainerScreen());
RefinedStorageClientApi.INSTANCE.openAutocraftingPreview(craftingRequests, context.getContainerScreen());
return Result.createSuccessful().blocksFurtherHandling(false);
} else {
doTransfer(ingredients, containerMenu);
Expand All @@ -98,7 +98,8 @@ private static Component getTooltip(final TransferType type) {
};
}

private void doTransfer(final List<EntryIngredient> ingredients, final CraftingGridContainerMenu containerMenu) {
private void doTransfer(final List<EntryIngredient> ingredients,
final AbstractCraftingGridContainerMenu containerMenu) {
final List<List<ItemResource>> inputs = getInputs(ingredients);
containerMenu.transferRecipe(inputs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.refinedmods.refinedstorage.api.grid.view.GridView;
import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import com.refinedmods.refinedstorage.common.api.RefinedStorageApi;
import com.refinedmods.refinedstorage.common.autocrafting.PatternGridContainerMenu;
import com.refinedmods.refinedstorage.common.autocrafting.patterngrid.PatternGridContainerMenu;
import com.refinedmods.refinedstorage.common.support.resource.ItemResource;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REI integration for Refined Storage.
[[dependencies.refinedstorage_rei_integration]]
modId = "refinedstorage"
type = "required"
versionRange = "2.0.0-milestone.4.8"
versionRange = "2.0.0-milestone.4.11"
side = "BOTH"
[[dependencies.refinedstorage_rei_integration]]
modId = "roughlyenoughitems"
Expand Down

0 comments on commit 4fa2091

Please sign in to comment.