diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d929057b3..e8fb13b30 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -12,6 +12,7 @@ These are the most important things to know before contributing (also explained - Branch names must be formatted correctly. The format is `{category}/GH-{issue number}/{lowercase-description}`. Category must match a category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). + You can also use `NO-ISSUE` instead of a GitHub issue number. - We use [Checkstyle](https://checkstyle.sourceforge.io/) in our build workflow to validate coding style. It is recommended to import the [config/checkstyle/checkstyle.xml](../config/checkstyle/checkstyle.xml) or [config/intellij-code-style.xml](../config/intellij-code-style.xml) file into your @@ -47,7 +48,7 @@ Because we use merge commits when merging a PR, branch names will be part of the branch names must follow a certain standard. The format is `{category}/GH-{issue number}/{lowercase-description}` and a branch name can be maximum 50 characters of -length. +length. You can also use `NO-ISSUE` instead of a GitHub issue number. Category must match a category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum). diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 9e5add64b..427564528 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,4 @@ +#file: noinspection YAMLSchemaValidation,YAMLSchemaValidation blank_issues_enabled: true contact_links: - name: Discord Community Support diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcdc4de5b..8754bf00d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: types: [ opened, synchronize, reopened ] jobs: build: - uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.16.4 + uses: refinedmods/refinedarchitect/.github/workflows/build.yml@v0.16.6 with: gametests: true secrets: inherit diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 2300f88fd..e835fe3d6 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -17,7 +17,7 @@ on: type: string jobs: draft: - uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.16.4 + uses: refinedmods/refinedarchitect/.github/workflows/draft-release.yml@v0.16.6 with: release-type: ${{ inputs.release-type }} version-number-override: ${{ inputs.version-number-override }} diff --git a/.github/workflows/issue-for-unsupported-version.yml b/.github/workflows/issue-for-unsupported-version.yml index 7444dec88..f93f0ac62 100644 --- a/.github/workflows/issue-for-unsupported-version.yml +++ b/.github/workflows/issue-for-unsupported-version.yml @@ -4,4 +4,4 @@ on: types: [ labeled, unlabeled, reopened ] jobs: unsupported-labeler: - uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/issue-for-unsupported-version.yml@v0.16.6 \ No newline at end of file diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 5cfaf1f6c..cd00e761b 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -7,7 +7,7 @@ on: - closed jobs: publish-release: - uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.16.4 + uses: refinedmods/refinedarchitect/.github/workflows/publish-release.yml@v0.16.6 secrets: inherit with: project-name: 'Refined Storage' diff --git a/.github/workflows/resolved-issue-locking.yml b/.github/workflows/resolved-issue-locking.yml index ee10c5cfc..25495168a 100644 --- a/.github/workflows/resolved-issue-locking.yml +++ b/.github/workflows/resolved-issue-locking.yml @@ -1,7 +1,7 @@ name: Lock resolved issues and PRs on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * 1' jobs: lock: - uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/resolved-issue-locking.yml@v0.16.6 \ No newline at end of file diff --git a/.github/workflows/validate-branch-name.yml b/.github/workflows/validate-branch-name.yml index 161415298..8d8cb7693 100644 --- a/.github/workflows/validate-branch-name.yml +++ b/.github/workflows/validate-branch-name.yml @@ -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.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-branch-name.yml@v0.16.6 \ No newline at end of file diff --git a/.github/workflows/validate-changelog.yml b/.github/workflows/validate-changelog.yml index d2a2d80d7..d96832f2c 100644 --- a/.github/workflows/validate-changelog.yml +++ b/.github/workflows/validate-changelog.yml @@ -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.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-changelog.yml@v0.16.6 \ No newline at end of file diff --git a/.github/workflows/validate-commit-messages.yml b/.github/workflows/validate-commit-messages.yml index 449efa5d2..f1db39522 100644 --- a/.github/workflows/validate-commit-messages.yml +++ b/.github/workflows/validate-commit-messages.yml @@ -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.16.4 \ No newline at end of file + uses: refinedmods/refinedarchitect/.github/workflows/validate-commit-messages.yml@v0.16.6 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 766ed11d8..2574d4f82 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ eclipse/ *.iws .idea/ !.idea/dictionaries/refinedstorage.xml +!.idea/inspectionProfiles/refinedstorage.xml !.idea/icon.png out/ /bin/ diff --git a/.idea/dictionaries/refinedstorage.xml b/.idea/dictionaries/refinedstorage.xml new file mode 100644 index 000000000..5932a79c6 --- /dev/null +++ b/.idea/dictionaries/refinedstorage.xml @@ -0,0 +1,31 @@ + + + + allowlist + autocrafting + autoselected + blocklist + cullface + emissive + firstperson + frametime + gametests + glowstone + iface + leds + lefthand + modloader + modrinth + netherite + overworld + patreon + raoulvdberge + redstone + refinedarchitect + refinedmods + refinedstorage + righthand + thirdperson + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/refinedstorage.xml b/.idea/inspectionProfiles/refinedstorage.xml new file mode 100644 index 000000000..c518fa1db --- /dev/null +++ b/.idea/inspectionProfiles/refinedstorage.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index c7f8db9c9..9be5e62d7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +
Refined Storage logo

Refined Storage 2

@@ -15,7 +16,7 @@ access the inventories of many devices through a single unified GUI. This mod not only adds storage solutions, but also devices that can be used to manipulate items and blocks in the world and from within the system, such as importers, exporters, constructors, destructors, and more! There are also devices in -this mod that allow the player to setup auto-crafting, allowing the crafting of complex recipes in a few simple clicks. +this mod that allow the player to set up auto-crafting, allowing the crafting of complex recipes in a few simple clicks. ## Links diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 0f886cd2a..49d68cdb1 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -2,6 +2,7 @@ + diff --git a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java index 8f1579162..770a781d3 100644 --- a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java +++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java @@ -26,7 +26,6 @@ public ComponentMapFactory copy() { return new ComponentMapFactory<>(new LinkedHashMap<>(factories)); } - @SuppressWarnings("unchecked") public ComponentMap buildComponentMap(final X context) { final Map, C> components = new LinkedHashMap<>(); factories.forEach((componentType, factory) -> { diff --git a/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java index 3bcb34c4a..a1c3c3e94 100644 --- a/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java +++ b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java @@ -35,6 +35,7 @@ void shouldValidateEquals() { } @Test + @SuppressWarnings("ObviousNullCheck") void shouldValidateNull() { // Act & assert final Exception e = assertThrows( @@ -47,6 +48,7 @@ void shouldValidateNull() { } @Test + @SuppressWarnings("ObviousNullCheck") void shouldValidateNotNull() { // Act & assert final Exception e = assertThrows( diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java index 6a86c42ae..a7a3e6ea0 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java @@ -45,7 +45,7 @@ public GridQueryParserImpl(final LexerTokenMappings tokenMappings, @Override public Predicate parse(final String query) throws GridQueryParserException { - if ("".equals(query.trim())) { + if (query.trim().isEmpty()) { return resource -> true; } final List tokens = getTokens(query); @@ -82,16 +82,13 @@ private Predicate implicitAnd(final List nodes) throws GridQ } private Predicate parseNode(final Node node) throws GridQueryParserException { - if (node instanceof LiteralNode literalNode) { - return parseLiteral(literalNode); - } else if (node instanceof UnaryOpNode unaryOpNode) { - return parseUnaryOp(unaryOpNode); - } else if (node instanceof BinOpNode binOpNode) { - return parseBinOp(binOpNode); - } else if (node instanceof ParenNode parenNode) { - return implicitAnd(parenNode.nodes()); - } - throw new GridQueryParserException("Unsupported node", null); + return switch (node) { + case LiteralNode literalNode -> parseLiteral(literalNode); + case UnaryOpNode unaryOpNode -> parseUnaryOp(unaryOpNode); + case BinOpNode binOpNode -> parseBinOp(binOpNode); + case ParenNode parenNode -> implicitAnd(parenNode.nodes()); + default -> throw new GridQueryParserException("Unsupported node", null); + }; } private Predicate parseBinOp(final BinOpNode node) throws GridQueryParserException { diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java index d995757e9..9f25238cc 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java @@ -72,7 +72,7 @@ public interface GridView { /** * Applies a change to a resource. Will update the backing list, and will also update the view list (depending - * if the view is preventing sorting). + * on if the view is preventing sorting). * * @param resource the resource * @param amount the amount, can be negative or positive diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java index abdf96a5c..49394645e 100644 --- a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java +++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java @@ -215,7 +215,7 @@ private void addIntoView(final GridResource resource) { if (wouldBePosition < 0) { viewList.add(-wouldBePosition - 1, resource); } else { - // If the "would be" position is positive, this means that the resource is already contained in the list, + // If the "would-be" position is positive, this means that the resource is already contained in the list, // comparing with sorting rules. // This doesn't mean that the *exact* resource is already in the list, but that is purely "contained" // in the list when comparing with sorting rules. diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java index e6e5647d5..260bbc6da 100644 --- a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java @@ -41,6 +41,7 @@ void setUp() { class InsertTest { @ParameterizedTest @EnumSource(GridInsertMode.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldInsertIntoDestination(final GridInsertMode insertMode) { // Arrange final Storage source = new LimitedStorageImpl(100); @@ -120,6 +121,7 @@ void shouldNotInsertIntoDestinationWhenNoSpaceIsPresentInDestination(final GridI @Nested class InsertEntireResourceTest { @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldInsertIntoDestinationWithRemainder() { // Arrange final Storage source = new LimitedStorageImpl(100); @@ -192,6 +194,7 @@ public long extract(final ResourceKey resource, class ExtractTest { @ParameterizedTest @EnumSource(GridExtractMode.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldExtractFromSourceToDestination(final GridExtractMode extractMode) { // Arrange final Storage destination = new LimitedStorageImpl(100); @@ -272,6 +275,7 @@ void shouldNotExtractFromSourceIfThereIsNoSpaceInDestination(final GridExtractMo @Nested class ExtractEntireResourceTest { @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldExtractEntireResourceFromSourceToDestinationIfResourceIsLessThanMaxCount() { // Arrange final Storage destination = new LimitedStorageImpl(100); @@ -296,6 +300,7 @@ void shouldExtractEntireResourceFromSourceToDestinationIfResourceIsLessThanMaxCo } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldExtractEntireResourceWithRemainderFromSourceToDestinationIfThereIsNotEnoughSpaceInDestination() { // Arrange final Storage destination = new LimitedStorageImpl(MAX_COUNT - 1); @@ -325,6 +330,7 @@ void shouldExtractEntireResourceWithRemainderFromSourceToDestinationIfThereIsNot @Nested class ExtractHalfResourceTest { @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldExtractSingleAmountIfResourceHasSingleAmountWhenExtractingHalfResourceFromSourceToDestination() { // Arrange final Storage destination = new LimitedStorageImpl(MAX_COUNT); diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/package-info.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/package-info.java new file mode 100644 index 000000000..7a3c634f8 --- /dev/null +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage.api.grid.service; + +import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java index 32679b515..3c3c52029 100644 --- a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java +++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java @@ -28,8 +28,12 @@ class GridViewImplTest { @BeforeEach void setUp() { - viewBuilder = new GridViewBuilderImpl( - resourceAmount -> Optional.of(new GridResourceImpl(resourceAmount)), + viewBuilder = getViewBuilder(resourceAmount -> Optional.of(new GridResourceImpl(resourceAmount))); + } + + private static GridViewBuilderImpl getViewBuilder(final GridResourceFactory resourceFactory) { + return new GridViewBuilderImpl( + resourceFactory, view -> Comparator.comparing(GridResource::getName), view -> Comparator.comparing(GridResource::getAmount) ); @@ -42,10 +46,8 @@ void shouldAddResourcesWithSameNameButDifferentIdentity() { // in the view, but actually isn't because it has a different identity. // Arrange - final GridViewBuilder builder = new GridViewBuilderImpl( - resourceAmount -> Optional.of(new GridResourceWithMetadata(resourceAmount)), - view -> Comparator.comparing(GridResource::getName), - view -> Comparator.comparing(GridResource::getAmount) + final GridViewBuilder builder = getViewBuilder( + resourceAmount -> Optional.of(new GridResourceWithMetadata(resourceAmount)) ); final GridView view = builder.build(); @@ -92,6 +94,7 @@ void shouldPreserveOrderWhenSortingAndTwoResourcesHaveTheSameQuantity() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldLoadResourcesAndRetrieveTrackedResourcesProperly() { // Arrange final GridView view = viewBuilder @@ -344,6 +347,7 @@ void shouldNotReorderExistingResourceWhenPreventingSorting() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldUpdateTrackedResourceAfterReceivingChange() { // Act final GridView view = viewBuilder.build(); diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java index 0f93e29c4..107dec96e 100644 --- a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java +++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java @@ -1,14 +1,11 @@ package com.refinedmods.refinedstorage.api.network.security; -import java.util.Collections; import java.util.Set; import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5") public record SecurityPolicy(Set allowedPermissions) { - public static final SecurityPolicy EMPTY = new SecurityPolicy(Collections.emptySet()); - public static SecurityPolicy of(final Permission... permissions) { return new SecurityPolicy(Set.of(permissions)); } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java index 3e9a33b7a..4821e31db 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java @@ -150,7 +150,6 @@ private void addNetworkNode(final Object testInstance, final Field field) { final Class type = field.getType(); final Map properties = getProperties(annotation.properties()); final NetworkNode resolvedNode = networkNodeFactories.get(type).create( - annotation, properties ); final Network network = networkMap.get(annotation.networkId()); diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java index 3f39a02c6..a044859b5 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @@ -11,8 +10,8 @@ public abstract class AbstractNetworkNodeFactory implements NetworkNodeFactory { public static final String PROPERTY_ENERGY_USAGE = "energy_usage"; @Override - public final NetworkNode create(final AddNetworkNode ctx, final Map properties) { - final AbstractNetworkNode value = innerCreate(ctx, properties); + public final NetworkNode create(final Map properties) { + final AbstractNetworkNode value = innerCreate(properties); final boolean active = (boolean) properties.getOrDefault(PROPERTY_ACTIVE, true); value.setActive(active); return value; @@ -22,5 +21,5 @@ protected final long getEnergyUsage(final Map properties) { return (long) properties.getOrDefault(PROPERTY_ENERGY_USAGE, 0L); } - protected abstract AbstractNetworkNode innerCreate(AddNetworkNode ctx, Map properties); + protected abstract AbstractNetworkNode innerCreate(Map properties); } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java index cc1abcb17..ab829a9a3 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ControllerNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new ControllerNetworkNode(); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java index 3b6f64a86..088ef6d64 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class DetectorNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new DetectorNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java index b20ec5adb..2e3cfe784 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ExporterNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new ExporterNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java index 711c734c9..97837394a 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java @@ -3,13 +3,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode; import com.refinedmods.refinedstorage.api.storage.tracked.InMemoryTrackedStorageRepository; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ExternalStorageNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { final ExternalStorageNetworkNode externalStorage = new ExternalStorageNetworkNode( getEnergyUsage(properties), () -> 0L diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java index d883b3dc9..218bb94e1 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class GridNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new GridNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java index 140166c81..2b2a3a056 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class ImporterNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new ImporterNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java index df491a059..6f9217a2c 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class InterfaceNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new InterfaceNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java index aac0d307e..5606df0ab 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java @@ -1,11 +1,10 @@ package com.refinedmods.refinedstorage.network.test.nodefactory; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @FunctionalInterface public interface NetworkNodeFactory { - NetworkNode create(AddNetworkNode ctx, Map properties); + NetworkNode create(Map properties); } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java index 704abcefa..f996b4f7b 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayInputNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class RelayInputNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new RelayInputNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java index 60305e8f2..faf146960 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class RelayOutputNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new RelayOutputNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java index cc59936b1..e8e6b5c3d 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java @@ -2,13 +2,12 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; public class SimpleNetworkNodeFactory extends AbstractNetworkNodeFactory { @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { return new SimpleNetworkNode(getEnergyUsage(properties)); } } diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java index e36cc4722..d817112ad 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @@ -11,7 +10,7 @@ public class StorageNetworkNodeFactory extends AbstractNetworkNodeFactory { public static final String PROPERTY_SIZE = "size"; @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { final long energyUsagePerStorage = (long) properties.getOrDefault(PROPERTY_ENERGY_USAGE_PER_STORAGE, 0L); final int size = (int) properties.getOrDefault(PROPERTY_SIZE, 9); return new StorageNetworkNode( diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java index 31405d6c0..6539531a3 100644 --- a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java +++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode; -import com.refinedmods.refinedstorage.network.test.AddNetworkNode; import java.util.Map; @@ -11,7 +10,7 @@ public class StorageTransferNetworkNodeFactory extends AbstractNetworkNodeFactor public static final String PROPERTY_SIZE = "size"; @Override - protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, final Map properties) { + protected AbstractNetworkNode innerCreate(final Map properties) { final long energyUsagePerStorage = (long) properties.getOrDefault(PROPERTY_ENERGY_USAGE_PER_STORAGE, 0L); final int size = (int) properties.getOrDefault(PROPERTY_SIZE, 6); return new StorageTransferNetworkNode( diff --git a/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java index 32a428b98..e28daaa0e 100644 --- a/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java +++ b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java @@ -36,6 +36,7 @@ class NetworkTestExtensionTest { }) StorageNetworkNode storageInA; + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(networkId = "b", properties = { @AddNetworkNode.Property(key = AbstractNetworkNodeFactory.PROPERTY_ACTIVE, boolValue = false) }) diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java index 987e4d235..e31c5234f 100644 --- a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java +++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java @@ -3,8 +3,8 @@ public final class NetworkNodeContainerPriorities { /** * It is important that the grid has the highest priority when a network split or merge occurs. - * This priority will affect the grids that are part of the a) newly created network for a split and - * b) removed network in case of a merge. + * This priority will affect the grids that are part of the 1) newly created network for a split and + * 2) removed network in case of a merge. * For a network split, this will ensure that the grid will be able to invalidate all its watchers first and attach * to the newly created network. * After that, all the storages will be re-added into the newly created network. diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java index 06c4656de..b1baf2c3f 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java @@ -4,6 +4,7 @@ import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.NetworkBuilder; import com.refinedmods.refinedstorage.api.network.NetworkComponent; +import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage.api.network.node.NetworkNode; import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer; import com.refinedmods.refinedstorage.network.test.NetworkTestFixtures; @@ -74,7 +75,7 @@ protected static NetworkNodeContainer createContainer() { } private static NetworkNode createNode() { - return new SpyingNetworkNode(0); + return new SimpleNetworkNode(0); } protected static List getAddedContainers(final Network network) { diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java index 0906e28a3..de75b6b9b 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java @@ -122,7 +122,7 @@ void shouldSplitNetworkInTwo() { final List> splits = getNetworkSplits(container4.getNode().getNetwork()); assertThat(splits).hasSize(1); - assertThat(splits.get(0)).containsExactlyInAnyOrder(container1.getNode().getNetwork()); + assertThat(splits.getFirst()).containsExactlyInAnyOrder(container1.getNode().getNetwork()); assertThat(getAddedContainers(container4.getNode().getNetwork())) .containsExactlyInAnyOrder(container1, container2, container3, container4, container5); @@ -197,7 +197,7 @@ void shouldSplitNetworkInThree() { final List> splits = getNetworkSplits(container4.getNode().getNetwork()); assertThat(splits).hasSize(1); - assertThat(splits.get(0)) + assertThat(splits.getFirst()) .containsExactlyInAnyOrder(container2.getNode().getNetwork(), container3.getNode().getNetwork()); assertThat(getAddedContainers(container4.getNode().getNetwork())) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java deleted file mode 100644 index 2293aebdc..000000000 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.refinedmods.refinedstorage.api.network.impl; - -import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; - -public final class SpyingNetworkNode extends AbstractNetworkNode { - private final long energyUsage; - private int activenessChanges; - - public SpyingNetworkNode(final long energyUsage) { - this.energyUsage = energyUsage; - } - - @Override - protected void onActiveChanged(final boolean newActive) { - super.onActiveChanged(newActive); - activenessChanges++; - } - - public int getActivenessChanges() { - return activenessChanges; - } - - @Override - public long getEnergyUsage() { - return energyUsage; - } -} diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java index cdb7cd507..fa636efdf 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java @@ -16,6 +16,7 @@ @NetworkTest @SetupNetwork(energyStored = 10, energyCapacity = 100) class SimpleNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = 10), @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java index 0c249d982..ea89e9214 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java @@ -31,6 +31,7 @@ protected TaskExecutor createTaskExecutor() { return new DefaultTaskExecutor<>(); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @Test void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) { // Arrange diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java index 0abc32032..a04702497 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java @@ -466,6 +466,7 @@ void shouldNoLongerShowOnNetworkWhenRemovedWithoutInitializedStorage( assertThat(networkStorage.getAll()).isEmpty(); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @ParameterizedTest @EnumSource(Action.class) void shouldTrackChangesWhenExtracting( @@ -526,6 +527,7 @@ void shouldNotTrackChangesWhenExtractionFailed( assertThat(trackedResource).isEmpty(); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @ParameterizedTest @EnumSource(Action.class) void shouldTrackChangesWhenInserting( diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java index 9ac83d57d..99c619d3e 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java @@ -30,6 +30,7 @@ @SetupNetwork(id = "input") @SetupNetwork(id = "output", setupEnergy = false) class RelayEnergyNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) }, networkId = "input") diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java index 0655d2a1a..3c766ecf3 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java @@ -42,6 +42,7 @@ class RelayNetworkNodeTest { private static final long INPUT_ENERGY_USAGE = 5; private static final long OUTPUT_ENERGY_USAGE = 5; + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = INPUT_ENERGY_USAGE), @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java index 739b24d01..c07572fb3 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java @@ -32,6 +32,7 @@ @SetupNetwork(id = "input") @SetupNetwork(id = "output", setupEnergy = false) class RelaySecurityNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) }, networkId = "input") diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java index c1aaf57ec..12464d396 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java @@ -39,6 +39,7 @@ @SetupNetwork(id = "input") @SetupNetwork(id = "output", setupEnergy = false) class RelayStorageNetworkNodeTest { + @SuppressWarnings("DefaultAnnotationParam") @AddNetworkNode(properties = { @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false) }, networkId = "input") diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java index c27a7eac1..b7045a0e6 100644 --- a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java +++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java @@ -270,14 +270,14 @@ void shouldNotUpdateNetworkStorageWhenChangingStorageWhenInactive( initializeAndActivate(); // Act - final Collection preInactiveness = new HashSet<>(networkStorage.getAll()); + final Collection preInactive = new HashSet<>(networkStorage.getAll()); sut.setActive(false); sut.onStorageChanged(1); - final Collection postInactiveness = networkStorage.getAll(); + final Collection postInactive = networkStorage.getAll(); // Assert - assertThat(preInactiveness).isNotEmpty(); - assertThat(postInactiveness).isEmpty(); + assertThat(preInactive).isNotEmpty(); + assertThat(postInactive).isEmpty(); assertThat(networkStorage.getStored()).isZero(); } diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java index e7a00ae74..a95741c8b 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java @@ -42,7 +42,6 @@ import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; @@ -110,8 +109,6 @@ public interface PlatformApi { UpgradeRegistry getUpgradeRegistry(); - BuiltinUpgradeDestinations getBuiltinUpgradeDestinations(); - InWorldNetworkNodeContainer createInWorldNetworkNodeContainer(BlockEntity blockEntity, NetworkNode node, String name, diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java index 76687e2f7..2b2116e60 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApiProxy.java @@ -42,7 +42,6 @@ import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; @@ -176,11 +175,6 @@ public UpgradeRegistry getUpgradeRegistry() { return ensureLoaded().getUpgradeRegistry(); } - @Override - public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { - return ensureLoaded().getBuiltinUpgradeDestinations(); - } - @Override public InWorldNetworkNodeContainer createInWorldNetworkNodeContainer( final BlockEntity blockEntity, diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java index 6640be2b1..7ecbe81eb 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/GridSynchronizer.java @@ -13,6 +13,7 @@ public interface GridSynchronizer { Component getHelpText(); + @SuppressWarnings("EmptyMethod") void synchronizeFromGrid(String text); @Nullable diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java index 348934ca5..b2e0011f7 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/AbstractPlatformGridResource.java @@ -3,7 +3,6 @@ import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey; import com.refinedmods.refinedstorage.api.grid.view.GridView; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage.api.resource.ResourceKey; import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource; import java.util.Collections; @@ -28,13 +27,9 @@ protected AbstractPlatformGridResource(final ResourceAmount resourceAmount, this.attributes = attributes; } - public ResourceKey getResource() { - return resourceAmount.getResource(); - } - @Override public Optional getTrackedResource(final GridView view) { - return view.getTrackedResource(getResource()); + return view.getTrackedResource(resourceAmount.getResource()); } @Override diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java index 5b61c320a..5bbdf86b3 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/grid/view/PlatformGridResource.java @@ -41,5 +41,6 @@ void onScroll(GridScrollMode scrollMode, List getExtractionHints(); @Nullable + @API(status = API.Status.INTERNAL) PlatformResourceKey getUnderlyingResource(); } diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java index 7ed1658f3..ca9780374 100644 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java +++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/support/resource/ResourceType.java @@ -8,7 +8,6 @@ import java.util.Optional; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.MutableComponent; @@ -20,8 +19,6 @@ public interface ResourceType { MapCodec getMapCodec(); - Codec getCodec(); - StreamCodec getStreamCodec(); MutableComponent getTitle(); diff --git a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/BuiltinUpgradeDestinations.java b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/BuiltinUpgradeDestinations.java deleted file mode 100644 index 0f824e073..000000000 --- a/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/upgrade/BuiltinUpgradeDestinations.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.refinedmods.refinedstorage.platform.api.upgrade; - -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") -public interface BuiltinUpgradeDestinations { - UpgradeDestination getImporter(); - - UpgradeDestination getExporter(); - - UpgradeDestination getDestructor(); - - UpgradeDestination getConstructor(); - - UpgradeDestination getWirelessTransmitter(); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java index 7262179d5..43969db56 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/Platform.java @@ -104,7 +104,7 @@ List processTooltipComponents( ItemStack stack, GuiGraphics graphics, int mouseX, - Optional imageComponent, + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") Optional imageComponent, List components ); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java index b5115a5d1..4230c39e5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/PlatformApiImpl.java @@ -47,7 +47,6 @@ import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReference; import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceFactory; import com.refinedmods.refinedstorage.platform.api.support.slotreference.SlotReferenceProvider; -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage.platform.common.grid.NoopGridSynchronizer; @@ -78,7 +77,6 @@ import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResourceFactory; import com.refinedmods.refinedstorage.platform.common.support.slotreference.CompositeSlotReferenceProvider; import com.refinedmods.refinedstorage.platform.common.support.slotreference.InventorySlotReference; -import com.refinedmods.refinedstorage.platform.common.upgrade.BuiltinUpgradeDestinationsImpl; import com.refinedmods.refinedstorage.platform.common.upgrade.UpgradeRegistryImpl; import com.refinedmods.refinedstorage.platform.common.util.ServerEventQueue; import com.refinedmods.refinedstorage.platform.common.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; @@ -136,7 +134,6 @@ public class PlatformApiImpl implements PlatformApi { private final PlatformRegistry exporterTransferStrategyRegistry = new PlatformRegistryImpl<>(); private final UpgradeRegistry upgradeRegistry = new UpgradeRegistryImpl(); - private final BuiltinUpgradeDestinations builtinUpgradeDestinations = new BuiltinUpgradeDestinationsImpl(); private final Queue externalStorageProviderFactories = new PriorityQueue<>( Comparator.comparingInt(PlatformExternalStorageProviderFactory::getPriority) ); @@ -283,11 +280,6 @@ public UpgradeRegistry getUpgradeRegistry() { return upgradeRegistry; } - @Override - public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { - return builtinUpgradeDestinations; - } - @Override public InWorldNetworkNodeContainer createInWorldNetworkNodeContainer( final BlockEntity blockEntity, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java index 4cf94ebaa..9ee6ccfd9 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/configurationcard/ConfigurationCardItem.java @@ -113,6 +113,7 @@ private CompoundTag createConfigTag(final ConfigurationCardTarget target, final return tag; } + @SuppressWarnings("resource") private void sendCopiedConfigurationMessage(final Player player, final BlockEntityType configuredType) { if (player.level().isClientSide()) { return; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java index 30d356e43..ce2c3463e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/AbstractItemConstructorStrategy.java @@ -50,19 +50,14 @@ public final boolean apply( return false; } final ItemStack itemStack = itemResource.toItemStack(extractedAmount); - final boolean success = apply(itemResource, itemStack, actor, actingPlayer); + final boolean success = apply(itemStack, actor, actingPlayer); if (success) { storageChannel.extract(itemResource, extractedAmount, Action.EXECUTE, actor); } return success; } - protected abstract boolean apply( - ItemResource itemResource, - ItemStack itemStack, - Actor actor, - Player actingPlayer - ); + protected abstract boolean apply(ItemStack itemStack, Actor actor, Player actingPlayer); protected double getDispensePositionX() { return pos.getX() + 0.5D; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java index 5d531c896..bd39c7125 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/ItemDropConstructorStrategy.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage.platform.common.constructordestructor; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -30,12 +29,7 @@ protected long getTransferAmount() { } @Override - protected boolean apply( - final ItemResource itemResource, - final ItemStack itemStack, - final Actor actor, - final Player actingPlayer - ) { + protected boolean apply(final ItemStack itemStack, final Actor actor, final Player actingPlayer) { final Vec3 position = new Vec3( getDispensePositionX(), getDispensePositionY(), diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java index fc9a8800c..ca95da0a8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.platform.common.Platform; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -21,12 +20,7 @@ public PlaceBlockConstructorStrategy( } @Override - protected boolean apply( - final ItemResource itemResource, - final ItemStack itemStack, - final Actor actor, - final Player actingPlayer - ) { + protected boolean apply(final ItemStack itemStack, final Actor actor, final Player actingPlayer) { if (!(itemStack.getItem() instanceof BlockItem)) { return false; } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java index 52477ba8d..0d6c2d4a6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage.platform.common.constructordestructor; import com.refinedmods.refinedstorage.api.storage.Actor; -import com.refinedmods.refinedstorage.platform.common.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -21,12 +20,7 @@ public PlaceFireworksConstructorStrategy( } @Override - protected boolean apply( - final ItemResource itemResource, - final ItemStack itemStack, - final Actor actor, - final Player actingPlayer - ) { + protected boolean apply(final ItemStack itemStack, final Actor actor, final Player actingPlayer) { if (!(itemStack.getItem() instanceof FireworkRocketItem)) { return false; } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java index c6869cef2..eee8dc9f2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlock.java @@ -90,7 +90,6 @@ public MutableComponent getName() { } @Override - @SuppressWarnings("deprecation") public VoxelShape getShape(final BlockState state, final BlockGetter world, final BlockPos pos, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java index 2e2a5bdf8..f6a077423 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorBlockEntity.java @@ -60,7 +60,7 @@ public DetectorBlockEntity(final BlockPos pos, final BlockState state) { propagateAmount(); setChanged(); }, - filters -> mainNode.setConfiguredResource(filters.isEmpty() ? null : filters.get(0)) + filters -> mainNode.setConfiguredResource(filters.isEmpty() ? null : filters.getFirst()) ); initialize(); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java index 6fe841c54..5b768fc82 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/detector/DetectorModeSettings.java @@ -13,7 +13,6 @@ private DetectorModeSettings() { static DetectorMode getDetectorMode(final int detectorMode) { return switch (detectorMode) { case UNDER -> DetectorMode.UNDER; - case EQUAL -> DetectorMode.EQUAL; case ABOVE -> DetectorMode.ABOVE; default -> DetectorMode.EQUAL; }; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java index 01493deeb..7d08ef691 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/AbstractGridContainerMenu.java @@ -404,6 +404,7 @@ public boolean onTransfer(final int slotIndex) { throw new UnsupportedOperationException(); } + @SuppressWarnings("resource") @Override public ItemStack quickMoveStack(final Player playerEntity, final int slotIndex) { if (!playerEntity.level().isClientSide() && grid != null && grid.isGridActive()) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java index cc6e73b46..b8bc7740b 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridContainerMenu.java @@ -23,6 +23,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; public class CraftingGridContainerMenu extends AbstractGridContainerMenu { private static final int Y_OFFSET_BETWEEN_PLAYER_INVENTORY_AND_FIRST_CRAFTING_MATRIX_SLOT = 69; @@ -78,6 +79,7 @@ public boolean canTakeItemForPickAll(final ItemStack stack, final Slot slot) { } @Override + @SuppressWarnings("resource") public ItemStack quickMoveStack(final Player actor, final int slotIndex) { final Slot slot = getSlot(slotIndex); if (!actor.level().isClientSide() && slot instanceof CraftingGridResultSlot resultSlot) { @@ -117,6 +119,7 @@ public void clear(final boolean toPlayerInventory) { source.clearMatrix(player, toPlayerInventory); } + @API(status = API.Status.INTERNAL) public ResourceList getAvailableListForRecipeTransfer() { final ResourceList available = getView().copyBackingList(); addContainerToList(source.getCraftingMatrix(), available); @@ -142,7 +145,8 @@ public void filterBasedOnCraftingMatrixItems() { final Set craftingMatrixItems = getCraftingMatrixItems(); filterBeforeFilteringBasedOnCraftingMatrixItems = getView().setFilterAndSort( gridResource -> gridResource instanceof ItemGridResource itemGridResource - && craftingMatrixItems.contains(itemGridResource.getResource()) + && itemGridResource.getUnderlyingResource() != null + && craftingMatrixItems.contains((ItemResource) itemGridResource.getUnderlyingResource()) ); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java index db7c3bb30..72eda3aaa 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/CraftingGridResultSlot.java @@ -23,6 +23,7 @@ class CraftingGridResultSlot extends ResultSlot { this.source = source; } + @SuppressWarnings("resource") public ItemStack onQuickCraft(final Player player) { if (!hasItem() || player.level().isClientSide()) { return ItemStack.EMPTY; @@ -40,6 +41,7 @@ public ItemStack onQuickCraft(final Player player) { } @Override + @SuppressWarnings("resource") public void onTake(final Player player, final ItemStack stack) { if (player.level().isClientSide()) { return; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java index ccecea0d8..1f05da3bd 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/grid/screen/AbstractGridScreen.java @@ -8,7 +8,6 @@ import com.refinedmods.refinedstorage.platform.api.PlatformApi; import com.refinedmods.refinedstorage.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage.platform.api.grid.view.PlatformGridResource; -import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; import com.refinedmods.refinedstorage.platform.common.Platform; import com.refinedmods.refinedstorage.platform.common.grid.AbstractGridContainerMenu; import com.refinedmods.refinedstorage.platform.common.grid.NoopGridSynchronizer; @@ -36,6 +35,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -354,6 +354,7 @@ private boolean isModifiedJustNow(final LastModified lastModified) { && lastModified.amount() <= MODIFIED_JUST_NOW_MAX_SECONDS; } + @API(status = API.Status.INTERNAL) @Nullable public PlatformGridResource getCurrentGridResource() { if (currentGridSlotIndex < 0) { @@ -366,12 +367,6 @@ public PlatformGridResource getCurrentGridResource() { return (PlatformGridResource) viewList.get(currentGridSlotIndex); } - @Nullable - public PlatformResourceKey getCurrentResource() { - final PlatformGridResource resource = getCurrentGridResource(); - return resource != null ? resource.getUnderlyingResource() : null; - } - @Override public void render(final GuiGraphics graphics, final int mouseX, final int mouseY, final float partialTicks) { super.render(graphics, mouseX, mouseY, partialTicks); @@ -509,7 +504,7 @@ public boolean charTyped(final char unknown1, final int unknown2) { @Override public boolean keyPressed(final int key, final int scanCode, final int modifiers) { - // First do the prevent sorting. + // First check if we have to prevent sorting. // Order matters. In auto-selected mode, the search field will swallow the SHIFT key. if (hasShiftDown() && Platform.INSTANCE.getConfig().getGrid().isPreventSortingWhileShiftIsDown()) { getMenu().getView().setPreventSorting(true); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java index 7e15780d1..b2f172125 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/networking/CableBlock.java @@ -65,7 +65,6 @@ public boolean propagatesSkylightDown(final BlockState state, final BlockGetter } @Override - @SuppressWarnings("deprecation") public FluidState getFluidState(final BlockState state) { return Boolean.TRUE.equals(state.getValue(BlockStateProperties.WATERLOGGED)) ? Fluids.WATER.getSource(false) @@ -73,7 +72,6 @@ public FluidState getFluidState(final BlockState state) { } @Override - @SuppressWarnings("deprecation") public BlockState updateShape(final BlockState state, final Direction direction, final BlockState newState, @@ -100,7 +98,6 @@ protected void createBlockStateDefinition(final StateDefinition.Builder AccessMode.INSERT_EXTRACT; case INSERT -> AccessMode.INSERT; case EXTRACT -> AccessMode.EXTRACT; default -> AccessMode.INSERT_EXTRACT; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java index 3f0419cb8..da39340a3 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/diskinterface/TransferModeSettings.java @@ -10,11 +10,10 @@ private TransferModeSettings() { } static StorageTransferMode getTransferMode(final int transferMode) { - return switch (transferMode) { - case INSERT_INTO_NETWORK -> StorageTransferMode.INSERT_INTO_NETWORK; - case EXTRACT_FROM_NETWORK -> StorageTransferMode.EXTRACT_FROM_NETWORK; - default -> StorageTransferMode.INSERT_INTO_NETWORK; - }; + if (transferMode == EXTRACT_FROM_NETWORK) { + return StorageTransferMode.EXTRACT_FROM_NETWORK; + } + return StorageTransferMode.INSERT_INTO_NETWORK; } static int getTransferMode(final StorageTransferMode transferMode) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java index 08b98f9a2..7244916c6 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlock.java @@ -71,7 +71,6 @@ public BlockEntityTicker getTicker(final Level level, } @Override - @SuppressWarnings("deprecation") public void neighborChanged(final BlockState state, final Level level, final BlockPos pos, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java index 40f7fb483..5c2c6c4f5 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java @@ -67,7 +67,6 @@ public ExternalStorageBlockEntity(final BlockPos pos, final BlockState state) { } @Override - @SuppressWarnings("deprecation") public void setBlockState(final BlockState newBlockState) { super.setBlockState(newBlockState); if (level instanceof ServerLevel serverLevel) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java index ff77977c4..fe0c4df6a 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storage/portablegrid/PortableGridBlock.java @@ -61,7 +61,6 @@ protected DirectionType getDirectionType() { } @Override - @SuppressWarnings("deprecation") public VoxelShape getShape(final BlockState state, final BlockGetter level, final BlockPos pos, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java index 92f42ab05..1fdbd1fc7 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java @@ -13,7 +13,6 @@ public class ItemStorageMonitorExtractionStrategy implements StorageMonitorExtractionStrategy { @Override - @SuppressWarnings("deprecation") public boolean extract(final ResourceKey resource, final boolean fullStack, final Player player, diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java index ea1603d7e..1af6df35f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/storagemonitor/StorageMonitorBlock.java @@ -80,7 +80,6 @@ protected ItemInteractionResult useItemOn(final ItemStack stack, } @Override - @SuppressWarnings("deprecation") public void attack(final BlockState state, final Level level, final BlockPos pos, final Player player) { super.attack(state, level, pos, player); if (level.isClientSide()) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java index db3599dbd..654261089 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseBlock.java @@ -104,14 +104,12 @@ private void tryOpenScreen(final ServerPlayer player, final MenuProvider menuPro } @Override - @SuppressWarnings("deprecation") public MenuProvider getMenuProvider(final BlockState state, final Level level, final BlockPos pos) { final BlockEntity blockEntity = level.getBlockEntity(pos); return blockEntity instanceof MenuProvider provider ? provider : null; } @Override - @SuppressWarnings("deprecation") public void onRemove(final BlockState state, final Level level, final BlockPos pos, @@ -203,7 +201,6 @@ private boolean rotate(final BlockState state, return !state.equals(rotated); } - @SuppressWarnings("deprecation") protected BlockState getRotatedBlockState(final BlockState state, final Level level, final BlockPos pos) { return state.rotate(Rotation.CLOCKWISE_90); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java index 32e51cb6a..73100def1 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractBaseScreen.java @@ -34,6 +34,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; +import org.apiguardian.api.API; import static com.refinedmods.refinedstorage.platform.common.util.IdentifierUtil.createTranslationAsHeading; import static java.util.Objects.requireNonNullElse; @@ -171,6 +172,7 @@ public void addSideButton(final AbstractSideButtonWidget button) { addRenderableWidget(button); } + @API(status = API.Status.INTERNAL) public List getExclusionZones() { return exclusionZones; } @@ -315,6 +317,7 @@ private boolean tryOpenResourceAmountScreen(final ResourceSlot slot) { } @Nullable + @API(status = API.Status.INTERNAL) public PlatformResourceKey getHoveredResource() { if (hoveredSlot instanceof ResourceSlot resourceSlot) { return resourceSlot.getResource(); @@ -322,10 +325,12 @@ public PlatformResourceKey getHoveredResource() { return null; } + @API(status = API.Status.INTERNAL) public int getLeftPos() { return leftPos; } + @API(status = API.Status.INTERNAL) public int getTopPos() { return topPos; } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java index f35442e7e..a419bb3d8 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractDirectionalCableBlock.java @@ -52,7 +52,6 @@ public boolean propagatesSkylightDown(final BlockState state, final BlockGetter } @Override - @SuppressWarnings("deprecation") public FluidState getFluidState(final BlockState state) { return Boolean.TRUE.equals(state.getValue(BlockStateProperties.WATERLOGGED)) ? Fluids.WATER.getSource(false) @@ -60,7 +59,6 @@ public FluidState getFluidState(final BlockState state) { } @Override - @SuppressWarnings("deprecation") public BlockState updateShape(final BlockState state, final Direction direction, final BlockState newState, @@ -100,7 +98,6 @@ protected void createBlockStateDefinition(final StateDefinition.Builder> recipe); - - void sendPropertyChange(PropertyType type, T value); - - void sendStorageInfoRequest(UUID storageId); - - void sendResourceSlotChange(int slotIndex, boolean tryAlternatives); - - void sendResourceFilterSlotChange(PlatformResourceKey resource, int slotIndex); - - void sendResourceSlotAmountChange(int slotIndex, long amount); - - void sendSingleAmountChange(double amount); - - void sendUseNetworkBoundItem(SlotReference slotReference); - - void sendSecurityCardPermission(PlatformPermission permission, boolean allowed); - - void sendSecurityCardResetPermission(PlatformPermission permission); - - void sendSecurityCardBoundPlayer(UUID playerId); -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java index 91047d61f..1c42e23b2 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/FilterModeSettings.java @@ -10,11 +10,10 @@ private FilterModeSettings() { } public static FilterMode getFilterMode(final int filterMode) { - return switch (filterMode) { - case BLOCK -> FilterMode.BLOCK; - case ALLOW -> FilterMode.ALLOW; - default -> FilterMode.BLOCK; - }; + if (filterMode == ALLOW) { + return FilterMode.ALLOW; + } + return FilterMode.BLOCK; } public static int getFilterMode(final FilterMode filterMode) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java index b54098c8c..7db3531ed 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/RedstoneModeSettings.java @@ -10,7 +10,6 @@ private RedstoneModeSettings() { public static RedstoneMode getRedstoneMode(final int redstoneMode) { return switch (redstoneMode) { - case IGNORE -> RedstoneMode.IGNORE; case HIGH -> RedstoneMode.HIGH; case LOW -> RedstoneMode.LOW; default -> RedstoneMode.IGNORE; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java index 16045b705..d33692c79 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java @@ -28,7 +28,6 @@ protected AbstractLevelInteractingNetworkNodeContainerBlockEntity( // used to handle rotations @Override - @SuppressWarnings("deprecation") public void setBlockState(final BlockState newBlockState) { super.setBlockState(newBlockState); if (!(level instanceof ServerLevel serverLevel)) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java index d8fc7e9a1..131bdfdfb 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java @@ -53,6 +53,7 @@ public Optional resolveNetwork() { .filter(this::isInRange); } + @SuppressWarnings("resource") private boolean isInRange(final Network network) { return network.getComponent(GraphNetworkComponent.class) .getContainers(WirelessTransmitter.class) diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java index 7575266e7..57cae248f 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/packet/c2s/C2SPackets.java @@ -13,6 +13,8 @@ import java.util.List; import java.util.UUID; +import org.apiguardian.api.API; + public final class C2SPackets { private C2SPackets() { } @@ -53,6 +55,7 @@ public static void sendResourceSlotChange(final int slotIndex, final boolean try Platform.INSTANCE.sendPacketToServer(new ResourceSlotChangePacket(slotIndex, tryAlternatives)); } + @API(status = API.Status.INTERNAL) public static void sendResourceFilterSlotChange(final PlatformResourceKey resource, final int slotIndex) { Platform.INSTANCE.sendPacketToServer(new ResourceFilterSlotChangePacket(slotIndex, resource)); } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java index adae101b7..2bc28eab4 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResource.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.material.Fluid; import org.apiguardian.api.API; -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") +@API(status = API.Status.INTERNAL) public record FluidResource(Fluid fluid, DataComponentPatch components) implements PlatformResourceKey, FuzzyModeNormalizer { public FluidResource(final Fluid fluid) { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java index 089155b26..3786a523e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/FluidResourceType.java @@ -14,7 +14,6 @@ import java.util.Optional; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; @@ -73,12 +72,6 @@ public MapCodec getMapCodec() { return (MapCodec) ResourceCodecs.FLUID_MAP_CODEC; } - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public Codec getCodec() { - return (Codec) ResourceCodecs.FLUID_CODEC; - } - @Override @SuppressWarnings({"unchecked", "rawtypes"}) public StreamCodec getStreamCodec() { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java index 52f987d1f..18d38fa22 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResource.java @@ -13,7 +13,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") +@API(status = API.Status.INTERNAL) public record ItemResource(Item item, DataComponentPatch components) implements PlatformResourceKey, FuzzyModeNormalizer { private static final Logger LOGGER = LoggerFactory.getLogger(ItemResource.class); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java index 88fb86469..bd34688f0 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ItemResourceType.java @@ -14,7 +14,6 @@ import java.util.Optional; -import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; @@ -75,12 +74,6 @@ public MapCodec getMapCodec() { return (MapCodec) ResourceCodecs.ITEM_MAP_CODEC; } - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public Codec getCodec() { - return (Codec) ResourceCodecs.ITEM_CODEC; - } - @Override @SuppressWarnings({"unchecked", "rawtypes"}) public StreamCodec getStreamCodec() { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java index e7022129b..254da8a1c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/ResourceContainerSlot.java @@ -2,7 +2,6 @@ import com.refinedmods.refinedstorage.api.resource.ResourceAmount; import com.refinedmods.refinedstorage.platform.api.support.resource.PlatformResourceKey; -import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType; import java.util.Objects; @@ -19,10 +18,6 @@ class ResourceContainerSlot { : ItemStack.EMPTY; } - long getAmount() { - return resourceAmount.getAmount(); - } - ResourceAmount getResourceAmount() { return resourceAmount; } @@ -31,10 +26,6 @@ PlatformResourceKey getPlatformResource() { return (PlatformResourceKey) resourceAmount.getResource(); } - ResourceType getResourceType() { - return getPlatformResource().getResourceType(); - } - ItemStack getStackRepresentation() { return stackRepresentation; } diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java index c7f354030..14890b604 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImpl.java @@ -15,9 +15,6 @@ import java.util.Optional; import java.util.Set; -import org.apiguardian.api.API; - -@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4") public class FuzzyResourceListImpl extends AbstractProxyResourceList implements FuzzyResourceList { private final Map> normalizedFuzzyMap = new HashMap<>(); diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java index 1c912088f..85251b476 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/History.java @@ -16,14 +16,13 @@ public String older() { } if (index == -1) { index = items.size() - 1; - return items.get(index); } else { index--; if (index < 0) { index = 0; } - return items.get(index); } + return items.get(index); } public String newer() { diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java index e7c6a7b70..bd6e2a501 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/widget/SearchFieldWidget.java @@ -72,7 +72,7 @@ private boolean shouldMoveControlToParent(final int keyCode, final boolean canLo saveHistory(); setFocused(false); // If we are autoselected, we need to move control back to the parent straight away. - // If we are not autoselected, we can just unfocus (which will require another ESC press to close). + // If we are not autoselected, we can just lose focus (which will require another ESC press to close). return !canLoseFocus; } return false; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java deleted file mode 100644 index 1b1b501e8..000000000 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.refinedmods.refinedstorage.platform.common.upgrade; - -import com.refinedmods.refinedstorage.platform.api.upgrade.BuiltinUpgradeDestinations; -import com.refinedmods.refinedstorage.platform.api.upgrade.UpgradeDestination; - -public class BuiltinUpgradeDestinationsImpl implements BuiltinUpgradeDestinations { - @Override - public UpgradeDestination getImporter() { - return UpgradeDestinations.IMPORTER; - } - - @Override - public UpgradeDestination getExporter() { - return UpgradeDestinations.EXPORTER; - } - - @Override - public UpgradeDestination getDestructor() { - return UpgradeDestinations.DESTRUCTOR; - } - - @Override - public UpgradeDestination getConstructor() { - return UpgradeDestinations.CONSTRUCTOR; - } - - @Override - public UpgradeDestination getWirelessTransmitter() { - return UpgradeDestinations.WIRELESS_TRANSMITTER; - } -} diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java index a11139476..3a7ba006e 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/RegulatorUpgradeItem.java @@ -130,22 +130,11 @@ public record RegulatorTooltipComponent(Component helpText, @Nullable ResourceAm implements TooltipComponent { } - private static class ExtendedMenuProviderImpl implements ExtendedMenuProvider { - private final ResourceContainer resourceContainer; - private final double amount; - private final Consumer amountAcceptor; - private final SlotReference slotReference; - - private ExtendedMenuProviderImpl(final ResourceContainer resourceContainer, - final double amount, - final Consumer amountAcceptor, - final SlotReference slotReference) { - this.resourceContainer = resourceContainer; - this.amount = amount; - this.amountAcceptor = amountAcceptor; - this.slotReference = slotReference; - } - + private record ExtendedMenuProviderImpl(ResourceContainer resourceContainer, + double amount, + Consumer amountAcceptor, + SlotReference slotReference) + implements ExtendedMenuProvider { @Override public SingleAmountData getMenuData() { return new SingleAmountData( diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java index c33b15098..1bec06e7c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/upgrade/UpgradeDestinations.java @@ -11,13 +11,16 @@ import net.minecraft.world.item.ItemStack; public enum UpgradeDestinations implements UpgradeDestination { - IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().get(0).get())), - EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().get(0).get())), - DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().get(0).get())), - CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())), - WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER, - () -> new ItemStack(Items.INSTANCE.getWirelessTransmitters().get(0).get())), - DISK_INTERFACE(ContentNames.DISK_INTERFACE, () -> new ItemStack(Items.INSTANCE.getDiskInterfaces().get(0).get())); + IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().getFirst().get())), + EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().getFirst().get())), + DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().getFirst().get())), + CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().getFirst().get())), + WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER, () -> new ItemStack( + Items.INSTANCE.getWirelessTransmitters().getFirst().get() + )), + DISK_INTERFACE(ContentNames.DISK_INTERFACE, () -> new ItemStack( + Items.INSTANCE.getDiskInterfaces().getFirst().get() + )); private final Component name; private final Supplier stackFactory; diff --git a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java index 551b26f1d..908ef036c 100644 --- a/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java +++ b/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java @@ -57,7 +57,6 @@ protected DirectionType getDirectionType() { } @Override - @SuppressWarnings("deprecation") public VoxelShape getShape(final BlockState state, final BlockGetter world, final BlockPos pos, diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/nl_nl.json b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/nl_nl.json deleted file mode 100644 index 547960d11..000000000 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/nl_nl.json +++ /dev/null @@ -1,365 +0,0 @@ -{ - "itemGroup.refinedstorage.general": "Refined Storage", - "block.refinedstorage.cable": "Cable", - "block.refinedstorage.quartz_enriched_iron_block": "Block of Quartz Enriched Iron", - "block.refinedstorage.disk_drive": "Disk Drive", - "block.refinedstorage.machine_casing": "Machine Casing", - "block.refinedstorage.grid": "Grid", - "block.refinedstorage.crafting_grid": "Crafting Grid", - "block.refinedstorage.controller": "Controller", - "block.refinedstorage.controller.rei_fully_charged": "Fully charged Controller", - "block.refinedstorage.creative_controller": "Creative Controller", - "block.refinedstorage.1k_storage_block": "1K Storage Block", - "block.refinedstorage.4k_storage_block": "4K Storage Block", - "block.refinedstorage.16k_storage_block": "16K Storage Block", - "block.refinedstorage.64k_storage_block": "64K Storage Block", - "block.refinedstorage.creative_storage_block": "Creative Storage Block", - "block.refinedstorage.64b_fluid_storage_block": "64B Fluid Storage Block", - "block.refinedstorage.256b_fluid_storage_block": "256B Fluid Storage Block", - "block.refinedstorage.1024b_fluid_storage_block": "1024B Fluid Storage Block", - "block.refinedstorage.4096b_fluid_storage_block": "4096B Fluid Storage Block", - "block.refinedstorage.creative_fluid_storage_block": "Creative Fluid Storage Block", - "block.refinedstorage.importer": "Importer", - "block.refinedstorage.exporter": "Exporter", - "block.refinedstorage.interface": "Interface", - "block.refinedstorage.external_storage": "External Storage", - "block.refinedstorage.detector": "Detector", - "block.refinedstorage.constructor": "Constructor", - "block.refinedstorage.destructor": "Destructor", - "block.refinedstorage.wireless_transmitter": "Wireless Transmitter", - "block.refinedstorage.storage_monitor": "Storage Monitor", - "block.refinedstorage.network_receiver": "Network Receiver", - "block.refinedstorage.network_transmitter": "Network Transmitter", - "block.refinedstorage.portable_grid": "Portable Grid", - "block.refinedstorage.creative_portable_grid": "Creative Portable Grid", - "gui.refinedstorage.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", - "gui.refinedstorage.disk_drive.disks": "Disks", - "gui.refinedstorage.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", - "gui.refinedstorage.storage.filter_help": "The resources that may or may not be allowed in this storage, depending if the device is in allowlist or blocklist mode.", - "gui.refinedstorage.storage.filter_mode.empty_warning": "Without any configured filters, no resources will be accepted in this storage.", - "gui.refinedstorage.storage.filter_mode.allow.help": "Only allow resources into this storage that are configured in the filters.", - "gui.refinedstorage.storage.filter_mode.block.help": "Disallow resources into this storage that are configured in the filters.", - "gui.refinedstorage.grid.sorting.direction": "Sorting direction", - "gui.refinedstorage.grid.sorting.direction.ascending": "Ascending", - "gui.refinedstorage.grid.sorting.direction.descending": "Descending", - "gui.refinedstorage.grid.sorting.type": "Sorting type", - "gui.refinedstorage.grid.sorting.type.quantity": "Quantity", - "gui.refinedstorage.grid.sorting.type.name": "Name", - "gui.refinedstorage.grid.sorting.type.id": "ID", - "gui.refinedstorage.grid.sorting.type.last_modified": "Last modified", - "gui.refinedstorage.grid.size": "Size", - "gui.refinedstorage.grid.size.stretch": "Stretch", - "gui.refinedstorage.grid.size.small": "Small", - "gui.refinedstorage.grid.size.medium": "Medium", - "gui.refinedstorage.grid.size.large": "Large", - "gui.refinedstorage.grid.size.extra_large": "Extra large", - "gui.refinedstorage.grid.auto_selected": "Auto-selected", - "gui.refinedstorage.grid.auto_selected.help": "Whether to auto-select the search box when opening the Grid.", - "gui.refinedstorage.grid.synchronizer": "Synchronization mode", - "gui.refinedstorage.grid.synchronizer.off": "Off", - "gui.refinedstorage.grid.synchronizer.off.help": "Don't sync the search box text.", - "gui.refinedstorage.grid.synchronizer.jei": "JEI", - "gui.refinedstorage.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.", - "gui.refinedstorage.grid.synchronizer.jei.two_way": "JEI two-way", - "gui.refinedstorage.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.", - "gui.refinedstorage.grid.synchronizer.rei": "REI", - "gui.refinedstorage.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.", - "gui.refinedstorage.grid.synchronizer.rei.two_way": "REI two-way", - "gui.refinedstorage.grid.synchronizer.rei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.", - "gui.refinedstorage.grid.resource_type": "Resource type", - "gui.refinedstorage.grid.resource_type.all": "All", - "gui.refinedstorage.grid.resource_type.help": "Filter specific resource types.", - "gui.refinedstorage.crafting_grid.move.network": "Move items to network", - "gui.refinedstorage.crafting_grid.move.inventory": "Move items to inventory", - "gui.refinedstorage.detector.mode": "Mode", - "gui.refinedstorage.detector.mode.under": "Emit redstone signal when under the amount", - "gui.refinedstorage.detector.mode.equal": "Emit redstone signal when on the amount", - "gui.refinedstorage.detector.mode.above": "Emit redstone signal when above the amount", - "gui.refinedstorage.detector.filter_help": "The resource that should be detected in the storage network.", - "gui.refinedstorage.destructor.pickup_items": "Pickup items instead of breaking", - "gui.refinedstorage.destructor.filter_help": "The blocks that may or may not be destroyed, depending if the device is in allowlist or blocklist mode.", - "gui.refinedstorage.destructor.filter_mode.allow.help": "Only allow blocks into the storage network that are configured in the filters.", - "gui.refinedstorage.destructor.filter_mode.block.help": "Disallow blocks into the storage network that are configured in the filters.", - "gui.refinedstorage.constructor.drop_items": "Drop items instead of placing blocks", - "gui.refinedstorage.constructor.filter_help": "The resources that should be placed from the storage network.", - "gui.refinedstorage.interface.filter_help": "The resources that should be exported from the storage network.", - "gui.refinedstorage.exporter.filter_help": "The resources that should be exported from the storage network.", - "gui.refinedstorage.importer.filter_help": "The resources that may be imported from the target inventory.", - "gui.refinedstorage.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.", - "gui.refinedstorage.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.", - "gui.refinedstorage.wireless_transmitter.distance": "%d block(s)", - "gui.refinedstorage.storage_monitor.filter_help": "The resource to display.", - "gui.refinedstorage.redstone_mode": "Redstone mode", - "gui.refinedstorage.redstone_mode.ignore": "Ignore", - "gui.refinedstorage.redstone_mode.ignore.help": "This device will always be active, regardless of redstone signal.", - "gui.refinedstorage.redstone_mode.high": "High", - "gui.refinedstorage.redstone_mode.high.help": "This device will only be active with a redstone signal.", - "gui.refinedstorage.redstone_mode.low": "Low", - "gui.refinedstorage.redstone_mode.low.help": "This device will only be active without a redstone signal.", - "gui.refinedstorage.scheduling_mode": "Scheduling mode", - "gui.refinedstorage.scheduling_mode.default": "Default", - "gui.refinedstorage.scheduling_mode.default.help": "Use the first available filter.", - "gui.refinedstorage.scheduling_mode.round_robin": "Round robin", - "gui.refinedstorage.scheduling_mode.round_robin.help": "Use each filter in turn.", - "gui.refinedstorage.scheduling_mode.random": "Random", - "gui.refinedstorage.scheduling_mode.random.help": "Use a random filter.", - "gui.refinedstorage.priority": "Priority", - "gui.refinedstorage.priority.storage_help": "The order in which the storage network will insert or extract resources, highest-first.", - "gui.refinedstorage.amount": "Amount", - "gui.refinedstorage.amount.reset": "Reset", - "gui.refinedstorage.amount.set": "Set", - "gui.refinedstorage.filter_mode": "Filter mode", - "gui.refinedstorage.filter_mode.allow": "Allowlist", - "gui.refinedstorage.filter_mode.block": "Blocklist", - "gui.refinedstorage.fuzzy_mode": "Fuzzy mode", - "gui.refinedstorage.fuzzy_mode.on": "On", - "gui.refinedstorage.fuzzy_mode.on.storage_help": "Match the filters for the allowlist or blocklist exactly.", - "gui.refinedstorage.fuzzy_mode.on.generic_help": "Match the filter exactly.", - "gui.refinedstorage.fuzzy_mode.on.extracting_storage_network_help": "Match the filters when extracting from the storage network exactly.", - "gui.refinedstorage.fuzzy_mode.on.extracting_source_help": "Match the filters when extracting from the source exactly.", - "gui.refinedstorage.fuzzy_mode.off": "Off", - "gui.refinedstorage.fuzzy_mode.off.storage_help": "Match the filters for the allowlist or blocklist without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.generic_help": "Match the filter without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.extracting_storage_network_help": "Match the filters when extracting from the storage network without comparing NBT tags.", - "gui.refinedstorage.fuzzy_mode.off.extracting_source_help": "Match the filters when extracting from the source without comparing NBT tags.", - "gui.refinedstorage.access_mode": "Access mode", - "gui.refinedstorage.access_mode.insert_extract": "Insert and extract", - "gui.refinedstorage.access_mode.insert_extract.help": "The storage network will be able to insert or extract from this storage.", - "gui.refinedstorage.access_mode.insert": "Insert only", - "gui.refinedstorage.access_mode.insert.help": "The storage network will only be able to insert into this storage. Contained resources will still be visible in a Grid.", - "gui.refinedstorage.access_mode.extract": "Extract only", - "gui.refinedstorage.access_mode.extract.help": "The storage network will only be able to extract from this storage.", - "gui.refinedstorage.void_excess": "Void excess resources", - "gui.refinedstorage.void_excess.help": "When void excess mode is turned on and the storage is full, it will keep accepting resources but void them.", - "gui.refinedstorage.void_excess.allowlist_warning": "Void excess will only work when the storage is in allowlist mode.", - "gui.refinedstorage.upgrade_slot": "Empty upgrade slot", - "gui.refinedstorage.filter_slot.empty_filter": "Empty filter", - "gui.refinedstorage.filter_slot.left_click_for": "Left click for", - "gui.refinedstorage.filter_slot.right_click_for": "Right click for", - "gui.refinedstorage.filter_slot.click_to_clear": "Click to clear", - "gui.refinedstorage.regulator_upgrade.filter_help": "The resource that should be regulated in the target.", - "gui.refinedstorage.network_transmitter.status.inactive": "Inactive", - "gui.refinedstorage.network_transmitter.status.missing_network_card": "Missing Network Card", - "gui.refinedstorage.network_transmitter.status.transmitting": "%d block(s)", - "gui.refinedstorage.network_transmitter.status.receiver_unreachable": "Unreachable", - "item.refinedstorage.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", - "item.refinedstorage.creative_controller.help": "Provides the storage network with an infinite source of energy.", - "item.refinedstorage.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", - "item.refinedstorage.grid.help": "Allows for interacting with the storage network.", - "item.refinedstorage.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.", - "item.refinedstorage.importer.help": "Imports resources from an external source to the storage network.", - "item.refinedstorage.exporter.help": "Exports resources from the storage network to an external destination.", - "item.refinedstorage.interface.help": "Acts as the combination of an Importer and Exporter.", - "item.refinedstorage.external_storage.help": "Provides the storage network with storage from an external source.", - "item.refinedstorage.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.", - "item.refinedstorage.constructor.help": "Places blocks from the storage network in the world.", - "item.refinedstorage.destructor.help": "Destroys blocks from the world and puts them in the storage network.", - "item.refinedstorage.quartz_enriched_iron": "Quartz Enriched Iron", - "item.refinedstorage.processor_binding": "Processor Binding", - "item.refinedstorage.silicon": "Silicon", - "item.refinedstorage.raw_basic_processor": "Raw Basic Processor", - "item.refinedstorage.raw_improved_processor": "Raw Improved Processor", - "item.refinedstorage.raw_advanced_processor": "Raw Advanced Processor", - "item.refinedstorage.basic_processor": "Basic Processor", - "item.refinedstorage.improved_processor": "Improved Processor", - "item.refinedstorage.advanced_processor": "Advanced Processor", - "item.refinedstorage.1k_storage_part": "1K Storage Part", - "item.refinedstorage.4k_storage_part": "4K Storage Part", - "item.refinedstorage.16k_storage_part": "16K Storage Part", - "item.refinedstorage.64k_storage_part": "64K Storage Part", - "item.refinedstorage.1k_storage_disk": "1K Storage Disk", - "item.refinedstorage.4k_storage_disk": "4K Storage Disk", - "item.refinedstorage.16k_storage_disk": "16K Storage Disk", - "item.refinedstorage.64k_storage_disk": "64K Storage Disk", - "item.refinedstorage.creative_storage_disk": "Creative Storage Disk", - "item.refinedstorage.64b_fluid_storage_part": "64B Fluid Storage Part", - "item.refinedstorage.256b_fluid_storage_part": "256B Fluid Storage Part", - "item.refinedstorage.1024b_fluid_storage_part": "1024B Fluid Storage Part", - "item.refinedstorage.4096b_fluid_storage_part": "4096B Fluid Storage Part", - "item.refinedstorage.64b_fluid_storage_disk": "64B Fluid Storage Disk", - "item.refinedstorage.256b_fluid_storage_disk": "256B Fluid Storage Disk", - "item.refinedstorage.1024b_fluid_storage_disk": "1024B Fluid Storage Disk", - "item.refinedstorage.4096b_fluid_storage_disk": "4096B Fluid Storage Disk", - "item.refinedstorage.creative_fluid_storage_disk": "Creative Fluid Storage Disk", - "item.refinedstorage.storage_housing": "Storage Housing", - "item.refinedstorage.construction_core": "Construction Core", - "item.refinedstorage.destruction_core": "Destruction Core", - "item.refinedstorage.wrench": "Wrench", - "item.refinedstorage.wrench.helper": "Use to rotate blocks or press SHIFT and use to dismantle Refined Storage blocks.", - "item.refinedstorage.upgrade": "Upgrade", - "item.refinedstorage.speed_upgrade": "Speed Upgrade", - "item.refinedstorage.stack_upgrade": "Stack Upgrade", - "item.refinedstorage.silk_touch_upgrade": "Silk Touch Upgrade", - "item.refinedstorage.fortune_upgrade.1": "Fortune I Upgrade", - "item.refinedstorage.fortune_upgrade.2": "Fortune II Upgrade", - "item.refinedstorage.fortune_upgrade.3": "Fortune III Upgrade", - "item.refinedstorage.regulator_upgrade": "Regulator Upgrade", - "item.refinedstorage.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.", - "item.refinedstorage.range_upgrade": "Range Upgrade", - "item.refinedstorage.creative_range_upgrade": "Creative Range Upgrade", - "item.refinedstorage.wireless_grid": "Wireless Grid", - "item.refinedstorage.creative_wireless_grid": "Creative Wireless Grid", - "item.refinedstorage.wireless_transmitter.help": "Provides wireless network access for items like the Wireless Grid. Multiple are allowed in an area for wider coverage.", - "item.refinedstorage.network_item.unbound": "Unbound.", - "item.refinedstorage.network_item.unbound.help": "Use on any storage network device to bind.", - "item.refinedstorage.network_item.bound_to": "Bound to %d, %d, %d.", - "item.refinedstorage.network_item.cannot_open_with_shortcut_due_to_duplicate": "There is more than one %s in your inventory.", - "item.refinedstorage.network_item.cannot_open_because_not_found": "There isn't any %s in your inventory.", - "item.refinedstorage.configuration_card": "Configuration Card", - "item.refinedstorage.configuration_card.empty": "Empty.", - "item.refinedstorage.configuration_card.configured": "Contains configuration for %s.", - "item.refinedstorage.configuration_card.copied_configuration": "Copied configuration for %s.", - "item.refinedstorage.configuration_card.cleared_configuration": "Cleared configuration.", - "item.refinedstorage.configuration_card.cannot_apply_configuration": "Cannot apply configuration card to different type of device. It is configured for %s.", - "item.refinedstorage.configuration_card.applied_configuration": "Applied configuration.", - "item.refinedstorage.configuration_card.empty_help": "Use on a storage network device while crouching to copy its configuration and upgrades to the card.", - "item.refinedstorage.configuration_card.configured_help": "Use on the destination storage network device while crouching to transfer the configuration and upgrades. Use while crouching to clear.", - "item.refinedstorage.network_card": "Network Card", - "item.refinedstorage.network_card.unbound_help": "Use while crouching on a Network Receiver.", - "item.refinedstorage.network_card.unbound": "Unbound.", - "item.refinedstorage.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", - "item.refinedstorage.network_card.bound": "Bound to %d, %d, %d in %s.", - "misc.refinedstorage.stored": "Stored: %s", - "misc.refinedstorage.stored_with_capacity": "Stored: %s / %s (%d%%)", - "misc.refinedstorage.total": "%d total", - "misc.refinedstorage.last_modified.just_now": "Last modified just now by %s", - "misc.refinedstorage.last_modified.second": "Last modified %d second ago by %s", - "misc.refinedstorage.last_modified.seconds": "Last modified %d seconds ago by %s", - "misc.refinedstorage.last_modified.minute": "Last modified %d minute ago by %s", - "misc.refinedstorage.last_modified.minutes": "Last modified %d minutes ago by %s", - "misc.refinedstorage.last_modified.hour": "Last modified %d hour ago by %s", - "misc.refinedstorage.last_modified.hours": "Last modified %d hours ago by %s", - "misc.refinedstorage.last_modified.day": "Last modified %d day ago by %s", - "misc.refinedstorage.last_modified.days": "Last modified %d days ago by %s", - "misc.refinedstorage.last_modified.week": "Last modified %d week ago by %s", - "misc.refinedstorage.last_modified.weeks": "Last modified %d weeks ago by %s", - "misc.refinedstorage.last_modified.year": "Last modified %d year ago by %s", - "misc.refinedstorage.last_modified.years": "Last modified %d years ago by %s", - "misc.refinedstorage.resource_type.item": "Item", - "misc.refinedstorage.resource_type.fluid": "Fluid", - "misc.refinedstorage.press_shift_for_help": "Press SHIFT for help", - "key.refinedstorage.focus_search_bar": "Focus search bar", - "key.refinedstorage.clear_crafting_grid_matrix_to_network": "Clear Crafting Grid matrix to network", - "key.refinedstorage.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory", - "key.refinedstorage.open_wireless_grid": "Open Wireless Grid", - "refinedstorage.subtitle.wrench": "Wrench used", - "category.refinedstorage.key_bindings": "Refined Storage", - "text.autoconfig.refinedstorage.title": "Refined Storage", - "text.autoconfig.refinedstorage.option.grid": "Grid", - "text.autoconfig.refinedstorage.option.grid.largeFont": "Large font", - "text.autoconfig.refinedstorage.option.grid.maxRowsStretch": "Maximum amount of rows when stretched", - "text.autoconfig.refinedstorage.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", - "text.autoconfig.refinedstorage.option.grid.detailedTooltip": "Detailed tooltip", - "text.autoconfig.refinedstorage.option.grid.rememberSearchQuery": "Remember search query", - "text.autoconfig.refinedstorage.option.grid.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.grid.smoothScrolling": "Smooth scrolling", - "text.autoconfig.refinedstorage.option.grid.autoSelected": "Auto selected search box", - "text.autoconfig.refinedstorage.option.grid.synchronizer": "Synchronizer", - "text.autoconfig.refinedstorage.option.grid.resourceTypeId": "Resource type", - "text.autoconfig.refinedstorage.option.grid.sortingDirection": "Sorting direction", - "text.autoconfig.refinedstorage.option.grid.sortingType": "Sorting type", - "text.autoconfig.refinedstorage.option.grid.size": "Size", - "text.autoconfig.refinedstorage.option.craftingGrid": "Crafting Grid", - "text.autoconfig.refinedstorage.option.craftingGrid.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.craftingGrid.craftingMatrixCloseBehavior": "Crafting matrix close behavior", - "text.autoconfig.refinedstorage.option.controller": "Controller", - "text.autoconfig.refinedstorage.option.controller.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.cable": "Cable", - "text.autoconfig.refinedstorage.option.cable.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskDrive": "Disk Drive", - "text.autoconfig.refinedstorage.option.diskDrive.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.diskDrive.energyUsagePerDisk": "Energy usage per disk", - "text.autoconfig.refinedstorage.option.storageBlock": "Storage Block", - "text.autoconfig.refinedstorage.option.storageBlock.oneKEnergyUsage": "1K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.fourKEnergyUsage": "4K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.sixteenKEnergyUsage": "16K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.sixtyFourKEnergyUsage": "64K energy usage", - "text.autoconfig.refinedstorage.option.storageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock": "Fluid Storage Block", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.sixtyFourBEnergyUsage": "64B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.twoHundredFiftySixBEnergyUsage": "256B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.thousandTwentyFourBEnergyUsage": "1024B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.fourThousandNinetySixBEnergyUsage": "4096B energy usage", - "text.autoconfig.refinedstorage.option.fluidStorageBlock.creativeEnergyUsage": "Creative energy usage", - "text.autoconfig.refinedstorage.option.importer": "Importer", - "text.autoconfig.refinedstorage.option.importer.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.exporter": "Exporter", - "text.autoconfig.refinedstorage.option.exporter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.detector": "Detector", - "text.autoconfig.refinedstorage.option.detector.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.constructor": "Constructor", - "text.autoconfig.refinedstorage.option.constructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.destructor": "Destructor", - "text.autoconfig.refinedstorage.option.destructor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.upgrade": "Upgrade", - "text.autoconfig.refinedstorage.option.upgrade.speedUpgradeEnergyUsage": "Speed Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.stackUpgradeEnergyUsage": "Stack Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune1UpgradeEnergyUsage": "Fortune 1 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune2UpgradeEnergyUsage": "Fortune 2 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", - "text.autoconfig.refinedstorage.option.upgrade.rangeUpgradeRange": "Range Upgrade range", - "text.autoconfig.refinedstorage.option.iface": "Interface", - "text.autoconfig.refinedstorage.option.iface.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.externalStorage": "External Storage", - "text.autoconfig.refinedstorage.option.externalStorage.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid": "Wireless Grid", - "text.autoconfig.refinedstorage.option.wirelessGrid.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.wirelessGrid.openEnergyUsage": "Open energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", - "text.autoconfig.refinedstorage.option.wirelessTransmitter": "Wireless Transmitter", - "text.autoconfig.refinedstorage.option.wirelessTransmitter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.wirelessTransmitter.baseRange": "Base range", - "text.autoconfig.refinedstorage.option.storageMonitor": "Storage Monitor", - "text.autoconfig.refinedstorage.option.storageMonitor.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.networkReceiver": "Network Receiver", - "text.autoconfig.refinedstorage.option.networkReceiver.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.networkTransmitter": "Network Transmitter", - "text.autoconfig.refinedstorage.option.networkTransmitter.energyUsage": "Energy usage", - "text.autoconfig.refinedstorage.option.portableGrid": "Portable Grid", - "text.autoconfig.refinedstorage.option.portableGrid.energyCapacity": "Energy capacity", - "text.autoconfig.refinedstorage.option.portableGrid.openEnergyUsage": "Open energy usage", - "text.autoconfig.refinedstorage.option.portableGrid.insertEnergyUsage": "Insert energy usage", - "text.autoconfig.refinedstorage.option.portableGrid.extractEnergyUsage": "Extract energy usage", - "advancements.refinedstorage.root.description": "Use one or multiple Controllers in a network to provide your network with energy", - "advancements.refinedstorage.connecting": "Connecting", - "advancements.refinedstorage.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", - "advancements.refinedstorage.drives": "Drives", - "advancements.refinedstorage.drives.description": "Craft a Disk Drive to be able to store your storage disks", - "advancements.refinedstorage.storing_items": "Storing items", - "advancements.refinedstorage.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive", - "advancements.refinedstorage.viewing_your_storage": "Viewing your storage", - "advancements.refinedstorage.viewing_your_storage.description": "Craft a Grid to interact with your storage", - "advancements.refinedstorage.upgrading_your_grid": "Upgrading your Grid", - "advancements.refinedstorage.upgrading_your_grid.description": "Upgrade your Grid to a Crafting Grid to get crafting abilities", - "advancements.refinedstorage.storing_fluids": "Storing fluids", - "advancements.refinedstorage.storing_fluids.description": "Craft a Fluid Storage Disk and put it in your Disk Drive", - "advancements.refinedstorage.importing": "Importing", - "advancements.refinedstorage.importing.description": "Get resources into the storage network with an Importer", - "advancements.refinedstorage.exporting": "Exporting", - "advancements.refinedstorage.exporting.description": "Get resources out of the storage network with an Exporter", - "advancements.refinedstorage.upgrading": "Upgrading", - "advancements.refinedstorage.upgrading.description": "Craft an Upgrade to improve various devices", - "advancements.refinedstorage.interface_to_the_world": "Interface to the world", - "advancements.refinedstorage.interface_to_the_world.description": "Export and import items at the same time with an Interface", - "advancements.refinedstorage.storing_externally": "Storing externally", - "advancements.refinedstorage.storing_externally.description": "Use an External Storage to provide the network with storage from an external block like a chest", - "advancements.refinedstorage.detecting": "Detecting", - "advancements.refinedstorage.detecting.description": "Use redstone to check resources stored in the network", - "advancements.refinedstorage.construction": "Construction", - "advancements.refinedstorage.construction.description": "Get blocks from the storage network into the world with a Constructor", - "advancements.refinedstorage.destruction": "Destruction", - "advancements.refinedstorage.destruction.description": "Get blocks from in the world into the storage network with a Destructor", - "advancements.refinedstorage.wireless": "Wireless", - "advancements.refinedstorage.wireless.description": "Access your resources wirelessly with a Wireless Grid.", - "advancements.refinedstorage.better_than_a_barrel": "Better than a barrel", - "advancements.refinedstorage.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", - "advancements.refinedstorage.no_cables_required": "No cables required", - "advancements.refinedstorage.no_cables_required.description": "Add extra components to your network without using cables by using a Network Transmitter, Network Receiver and Network Card", - "advancements.refinedstorage.portable_storage": "Portable storage", - "advancements.refinedstorage.portable_storage.description": "Craft a Portable Grid to access the content of disks without requiring a storage network" -} diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json index 49923d184..b2eba9f3c 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json +++ b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_full.json @@ -1,5 +1,4 @@ { - "credit": "Made with Blockbench", "textures": { "base": "refinedstorage:block/disk/leds" }, diff --git a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json index eb0650629..41ebfbe2a 100644 --- a/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json +++ b/refinedstorage-platform-common/src/main/resources/assets/refinedstorage/models/block/disk/led_near_capacity.json @@ -1,5 +1,4 @@ { - "credit": "Made with Blockbench", "textures": { "base": "refinedstorage:block/disk/leds" }, diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java b/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java index 104b7cda0..12fc3db13 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java +++ b/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/registry/PlatformRegistryImplTest.java @@ -43,6 +43,7 @@ void shouldNotBeAbleToModifyUnderlyingRegistryList() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldRegisterAndRetrieve() { // Act sut.register(A, 10); diff --git a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java b/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java index 83de1f629..49ff58b57 100644 --- a/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java +++ b/refinedstorage-platform-common/src/test/java/com/refinedmods/refinedstorage/platform/common/support/resource/list/FuzzyResourceListImplTest.java @@ -37,6 +37,7 @@ void setUp() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void testRetrievingFuzzy() { // Arrange sut.add(DUMMY_A, 5); @@ -92,6 +93,7 @@ void testRetrievingFuzzy() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldRemoveEntireResourceFromFuzzyIndexAfterRemoval() { // Arrange sut.add(DUMMY_A, 5); @@ -137,6 +139,7 @@ void shouldRemoveEntireResourceFromFuzzyIndexAfterRemoval() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldRemoveSingleResourceFromFuzzyIndexAfterRemoval() { // Arrange sut.add(DUMMY_A, 5); diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java index 92ea07790..f10d2e48e 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java +++ b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ConfigImpl.java @@ -15,6 +15,7 @@ import me.shedaniel.autoconfig.annotation.ConfigEntry; import net.minecraft.resources.ResourceLocation; +@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal", "CanBeFinal"}) @Config(name = IdentifierUtil.MOD_ID) public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage.platform.common.Config { private ScreenSize screenSize = ScreenSize.STRETCH; @@ -328,7 +329,7 @@ public void setAutoSelected(final boolean autoSelected) { @Override public Optional getSynchronizer() { - if (synchronizer == null || synchronizer.trim().isBlank()) { + if (synchronizer.trim().isBlank()) { return Optional.empty(); } return Optional.of(synchronizer).map(ResourceLocation::tryParse); @@ -370,7 +371,7 @@ public void setSortingType(final GridSortingTypes sortingType) { @Override public Optional getResourceTypeId() { - if (resourceTypeId == null || resourceTypeId.trim().isBlank()) { + if (resourceTypeId.trim().isBlank()) { return Optional.empty(); } return Optional.of(resourceTypeId).map(ResourceLocation::tryParse); diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java index fb864b9a3..6ccf93436 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java +++ b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/ModInitializerImpl.java @@ -250,6 +250,7 @@ private void registerContent() { registerBlockEntities( new DirectRegistryCallback<>(BuiltInRegistries.BLOCK_ENTITY_TYPE), new BlockEntityTypeFactory() { + @SuppressWarnings("DataFlowIssue") // data type can be null @Override public BlockEntityType create(final BlockEntitySupplier factory, final Block... allowedBlocks) { diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java index f90d173c0..7f202de27 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java +++ b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/EmissiveTransform.java @@ -24,6 +24,7 @@ public boolean transform(final MutableQuadView quad) { return true; } + @SuppressWarnings("resource") private void doTransform(final MutableQuadView quad) { final SpriteFinder finder = SpriteFinder.get(getAtlas()); if (finder == null) { diff --git a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java index bf9e5cf55..0748b28cb 100644 --- a/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java +++ b/refinedstorage-platform-fabric/src/main/java/com/refinedmods/refinedstorage/platform/fabric/support/render/QuadRotator.java @@ -49,9 +49,9 @@ public boolean transform(final MutableQuadView quad) { if (cullFace != null) { quad.cullFace(rotate(cullFace, mat)); } - - quad.nominalFace(rotate(nominalFace, mat)); - + if (nominalFace != null) { + quad.nominalFace(rotate(nominalFace, mat)); + } return true; } diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java index e8f4bbe5a..5b52468f1 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ConfigImpl.java @@ -435,7 +435,7 @@ public void setAutoSelected(final boolean autoSelected) { @Override public Optional getSynchronizer() { - if (synchronizer == null || synchronizer.get().trim().isBlank()) { + if (synchronizer.get().trim().isBlank()) { return Optional.empty(); } return Optional.of(synchronizer.get()).map(ResourceLocation::tryParse); @@ -473,7 +473,7 @@ public void setSortingType(final GridSortingTypes sortingType) { @Override public Optional getResourceTypeId() { - if (resourceType == null || resourceType.get().trim().isBlank()) { + if (resourceType.get().trim().isBlank()) { return Optional.empty(); } return Optional.of(resourceType.get()).map(ResourceLocation::tryParse); diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java index 97d07acf3..32c6ce5a7 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/ModInitializer.java @@ -318,6 +318,7 @@ private void registerBlockEntities(final IEventBus eventBus) { registerBlockEntities( new ForgeRegistryCallback<>(blockEntityTypeRegistry), new BlockEntityTypeFactory() { + @SuppressWarnings("DataFlowIssue") // data type can be null @Override public BlockEntityType create(final BlockEntitySupplier factory, final Block... allowedBlocks) { diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java index 898babd8c..79e0b7ad2 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/PlatformImpl.java @@ -325,7 +325,7 @@ public Optional getEnergyStorage(final ItemStack stack) { return Optional.ofNullable(stack.getCapability(Capabilities.EnergyStorage.ITEM)) .filter(EnergyStorageAdapter.class::isInstance) .map(EnergyStorageAdapter.class::cast) - .map(EnergyStorageAdapter::getEnergyStorage); + .map(EnergyStorageAdapter::energyStorage); } @Override diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java index 35ff1effa..3fb7b9a86 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/energy/EnergyStorageAdapter.java @@ -5,17 +5,7 @@ import net.neoforged.neoforge.energy.IEnergyStorage; -public class EnergyStorageAdapter implements IEnergyStorage { - private final EnergyStorage energyStorage; - - public EnergyStorageAdapter(final EnergyStorage energyStorage) { - this.energyStorage = energyStorage; - } - - public EnergyStorage getEnergyStorage() { - return energyStorage; - } - +public record EnergyStorageAdapter(EnergyStorage energyStorage) implements IEnergyStorage { @Override public int receiveEnergy(final int maxReceive, final boolean simulate) { return (int) energyStorage.receive(maxReceive, simulate ? Action.SIMULATE : Action.EXECUTE); diff --git a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java index ace1123b3..1ab96ec25 100644 --- a/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java +++ b/refinedstorage-platform-neoforge/src/main/java/com/refinedmods/refinedstorage/platform/neoforge/support/render/RotationTranslationModelBaker.java @@ -20,16 +20,16 @@ public class RotationTranslationModelBaker { private final ModelState state; private final ModelBaker baker; - private final Function spriterGetter; + private final Function spriteGetter; private final ResourceLocation model; public RotationTranslationModelBaker(final ModelState state, final ModelBaker baker, - final Function spriterGetter, + final Function spriteGetter, final ResourceLocation model) { this.state = state; this.baker = baker; - this.spriterGetter = spriterGetter; + this.spriteGetter = spriteGetter; this.model = model; } @@ -38,7 +38,7 @@ public List bake(final Transformation transformation, @Nullable final Direction side, final RandomSource rand) { final ModelState wrappedState = new SimpleModelState(transformation, state.isUvLocked()); - final BakedModel bakedModel = baker.bake(model, wrappedState, spriterGetter); + final BakedModel bakedModel = baker.bake(model, wrappedState, spriteGetter); if (bakedModel == null) { return new ArrayList<>(); } diff --git a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java index 22d5a5561..c2d0b5fea 100644 --- a/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java +++ b/refinedstorage-platform-neoforge/src/test/java/com/refinedmods/refinedstorage/platform/common/GameTestUtil.java @@ -87,9 +87,6 @@ public static T requireBlockEntity( final Class clazz ) { final BlockEntity blockEntity = helper.getBlockEntity(pos); - if (blockEntity == null) { - throw new GameTestAssertException("Block entity not found at " + pos); - } if (!clazz.isInstance(blockEntity)) { throw new GameTestAssertException( "Expected block entity of type " + clazz + " but was " + blockEntity.getClass() diff --git a/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java b/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java index 14b583868..bc283637b 100644 --- a/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java +++ b/refinedstorage-query-parser/src/main/java/com/refinedmods/refinedstorage/query/parser/Parser.java @@ -78,7 +78,7 @@ private Node parseParen() { final Token currentAfterExpression = currentOrNull(); if (currentAfterExpression == null) { - throw new ParserException("Expected ')'", tokens.get(tokens.size() - 1)); + throw new ParserException("Expected ')'", tokens.getLast()); } if (currentAfterExpression.type() == TokenType.PAREN_CLOSE diff --git a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java index 50cd0101e..341479880 100644 --- a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java +++ b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/lexer/LexerTest.java @@ -42,7 +42,7 @@ void testSingleIdentifier() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "hel1lo", TokenType.IDENTIFIER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 6); } @@ -55,7 +55,7 @@ void testMultipleIdentifiers() { // Assert assertThat(tokens).hasSize(3); - final Token hello = tokens.get(0); + final Token hello = tokens.getFirst(); assertToken(hello, "hello", TokenType.IDENTIFIER); assertPosition(hello.position(), SOURCE_NAME, 1, 1, 1, 5); @@ -76,7 +76,7 @@ void testSingleStringIdentifier() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "h_el1lo", TokenType.IDENTIFIER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 9); } @@ -89,7 +89,7 @@ void testMultipleStringIdentifiers() { // Assert assertThat(tokens).hasSize(3); - final Token hello = tokens.get(0); + final Token hello = tokens.getFirst(); assertToken(hello, "hello", TokenType.IDENTIFIER); assertPosition(hello.position(), SOURCE_NAME, 1, 1, 1, 7); @@ -103,14 +103,14 @@ void testMultipleStringIdentifiers() { } @Test - void testEmptyStirngIdentifier() { + void testEmptyStringIdentifier() { // Act final List tokens = getTokens("\"\""); // Assert assertThat(tokens).hasSize(1); - final Token text = tokens.get(0); + final Token text = tokens.getFirst(); assertToken(text, "", TokenType.IDENTIFIER); assertPosition(text.position(), SOURCE_NAME, 1, 1, 1, 2); } @@ -133,7 +133,7 @@ void testNewLines() { // Assert assertThat(tokens).hasSize(4); - final Token hello = tokens.get(0); + final Token hello = tokens.getFirst(); assertToken(hello, "hello", TokenType.IDENTIFIER); assertPosition(hello.position(), SOURCE_NAME, 1, 1, 1, 5); @@ -158,7 +158,7 @@ void testIntegerNumber() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "123", TokenType.INTEGER_NUMBER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 3); } @@ -171,7 +171,7 @@ void testFloatingNumber() { // Assert assertThat(tokens).hasSize(1); - final Token token = tokens.get(0); + final Token token = tokens.getFirst(); assertToken(token, "123.45", TokenType.FLOATING_NUMBER); assertPosition(token.position(), SOURCE_NAME, 1, 1, 1, 6); } @@ -209,7 +209,7 @@ void testTokenMappings() { assertThat(tokens).hasSize(9); - assertToken(tokens.get(0), "(", TokenType.PAREN_OPEN); + assertToken(tokens.getFirst(), "(", TokenType.PAREN_OPEN); assertToken(tokens.get(1), ")", TokenType.PAREN_CLOSE); assertToken(tokens.get(2), "+", TokenType.BIN_OP); assertToken(tokens.get(3), "-", TokenType.BIN_OP); @@ -219,7 +219,7 @@ void testTokenMappings() { assertToken(tokens.get(7), "&&", TokenType.BIN_OP); assertToken(tokens.get(8), "||", TokenType.BIN_OP); - assertPosition(tokens.get(0).position(), SOURCE_NAME, 1, 1, 1, 1); + assertPosition(tokens.getFirst().position(), SOURCE_NAME, 1, 1, 1, 1); assertPosition(tokens.get(1).position(), SOURCE_NAME, 1, 2, 1, 2); assertPosition(tokens.get(2).position(), SOURCE_NAME, 1, 3, 1, 3); assertPosition(tokens.get(3).position(), SOURCE_NAME, 1, 4, 1, 4); diff --git a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java index 5f3001696..6cf950b59 100644 --- a/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java +++ b/refinedstorage-query-parser/src/test/java/com/refinedmods/refinedstorage/query/parser/ParserTest.java @@ -26,7 +26,7 @@ void testIdentifierLiteral() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("hello"); + assertThat(nodes.getFirst()).hasToString("hello"); } @Test @@ -39,7 +39,7 @@ void testNumberLiteral() { // Assert assertThat(nodes).hasSize(2); - assertThat(nodes.get(0)).hasToString("1"); + assertThat(nodes.getFirst()).hasToString("1"); assertThat(nodes.get(1)).hasToString("2.345"); } @@ -54,7 +54,7 @@ void testSimpleBinaryOperator() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(1 + 2)"); + assertThat(nodes.getFirst()).hasToString("(1 + 2)"); } @Test @@ -72,7 +72,7 @@ void testLeftToRightBinaryOperatorAssociativity() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(((1 + 2) + 3) + 4)"); + assertThat(nodes.getFirst()).hasToString("(((1 + 2) + 3) + 4)"); } @Test @@ -90,7 +90,7 @@ void testRightToLeftBinaryOperatorAssociativity() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(1 ^ (2 ^ (3 ^ 4)))"); + assertThat(nodes.getFirst()).hasToString("(1 ^ (2 ^ (3 ^ 4)))"); } @Test @@ -114,7 +114,7 @@ void testBinaryOperatorAssociativity() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(((1 + 2) + 3) + (4 * (5 ^ (6 ^ 7))))"); + assertThat(nodes.getFirst()).hasToString("(((1 + 2) + 3) + (4 * (5 ^ (6 ^ 7))))"); } @Test @@ -134,7 +134,7 @@ void testBinaryOperatorPrecedence() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(x = ((1 + (2 * 3)) + 4))"); + assertThat(nodes.getFirst()).hasToString("(x = ((1 + (2 * 3)) + 4))"); } @Test @@ -152,7 +152,7 @@ void testLogicalOperatorPrecedence() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("((x && y) || (z && a))"); + assertThat(nodes.getFirst()).hasToString("((x && y) || (z && a))"); } @Test @@ -173,7 +173,7 @@ void testUnaryOperators() { // Assert assertThat(nodes).hasSize(3); - assertThat(nodes.get(0)).hasToString("!true"); + assertThat(nodes.getFirst()).hasToString("!true"); assertThat(nodes.get(1)).hasToString("++x"); assertThat(nodes.get(2)).hasToString("!((x && y))"); } @@ -202,7 +202,7 @@ void testParenthesis() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(1)"); + assertThat(nodes.getFirst()).hasToString("(1)"); } @Test @@ -226,7 +226,7 @@ void testNestedParenthesis() { // Assert assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(((1 + (1 * ((2 ^ 4))))))"); + assertThat(nodes.getFirst()).hasToString("(((1 + (1 * ((2 ^ 4))))))"); } @Test @@ -274,7 +274,7 @@ void testMultipleExpressionsInParenthesis() { // Assert final List nodes = builder.getNodes(); assertThat(nodes).hasSize(1); - assertThat(nodes.get(0)).hasToString("(a b)"); + assertThat(nodes.getFirst()).hasToString("(a b)"); } @Test diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java index ef7a787ba..633034084 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/TransferHelperTest.java @@ -273,12 +273,12 @@ void shouldNotTransferInvalidAmount() { assertThrows(NullPointerException.class, action3); } - record Transfer(@Nullable ResourceAmount amountInSource, - @Nullable ResourceAmount amountInDestination, - ResourceAmount amountToTransfer, - long amountExpectedToBeTransferred, - @Nullable ResourceAmount amountExpectedAfterTransferInSource, - @Nullable ResourceAmount amountExpectedAfterTransferInDestination) { + public record Transfer(@Nullable ResourceAmount amountInSource, + @Nullable ResourceAmount amountInDestination, + ResourceAmount amountToTransfer, + long amountExpectedToBeTransferred, + @Nullable ResourceAmount amountExpectedAfterTransferInSource, + @Nullable ResourceAmount amountExpectedAfterTransferInDestination) { } public static class TransferBuilder { diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java index aac9d49cc..5fadc5baf 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/channel/StorageChannelImplTest.java @@ -228,6 +228,7 @@ void shouldBeAbleToRetrieveResource() { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldBeAbleToRetrieveTrackedResource() { // Arrange final Storage storage = new TrackedStorageImpl( diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java index 2086629f6..db2dcbfc4 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/composite/CompositeStorageImplTest.java @@ -204,6 +204,7 @@ void shouldOnlyRespectPriorityWhenSortingSourcesExplicitlyWhenChangingPriorityAf assertThat(storage2.getStored()).isEqualTo(2); } + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug @Test void shouldFindMostRecentChange() { // Arrange diff --git a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java index 38820558d..f41a038cc 100644 --- a/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java +++ b/refinedstorage-storage-api/src/test/java/com/refinedmods/refinedstorage/api/storage/tracked/TrackedStorageImplTest.java @@ -136,6 +136,7 @@ void shouldNotTrackResourceByInsertingToAlreadyFullStorage(final Action action) @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldTrackResourceByExtracting(final Action action) { // Arrange backed.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -172,6 +173,7 @@ void shouldNotTrackResourceByExtractingNothing(final Action action) { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldTrackMultipleResources() { // Act sut.insert(A, 1, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); @@ -193,6 +195,7 @@ void shouldTrackMultipleResources() { class UpdateTrackedResourceTest { @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldUpdateTrackedResourceByInserting(final Action action) { // Act sut.insert(A, 50, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); @@ -214,6 +217,7 @@ void shouldUpdateTrackedResourceByInserting(final Action action) { @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldNotUpdateTrackedResourceByInsertingToAnAlreadyFullStorage(final Action action) { // Act sut.insert(A, 100, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); @@ -228,6 +232,7 @@ void shouldNotUpdateTrackedResourceByInsertingToAnAlreadyFullStorage(final Actio @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldUpdateTrackedResourceByExtracting(final Action action) { // Arrange backed.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -252,6 +257,7 @@ void shouldUpdateTrackedResourceByExtracting(final Action action) { @ParameterizedTest @EnumSource(Action.class) + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldNotUpdateTrackedResourceByExtractingNothing(final Action action) { // Arrange backed.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE); @@ -268,6 +274,7 @@ void shouldNotUpdateTrackedResourceByExtractingNothing(final Action action) { } @Test + @SuppressWarnings("AssertBetweenInconvertibleTypes") // intellij bug void shouldBeAbleToUpdateMultipleTrackedResources() { // Act sut.insert(A, 1, Action.EXECUTE, FakeActors.FakeActor1.INSTANCE); diff --git a/settings.gradle.kts b/settings.gradle.kts index 19f3b009f..a35275d32 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,7 @@ dependencyResolutionManagement { } versionCatalogs { create("libs") { - from("com.refinedmods.refinedarchitect:refinedarchitect-versioning:0.16.4") + from("com.refinedmods.refinedarchitect:refinedarchitect-versioning:0.16.6") } } } @@ -36,11 +36,11 @@ pluginManagement { } } plugins { - id("refinedarchitect.root").version("0.16.4") - id("refinedarchitect.base").version("0.16.4") - id("refinedarchitect.common").version("0.16.4") - id("refinedarchitect.neoforge").version("0.16.4") - id("refinedarchitect.fabric").version("0.16.4") + id("refinedarchitect.root").version("0.16.6") + id("refinedarchitect.base").version("0.16.6") + id("refinedarchitect.common").version("0.16.6") + id("refinedarchitect.neoforge").version("0.16.6") + id("refinedarchitect.fabric").version("0.16.6") } }