diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 000000000..0f3897062
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,4 @@
+# Use via: git config --local --add blame.ignoreRevsFile .git-blame-ignore-revs
+
+# Rename "refinedstorage2" to "refinedstorage"
+03d02f1e07e1e6e9726404c236c3af227126ade0
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 86611e2dd..d929057b3 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -13,7 +13,8 @@ These are the most important things to know before contributing (also explained
Category must match a
category [used in our Commitlint config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum).
- 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
+ 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
IDE, so that formatting rules are respected.
- Branches are kept up to date by rebasing, not by merging.
- For non-technical changes, adding a changelog entry is required.
@@ -98,7 +99,8 @@ from [API Guardian](https://github.com/apiguardian-team/apiguardian).
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
+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
IDE, so that formatting rules are respected.
Moreover, the [CheckStyle-IDEA plugin](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) can be used to check
@@ -132,13 +134,13 @@ Tests in the API modules are regular unit tests. Don't see a "unit" here as a co
These tests don't rely on, nor know about, Minecraft.
-Additionally, tests in the `refinedstorage2-network` module use the `refinedstorage2-network-test` JUnit plugin to
+Additionally, tests in the `refinedstorage-network` module use the `refinedstorage-network-test` JUnit plugin to
easily set up networks for testing.
### Integration testing
To test the entire chain from Minecraft to the API modules, we use integration tests. These tests are located in the
-test source set of the `refinedstorage2-platform-forge` module.
+test source set of the `refinedstorage-platform-neoforge` module.
We write these integration tests as Minecraft gametests.
@@ -148,7 +150,7 @@ Our [SonarQube quality gate](https://sonarcloud.io/organizations/refinedmods/qua
test coverage percentage of 80%. This an aggregated percentage over all
the API modules, with an exclusion for the platform modules.
-> The `refinedstorage2-platform-*` modules are excluded because they contain a lot of Minecraft-specific code and are
+> The `refinedstorage-platform-*` modules are excluded because they contain a lot of Minecraft-specific code and are
> harder to test.
### Mutation testing
@@ -258,23 +260,22 @@ The workflow takes care of the following:
## Modules
-Refined Storage 2 is split up into various modules.
+Refined Storage is split up into various modules.
Most modules aren't dependent on Minecraft or a mod loader. Only modules that start
-with `refinedstorage2-platform-*` have dependencies on Minecraft.
-
-| Name | Use in addons | Description |
-|-----------------------------------|---------------|----------------------------------------------------------------------------------------------------|
-| `refinedstorage2-core-api` | ✔️ | Contains some utility classes and enums. |
-| `refinedstorage2-grid-api` | ✔️ | Contains Grid related functionality. |
-| `refinedstorage2-network-api` | ✔️ | Contains storage network related functionality. |
-| `refinedstorage2-network` | ❌ | Contains implementations of `refinedstorage2-network-api`. |
-| `refinedstorage2-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. |
-| `refinedstorage2-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. |
-| `refinedstorage2-resource-api` | ✔️ | Contains API for handling resources. |
-| `refinedstorage2-storage-api` | ✔️ | Contains storage related functionality. |
-| `refinedstorage2-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. |
-| `refinedstorage2-platform-test` | ✔️ | This module is used in platform tests for various Minecraft related helpers. |
-| `refinedstorage2-platform-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. |
-| `refinedstorage2-platform-forge` | ❌ | The platform module for Forge. This module contains Forge specific code and the integration tests. |
-| `refinedstorage2-platform-common` | ❌ | Common mod code. Most gameplay code is in here. |
+with `refinedstorage-platform-*` have dependencies on Minecraft.
+
+| Name | Use in addons | Description |
+|----------------------------------|---------------|----------------------------------------------------------------------------------------------------|
+| `refinedstorage-core-api` | ✔️ | Contains some utility classes and enums. |
+| `refinedstorage-grid-api` | ✔️ | Contains Grid related functionality. |
+| `refinedstorage-network-api` | ✔️ | Contains storage network related functionality. |
+| `refinedstorage-network` | ❌ | Contains implementations of `refinedstorage-network-api`. |
+| `refinedstorage-network-test` | ✔️ | JUnit extension which helps with setting up a network and a network node for testing. |
+| `refinedstorage-query-parser` | ✔️ | A query parser, contains a lexer and parser. Only used for Grid query parsing. |
+| `refinedstorage-resource-api` | ✔️ | Contains API for handling resources. |
+| `refinedstorage-storage-api` | ✔️ | Contains storage related functionality. |
+| `refinedstorage-platform-api` | ✔️ | Implements the various Refined Storage API modules for use in Minecraft. |
+| `refinedstorage-platform-fabric` | ❌ | The platform module for Fabric. This module contains Fabric specific code. |
+| `refinedstorage-platform-forge` | ❌ | The platform module for Forge. This module contains Forge specific code and the integration tests. |
+| `refinedstorage-platform-common` | ❌ | Common mod code. Most gameplay code is in here. |
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index de53558c3..9216935a1 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -21,7 +21,7 @@ body:
label: How can we reproduce this bug or crash?
description: |
Provide us with steps on how to reproduce this issue.
- Try to reproduce the issue with only Refined Storage 2 installed, if possible.
+ Try to reproduce the issue with only Refined Storage installed, if possible.
placeholder: |
1.
2.
diff --git a/.gitignore b/.gitignore
index ae1892911..0521ad558 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,7 @@ eclipse/
*.ipr
*.iws
.idea/
-!.idea/dictionaries/refinedstorage2.xml
+!.idea/dictionaries/refinedstorage.xml
!.idea/icon.png
out/
/bin/
diff --git a/.idea/dictionaries/refinedstorage2.xml b/.idea/dictionaries/refinedstorage2.xml
deleted file mode 100644
index aeda850ec..000000000
--- a/.idea/dictionaries/refinedstorage2.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- autocrafting
- emissive
- redstone
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9f665072b..92a32be6d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,16 +14,16 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Quartz Enriched Copper, used to craft cables.
- Block of Quartz Enriched Copper
+### Changed
+
+- The mod ID has been changed from "refinedstorage2" to "refinedstorage". Worlds that used milestone 3 on Minecraft 1.20.4 are no longer compatible.
+- Recipes now use common tag conventions from NeoForge and Fabric.
+
### Fixed
- Regulator Upgrade having wrong GUI title.
- Crafting Grid not dropping crafting matrix contents when broken.
-- "+1" amount screen button not doing anything.
-
-### Changed
-
-- Internal data format for storages. Storages from milestone 3 are incompatible and will not be transferred.
-- Recipes now use common tag conventions from NeoForge and Fabric.
+- "+1" button on amount screen not doing anything.
## [2.0.0-milestone.3.14] - 2024-06-28
diff --git a/build.gradle b/build.gradle
index cbdf95842..8de0cef5e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,19 +1,19 @@
apply from: "https://raw.githubusercontent.com/refinedmods/refinedarchitect/v${gradle.ext.refinedArchitectVersion}/helper.gradle"
subprojects {
- group = 'com.refinedmods.refinedstorage2'
+ group = 'com.refinedmods.refinedstorage'
ext {
apis = [
- ':refinedstorage2-core-api',
- ':refinedstorage2-resource-api',
- ':refinedstorage2-storage-api',
- ':refinedstorage2-network-api',
- ':refinedstorage2-network',
- ':refinedstorage2-grid-api',
- ':refinedstorage2-query-parser'
+ ':refinedstorage-core-api',
+ ':refinedstorage-resource-api',
+ ':refinedstorage-storage-api',
+ ':refinedstorage-network-api',
+ ':refinedstorage-network',
+ ':refinedstorage-grid-api',
+ ':refinedstorage-query-parser'
]
- compileApis = [':refinedstorage2-platform-api']
+ compileApis = [':refinedstorage-platform-api']
}
}
@@ -21,6 +21,6 @@ enableSonarQube("refinedmods_refinedstorage2")
sonarqube {
properties {
- property "sonar.coverage.exclusions", "refinedstorage2-platform-forge/**/*,refinedstorage2-platform-fabric/**/*,refinedstorage2-platform-common/**/*,refinedstorage2-platform-api/**/*"
+ property "sonar.coverage.exclusions", "refinedstorage-platform-neoforge/**/*,refinedstorage-platform-fabric/**/*,refinedstorage-platform-common/**/*,refinedstorage-platform-api/**/*"
}
}
diff --git a/config/checkstyle/checkstyle-imports.xml b/config/checkstyle/checkstyle-imports.xml
index 56b69ba8c..2bf1e046c 100644
--- a/config/checkstyle/checkstyle-imports.xml
+++ b/config/checkstyle/checkstyle-imports.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/crowdin.yml b/crowdin.yml
index 638d88a8d..5bb3deca0 100644
--- a/crowdin.yml
+++ b/crowdin.yml
@@ -6,8 +6,8 @@ base_path: .
pull_request_labels:
- skip-changelog
files:
- - source: /refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json
- translation: /refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/%locale_with_underscore%.json
+ - source: /refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/en_us.json
+ translation: /refinedstorage-platform-common/src/main/resources/assets/refinedstorage/lang/%locale_with_underscore%.json
languages_mapping:
locale_with_underscore:
af: af_za
diff --git a/doc/architecture/decision/001-multi-loader-architecture.md b/doc/architecture/decision/001-multi-loader-architecture.md
index d0a6bc5d0..f8a43dd89 100644
--- a/doc/architecture/decision/001-multi-loader-architecture.md
+++ b/doc/architecture/decision/001-multi-loader-architecture.md
@@ -13,13 +13,13 @@ should support this design goal in a maintainable way.
## Decision
-Refined Storage 2 will have a modular structure with a module per modloader.
+Refined Storage will have a modular structure with a module per modloader.
There will be a common module, and most code should reside in there. The modloader specific (platform) modules should be
reserved
for platform specific functionality, like registration, networking, etc.
-The module naming follows the standard of `refinedstorage2-platform-{name}`.
+The module naming follows the standard of `refinedstorage-platform-{name}`.
## Consequences
diff --git a/doc/architecture/decision/002-api-modules.md b/doc/architecture/decision/002-api-modules.md
index 2010edc9a..dccd5efa3 100644
--- a/doc/architecture/decision/002-api-modules.md
+++ b/doc/architecture/decision/002-api-modules.md
@@ -17,7 +17,7 @@ business logic shouldn't change due to a Minecraft update.
## Decision
-Refined Storage 2 will have multiple API modules that have no dependency on Minecraft whatsoever.
+Refined Storage will have multiple API modules that have no dependency on Minecraft whatsoever.
These modules can depend on each other, but the dependency chain should be logical.
These API modules can be consumed by platform modules (to bundle them) [[1]](#1) and addon developers.
@@ -25,7 +25,7 @@ These API modules can be consumed by platform modules (to bundle them) [[1]](#1)
The platform modules [[1]](#1) are responsible for integrating the modules with Minecraft, by implementing interfaces on
their end that the API modules can use.
-The API modules have the name `refinedstorage2-{name}-api`.
+The API modules have the name `refinedstorage-{name}-api`.
## Consequences
diff --git a/doc/architecture/decision/003-the-platform-api-module.md b/doc/architecture/decision/003-the-platform-api-module.md
index 58349b1ef..d335110af 100644
--- a/doc/architecture/decision/003-the-platform-api-module.md
+++ b/doc/architecture/decision/003-the-platform-api-module.md
@@ -16,12 +16,12 @@ Refined Storage 1).
## Decision
-Refined Storage 2 will have a modloader-neutral (just like the common module) platform API module which addon mods can
+Refined Storage will have a modloader-neutral (just like the common module) platform API module which addon mods can
use to integrate with Refined Storage.
-Moreover, Refined Storage 2 itself will use this platform API module.
+Moreover, Refined Storage itself will use this platform API module.
-The module is named `refinedstorage2-platform-api`.
+The module is named `refinedstorage-platform-api`.
## Consequences
diff --git a/doc/architecture/decision/004-coverage-requirements.md b/doc/architecture/decision/004-coverage-requirements.md
index 8bb07452a..d7679dda5 100644
--- a/doc/architecture/decision/004-coverage-requirements.md
+++ b/doc/architecture/decision/004-coverage-requirements.md
@@ -20,7 +20,7 @@ Luckily, since our most important (business-logic) code resides in the API modul
our testing focus there and establish coverage requirements.
However, sometimes it is still advised to write a test for platform code, even if there are no coverage requirements for
-it. For that reason, the `refinedstorage2-platform-test` module exists, to provide helpers to deal with Minecraft code.
+it. For that reason, the `refinedstorage-platform-test` module exists, to provide helpers to deal with Minecraft code.
## Consequences
diff --git a/doc/architecture/decision/005-unit-testing.md b/doc/architecture/decision/005-unit-testing.md
index b1fc190fc..550e67451 100644
--- a/doc/architecture/decision/005-unit-testing.md
+++ b/doc/architecture/decision/005-unit-testing.md
@@ -11,7 +11,7 @@ Accepted
The coverage requirements [[1]](#1) for the API modules [[2]](#2) state that we need unit test coverage. Hence, we need
to clarify what "unit" in unit test means.
-The API modules in Refined Storage 2 are already disconnected from reality (Minecraft), so we need unit tests that
+The API modules in Refined Storage are already disconnected from reality (Minecraft), so we need unit tests that
closely mimick real situations and assert real behavior if we want to get any value out of them.
This eliminates the definition that most
@@ -19,7 +19,7 @@ people have of unit tests, which is to test "a single method" and to mock depend
## Decision
-Refined Storage 2 unit testing will follow a behavior driven approach, where "unit" in unit test means "unit of
+Refined Storage unit testing will follow a behavior driven approach, where "unit" in unit test means "unit of
behavior" and not "unit of method".
## Consequences
diff --git a/doc/architecture/decision/006-no-persistent-networks.md b/doc/architecture/decision/006-no-persistent-networks.md
index 37a5588d7..15e0c9ee5 100644
--- a/doc/architecture/decision/006-no-persistent-networks.md
+++ b/doc/architecture/decision/006-no-persistent-networks.md
@@ -18,9 +18,9 @@ with block entities in non-conventional ways.
## Decision
-Networks cannot be persisted in Refined Storage 2. They need to be loaded in memory.
+Networks cannot be persisted in Refined Storage. They need to be loaded in memory.
-Network nodes cannot be persisted in Refined Storage 2. All persistent data should be stored on corresponding the block
+Network nodes cannot be persisted in Refined Storage. All persistent data should be stored on corresponding the block
entity.
## Consequences
diff --git a/doc/architecture/decision/010-shared-storage.md b/doc/architecture/decision/010-shared-storage.md
index f4843306a..971450fd9 100644
--- a/doc/architecture/decision/010-shared-storage.md
+++ b/doc/architecture/decision/010-shared-storage.md
@@ -8,10 +8,10 @@ Accepted
## Context
-Refined Storage 2 has the concept of a storage channel. A storage channel is the highest-level storage of a network. It
+Refined Storage has the concept of a storage channel. A storage channel is the highest-level storage of a network. It
is used by other network devices to interact with the storage network.
-As Refined Storage 2 supports multiple resource types, we must decide how we partition those resource types.
+As Refined Storage supports multiple resource types, we must decide how we partition those resource types.
## Decision
diff --git a/refinedstorage-core-api/build.gradle b/refinedstorage-core-api/build.gradle
new file mode 100644
index 000000000..df2d720ac
--- /dev/null
+++ b/refinedstorage-core-api/build.gradle
@@ -0,0 +1,21 @@
+plugins {
+ id 'java-library'
+}
+
+archivesBaseName = 'refinedstorage-core-api'
+
+dependencies {
+ api libs.apiguardian
+ testImplementation libs.junit.api
+ testImplementation libs.junit.params
+ testRuntimeOnly libs.junit.engine
+ testImplementation libs.assertj
+}
+
+test {
+ useJUnitPlatform()
+}
+
+enableMutationTesting()
+enableJavadoc()
+enablePublishing()
diff --git a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/Action.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/Action.java
new file mode 100644
index 000000000..231ecf20d
--- /dev/null
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/Action.java
@@ -0,0 +1,9 @@
+package com.refinedmods.refinedstorage.api.core;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
+public enum Action {
+ SIMULATE,
+ EXECUTE
+}
diff --git a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/CoreValidations.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/CoreValidations.java
similarity index 97%
rename from refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/CoreValidations.java
rename to refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/CoreValidations.java
index a87965f75..ac7b681df 100644
--- a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/CoreValidations.java
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/CoreValidations.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core;
+package com.refinedmods.refinedstorage.api.core;
import java.util.Collection;
import java.util.Objects;
diff --git a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/FieldsAndMethodsAreNonnullByDefault.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/FieldsAndMethodsAreNonnullByDefault.java
similarity index 88%
rename from refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/FieldsAndMethodsAreNonnullByDefault.java
rename to refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/FieldsAndMethodsAreNonnullByDefault.java
index bda524b9c..75ea16faf 100644
--- a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/FieldsAndMethodsAreNonnullByDefault.java
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/FieldsAndMethodsAreNonnullByDefault.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core;
+package com.refinedmods.refinedstorage.api.core;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentAccessor.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentAccessor.java
similarity index 76%
rename from refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentAccessor.java
rename to refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentAccessor.java
index 770ef551b..08ca2b91f 100644
--- a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentAccessor.java
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentAccessor.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core.component;
+package com.refinedmods.refinedstorage.api.core.component;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMap.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMap.java
similarity index 93%
rename from refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMap.java
rename to refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMap.java
index 7cc9d3fdb..1019f5802 100644
--- a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMap.java
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMap.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core.component;
+package com.refinedmods.refinedstorage.api.core.component;
import java.util.Collection;
import java.util.Collections;
diff --git a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMapFactory.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java
similarity index 95%
rename from refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMapFactory.java
rename to refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java
index 370f57cf1..8f1579162 100644
--- a/refinedstorage2-core-api/src/main/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMapFactory.java
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactory.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core.component;
+package com.refinedmods.refinedstorage.api.core.component;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/package-info.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/package-info.java
new file mode 100644
index 000000000..612d3767c
--- /dev/null
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/component/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.core.component;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/package-info.java b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/package-info.java
new file mode 100644
index 000000000..e1a64fc25
--- /dev/null
+++ b/refinedstorage-core-api/src/main/java/com/refinedmods/refinedstorage/api/core/package-info.java
@@ -0,0 +1,5 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.core;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-core-api/src/main/resources/fabric.mod.json b/refinedstorage-core-api/src/main/resources/fabric.mod.json
new file mode 100644
index 000000000..28fec6e52
--- /dev/null
+++ b/refinedstorage-core-api/src/main/resources/fabric.mod.json
@@ -0,0 +1,19 @@
+{
+ "schemaVersion": 1,
+ "id": "refinedstorage-core-api",
+ "version": "${version}",
+ "name": "Refined Storage Core API",
+ "authors": [
+ "Refined Mods"
+ ],
+ "license": "MIT",
+ "environment": "*",
+ "custom": {
+ "modmenu": {
+ "parent": "refinedstorage",
+ "badges": [
+ "library"
+ ]
+ }
+ }
+}
diff --git a/refinedstorage2-core-api/src/test/java/com/refinedmods/refinedstorage2/api/core/CoreValidationsTest.java b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java
similarity index 99%
rename from refinedstorage2-core-api/src/test/java/com/refinedmods/refinedstorage2/api/core/CoreValidationsTest.java
rename to refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java
index 9c14a34d1..3bcb34c4a 100644
--- a/refinedstorage2-core-api/src/test/java/com/refinedmods/refinedstorage2/api/core/CoreValidationsTest.java
+++ b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/CoreValidationsTest.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core;
+package com.refinedmods.refinedstorage.api.core;
import java.util.List;
diff --git a/refinedstorage2-core-api/src/test/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMapFactoryTest.java b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactoryTest.java
similarity index 98%
rename from refinedstorage2-core-api/src/test/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMapFactoryTest.java
rename to refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactoryTest.java
index 4f89f4d38..c9d3701b1 100644
--- a/refinedstorage2-core-api/src/test/java/com/refinedmods/refinedstorage2/api/core/component/ComponentMapFactoryTest.java
+++ b/refinedstorage-core-api/src/test/java/com/refinedmods/refinedstorage/api/core/component/ComponentMapFactoryTest.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.core.component;
+package com.refinedmods.refinedstorage.api.core.component;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage-grid-api/build.gradle b/refinedstorage-grid-api/build.gradle
new file mode 100644
index 000000000..3cc5d8671
--- /dev/null
+++ b/refinedstorage-grid-api/build.gradle
@@ -0,0 +1,28 @@
+plugins {
+ id 'java-library'
+}
+
+archivesBaseName = 'refinedstorage-grid-api'
+
+dependencies {
+ api libs.apiguardian
+ api project(':refinedstorage-resource-api')
+ api project(':refinedstorage-core-api')
+ api project(':refinedstorage-storage-api')
+ api project(':refinedstorage-query-parser')
+ implementation libs.slf4j.api
+ testImplementation libs.junit.api
+ testImplementation libs.junit.params
+ testRuntimeOnly libs.junit.engine
+ testRuntimeOnly libs.slf4j.impl
+ testImplementation libs.assertj
+ testImplementation libs.mockito
+}
+
+test {
+ useJUnitPlatform()
+}
+
+enableMutationTesting()
+enableJavadoc()
+enablePublishing()
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridExtractMode.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridExtractMode.java
similarity index 88%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridExtractMode.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridExtractMode.java
index 1bfe449d2..bf915dbd5 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridExtractMode.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridExtractMode.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.operations;
+package com.refinedmods.refinedstorage.api.grid.operations;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridInsertMode.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridInsertMode.java
similarity index 83%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridInsertMode.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridInsertMode.java
index d714701ac..773dd5295 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridInsertMode.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridInsertMode.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.operations;
+package com.refinedmods.refinedstorage.api.grid.operations;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridOperations.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperations.java
similarity index 79%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridOperations.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperations.java
index 6aa6abb48..9e048c0ca 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridOperations.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperations.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.grid.operations;
+package com.refinedmods.refinedstorage.api.grid.operations;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage;
-import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.ExtractableStorage;
+import com.refinedmods.refinedstorage.api.storage.InsertableStorage;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridOperationsImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java
similarity index 85%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridOperationsImpl.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java
index bd4bd156e..5893dd500 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/operations/GridOperationsImpl.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/GridOperationsImpl.java
@@ -1,12 +1,12 @@
-package com.refinedmods.refinedstorage2.api.grid.operations;
+package com.refinedmods.refinedstorage.api.grid.operations;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage;
-import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;
-import com.refinedmods.refinedstorage2.api.storage.TransferHelper;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.ExtractableStorage;
+import com.refinedmods.refinedstorage.api.storage.InsertableStorage;
+import com.refinedmods.refinedstorage.api.storage.TransferHelper;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.function.ToLongFunction;
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/NoopGridOperations.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/NoopGridOperations.java
new file mode 100644
index 000000000..be2a80b8a
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/NoopGridOperations.java
@@ -0,0 +1,21 @@
+package com.refinedmods.refinedstorage.api.grid.operations;
+
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.ExtractableStorage;
+import com.refinedmods.refinedstorage.api.storage.InsertableStorage;
+
+public class NoopGridOperations implements GridOperations {
+ @Override
+ public boolean extract(final ResourceKey resource,
+ final GridExtractMode extractMode,
+ final InsertableStorage destination) {
+ return false;
+ }
+
+ @Override
+ public boolean insert(final ResourceKey resource,
+ final GridInsertMode insertMode,
+ final ExtractableStorage source) {
+ return false;
+ }
+}
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/package-info.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/package-info.java
new file mode 100644
index 000000000..713dcdeb5
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/operations/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.grid.operations;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParser.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParser.java
new file mode 100644
index 000000000..d188611e1
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParser.java
@@ -0,0 +1,12 @@
+package com.refinedmods.refinedstorage.api.grid.query;
+
+import com.refinedmods.refinedstorage.api.grid.view.GridResource;
+
+import java.util.function.Predicate;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
+public interface GridQueryParser {
+ Predicate parse(String query) throws GridQueryParserException;
+}
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserException.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserException.java
similarity index 85%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserException.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserException.java
index 7475e10f9..8c00f63dc 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserException.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserException.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.query;
+package com.refinedmods.refinedstorage.api.grid.query;
import javax.annotation.Nullable;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java
similarity index 87%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserImpl.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java
index db0208610..6a86c42ae 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserImpl.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImpl.java
@@ -1,21 +1,21 @@
-package com.refinedmods.refinedstorage2.api.grid.query;
-
-import com.refinedmods.refinedstorage2.api.grid.view.GridResource;
-import com.refinedmods.refinedstorage2.api.grid.view.GridResourceAttributeKey;
-import com.refinedmods.refinedstorage2.query.lexer.Lexer;
-import com.refinedmods.refinedstorage2.query.lexer.LexerException;
-import com.refinedmods.refinedstorage2.query.lexer.LexerTokenMappings;
-import com.refinedmods.refinedstorage2.query.lexer.Source;
-import com.refinedmods.refinedstorage2.query.lexer.Token;
-import com.refinedmods.refinedstorage2.query.lexer.TokenType;
-import com.refinedmods.refinedstorage2.query.parser.Parser;
-import com.refinedmods.refinedstorage2.query.parser.ParserException;
-import com.refinedmods.refinedstorage2.query.parser.ParserOperatorMappings;
-import com.refinedmods.refinedstorage2.query.parser.node.BinOpNode;
-import com.refinedmods.refinedstorage2.query.parser.node.LiteralNode;
-import com.refinedmods.refinedstorage2.query.parser.node.Node;
-import com.refinedmods.refinedstorage2.query.parser.node.ParenNode;
-import com.refinedmods.refinedstorage2.query.parser.node.UnaryOpNode;
+package com.refinedmods.refinedstorage.api.grid.query;
+
+import com.refinedmods.refinedstorage.api.grid.view.GridResource;
+import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey;
+import com.refinedmods.refinedstorage.query.lexer.Lexer;
+import com.refinedmods.refinedstorage.query.lexer.LexerException;
+import com.refinedmods.refinedstorage.query.lexer.LexerTokenMappings;
+import com.refinedmods.refinedstorage.query.lexer.Source;
+import com.refinedmods.refinedstorage.query.lexer.Token;
+import com.refinedmods.refinedstorage.query.lexer.TokenType;
+import com.refinedmods.refinedstorage.query.parser.Parser;
+import com.refinedmods.refinedstorage.query.parser.ParserException;
+import com.refinedmods.refinedstorage.query.parser.ParserOperatorMappings;
+import com.refinedmods.refinedstorage.query.parser.node.BinOpNode;
+import com.refinedmods.refinedstorage.query.parser.node.LiteralNode;
+import com.refinedmods.refinedstorage.query.parser.node.Node;
+import com.refinedmods.refinedstorage.query.parser.node.ParenNode;
+import com.refinedmods.refinedstorage.query.parser.node.UnaryOpNode;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/package-info.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/package-info.java
new file mode 100644
index 000000000..0fcf93531
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/query/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.grid.query;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResource.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResource.java
similarity index 77%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResource.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResource.java
index b2cc7a397..2407f4987 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResource.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResource.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import java.util.Optional;
import java.util.Set;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceAttributeKey.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceAttributeKey.java
similarity index 79%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceAttributeKey.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceAttributeKey.java
index 72cd94ca9..74504848d 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceAttributeKey.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceAttributeKey.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceFactory.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceFactory.java
similarity index 84%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceFactory.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceFactory.java
index 1b4ef0d60..14bde3f3b 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceFactory.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceFactory.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
import java.util.Optional;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridSortingDirection.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridSortingDirection.java
similarity index 75%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridSortingDirection.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridSortingDirection.java
index 26150e5b5..6b5e20ca8 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridSortingDirection.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridSortingDirection.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridSortingType.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridSortingType.java
similarity index 83%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridSortingType.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridSortingType.java
index 239398f6b..b7612f40f 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridSortingType.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridSortingType.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
import java.util.Comparator;
import java.util.function.Function;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridView.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java
similarity index 91%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridView.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java
index d8e5f3c10..d995757e9 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridView.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridView.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceList;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import java.util.List;
import java.util.Optional;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewBuilder.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewBuilder.java
similarity index 78%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewBuilder.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewBuilder.java
index 056234a13..9bd00df04 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewBuilder.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewBuilder.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import javax.annotation.Nullable;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewBuilderImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewBuilderImpl.java
similarity index 82%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewBuilderImpl.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewBuilderImpl.java
index 3ee9bd1e1..e38890ba5 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewBuilderImpl.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewBuilderImpl.java
@@ -1,9 +1,9 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceList;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import java.util.HashMap;
import java.util.Map;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java
similarity index 95%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewImpl.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java
index 412f5bb9c..abdf96a5c 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewImpl.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImpl.java
@@ -1,11 +1,11 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
-
-import com.refinedmods.refinedstorage2.api.core.CoreValidations;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceList;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+package com.refinedmods.refinedstorage.api.grid.view;
+
+import com.refinedmods.refinedstorage.api.core.CoreValidations;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/package-info.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/package-info.java
new file mode 100644
index 000000000..0471f3d61
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/view/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.grid.view;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcher.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcher.java
similarity index 80%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcher.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcher.java
index 1b070f92b..94379ffb2 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcher.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcher.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.grid.watcher;
+package com.refinedmods.refinedstorage.api.grid.watcher;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import javax.annotation.Nullable;
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java
new file mode 100644
index 000000000..3287bbc6b
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManager.java
@@ -0,0 +1,27 @@
+package com.refinedmods.refinedstorage.api.grid.watcher;
+
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
+
+import javax.annotation.Nullable;
+
+import org.apiguardian.api.API;
+
+/**
+ * This manager helps with attaching and detaching listeners to
+ * {@link com.refinedmods.refinedstorage.api.storage.channel.StorageChannel}s.
+ */
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.3")
+public interface GridWatcherManager {
+ void addWatcher(GridWatcher watcher,
+ Class extends Actor> actorType,
+ @Nullable StorageChannel storageChannel);
+
+ void attachAll(@Nullable StorageChannel storageChannel);
+
+ void removeWatcher(GridWatcher watcher, @Nullable StorageChannel storageChannel);
+
+ void detachAll(StorageChannel storageChannel);
+
+ void activeChanged(boolean active);
+}
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherManagerImpl.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java
similarity index 94%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherManagerImpl.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java
index a5b85402f..1b5f8b937 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherManagerImpl.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImpl.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.grid.watcher;
+package com.refinedmods.refinedstorage.api.grid.watcher;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.HashMap;
import java.util.Map;
diff --git a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherRegistration.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java
similarity index 83%
rename from refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherRegistration.java
rename to refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java
index a7a54ef0e..7fc89b970 100644
--- a/refinedstorage2-grid-api/src/main/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherRegistration.java
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherRegistration.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.grid.watcher;
+package com.refinedmods.refinedstorage.api.grid.watcher;
-import com.refinedmods.refinedstorage2.api.resource.list.listenable.ResourceListListener;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import javax.annotation.Nullable;
diff --git a/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/package-info.java b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/package-info.java
new file mode 100644
index 000000000..685602060
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/java/com/refinedmods/refinedstorage/api/grid/watcher/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.grid.watcher;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-grid-api/src/main/resources/fabric.mod.json b/refinedstorage-grid-api/src/main/resources/fabric.mod.json
new file mode 100644
index 000000000..30ce310b3
--- /dev/null
+++ b/refinedstorage-grid-api/src/main/resources/fabric.mod.json
@@ -0,0 +1,19 @@
+{
+ "schemaVersion": 1,
+ "id": "refinedstorage-grid-api",
+ "version": "${version}",
+ "name": "Refined Storage Grid API",
+ "authors": [
+ "Refined Mods"
+ ],
+ "license": "MIT",
+ "environment": "*",
+ "custom": {
+ "modmenu": {
+ "parent": "refinedstorage",
+ "badges": [
+ "library"
+ ]
+ }
+ }
+}
diff --git a/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/TestResource.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/TestResource.java
new file mode 100644
index 000000000..f33d3cbe5
--- /dev/null
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/TestResource.java
@@ -0,0 +1,10 @@
+package com.refinedmods.refinedstorage.api.grid;
+
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+
+public enum TestResource implements ResourceKey {
+ A,
+ B,
+ C,
+ D
+}
diff --git a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImplTest.java
similarity index 95%
rename from refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserImplTest.java
rename to refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImplTest.java
index 2951c16e4..21879ac19 100644
--- a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/query/GridQueryParserImplTest.java
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/query/GridQueryParserImplTest.java
@@ -1,12 +1,12 @@
-package com.refinedmods.refinedstorage2.api.grid.query;
-
-import com.refinedmods.refinedstorage2.api.grid.view.FakeGridResourceAttributeKeys;
-import com.refinedmods.refinedstorage2.api.grid.view.GridResource;
-import com.refinedmods.refinedstorage2.api.grid.view.GridResourceAttributeKey;
-import com.refinedmods.refinedstorage2.api.grid.view.GridView;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.query.lexer.LexerTokenMappings;
-import com.refinedmods.refinedstorage2.query.parser.ParserOperatorMappings;
+package com.refinedmods.refinedstorage.api.grid.query;
+
+import com.refinedmods.refinedstorage.api.grid.view.FakeGridResourceAttributeKeys;
+import com.refinedmods.refinedstorage.api.grid.view.GridResource;
+import com.refinedmods.refinedstorage.api.grid.view.GridResourceAttributeKey;
+import com.refinedmods.refinedstorage.api.grid.view.GridView;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.query.lexer.LexerTokenMappings;
+import com.refinedmods.refinedstorage.query.parser.ParserOperatorMappings;
import java.util.Map;
import java.util.Optional;
diff --git a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/service/GridOperationsImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java
similarity index 92%
rename from refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/service/GridOperationsImplTest.java
rename to refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java
index fb8a08f09..e6e5647d5 100644
--- a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/service/GridOperationsImplTest.java
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/service/GridOperationsImplTest.java
@@ -1,19 +1,19 @@
-package com.refinedmods.refinedstorage2.api.grid.service;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode;
-import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode;
-import com.refinedmods.refinedstorage2.api.grid.operations.GridOperationsImpl;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelImpl;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl;
+package com.refinedmods.refinedstorage.api.grid.service;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.grid.operations.GridExtractMode;
+import com.refinedmods.refinedstorage.api.grid.operations.GridInsertMode;
+import com.refinedmods.refinedstorage.api.grid.operations.GridOperationsImpl;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
@@ -21,8 +21,8 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.A;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.B;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.A;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.B;
import static org.assertj.core.api.Assertions.assertThat;
class GridOperationsImplTest {
diff --git a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/FakeGridResourceAttributeKeys.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/FakeGridResourceAttributeKeys.java
similarity index 86%
rename from refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/FakeGridResourceAttributeKeys.java
rename to refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/FakeGridResourceAttributeKeys.java
index 4edaa8e8c..4a8b7a59e 100644
--- a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/FakeGridResourceAttributeKeys.java
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/FakeGridResourceAttributeKeys.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
import java.util.Map;
import java.util.Set;
diff --git a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceImpl.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceImpl.java
similarity index 86%
rename from refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceImpl.java
rename to refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceImpl.java
index 9b4581044..28ef989e6 100644
--- a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/GridResourceImpl.java
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridResourceImpl.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+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;
import java.util.Map;
diff --git a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java
similarity index 97%
rename from refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewImplTest.java
rename to refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java
index 6bbf024f0..32679b515 100644
--- a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/view/GridViewImplTest.java
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/view/GridViewImplTest.java
@@ -1,9 +1,9 @@
-package com.refinedmods.refinedstorage2.api.grid.view;
+package com.refinedmods.refinedstorage.api.grid.view;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceList;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
import java.util.Comparator;
import java.util.Optional;
@@ -12,10 +12,10 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.A;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.B;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.C;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.D;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.A;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.B;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.C;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.D;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
diff --git a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherManagerImplTest.java b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java
similarity index 89%
rename from refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherManagerImplTest.java
rename to refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java
index 77c5f2ced..efcfbf5da 100644
--- a/refinedstorage2-grid-api/src/test/java/com/refinedmods/refinedstorage2/api/grid/watcher/GridWatcherManagerImplTest.java
+++ b/refinedstorage-grid-api/src/test/java/com/refinedmods/refinedstorage/api/grid/watcher/GridWatcherManagerImplTest.java
@@ -1,19 +1,19 @@
-package com.refinedmods.refinedstorage2.api.grid.watcher;
+package com.refinedmods.refinedstorage.api.grid.watcher;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelImpl;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.A;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.B;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.C;
-import static com.refinedmods.refinedstorage2.api.grid.TestResource.D;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.A;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.B;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.C;
+import static com.refinedmods.refinedstorage.api.grid.TestResource.D;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
diff --git a/refinedstorage-network-api/build.gradle b/refinedstorage-network-api/build.gradle
new file mode 100644
index 000000000..6f39e6024
--- /dev/null
+++ b/refinedstorage-network-api/build.gradle
@@ -0,0 +1,16 @@
+plugins {
+ id 'java-library'
+}
+
+archivesBaseName = 'refinedstorage-network-api'
+
+dependencies {
+ api libs.apiguardian
+ api project(':refinedstorage-core-api')
+ api project(':refinedstorage-resource-api')
+ api project(':refinedstorage-storage-api')
+ api project(':refinedstorage-grid-api')
+}
+
+enableJavadoc()
+enablePublishing()
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/ConnectionProvider.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/ConnectionProvider.java
new file mode 100644
index 000000000..7283b7523
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/ConnectionProvider.java
@@ -0,0 +1,15 @@
+package com.refinedmods.refinedstorage.api.network;
+
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+
+import java.util.List;
+import java.util.Set;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
+public interface ConnectionProvider {
+ Connections findConnections(NetworkNodeContainer pivot, Set existingConnections);
+
+ List sortDeterministically(Set containers);
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/Connections.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/Connections.java
similarity index 84%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/Connections.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/Connections.java
index 9456db1de..1c242fe14 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/Connections.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/Connections.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network;
+package com.refinedmods.refinedstorage.api.network;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.Collections;
import java.util.Set;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/Network.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/Network.java
new file mode 100644
index 000000000..58e1c2995
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/Network.java
@@ -0,0 +1,21 @@
+package com.refinedmods.refinedstorage.api.network;
+
+import com.refinedmods.refinedstorage.api.core.component.ComponentAccessor;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+
+import java.util.Set;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
+public interface Network extends ComponentAccessor {
+ void addContainer(NetworkNodeContainer container);
+
+ void removeContainer(NetworkNodeContainer container);
+
+ void remove();
+
+ void split(Set networks);
+
+ void merge(Network network);
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/NetworkBuilder.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/NetworkBuilder.java
similarity index 90%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/NetworkBuilder.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/NetworkBuilder.java
index e4bedcf21..13e07f3f0 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/NetworkBuilder.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/NetworkBuilder.java
@@ -1,11 +1,11 @@
-package com.refinedmods.refinedstorage2.api.network;
+package com.refinedmods.refinedstorage.api.network;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import org.apiguardian.api.API;
/**
- * Manages the network state of a {@link com.refinedmods.refinedstorage2.api.network.node.NetworkNode}.
+ * Manages the network state of a {@link com.refinedmods.refinedstorage.api.network.node.NetworkNode}.
* Performs merge, split and remove operations as necessary.
*/
@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/NetworkComponent.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/NetworkComponent.java
similarity index 77%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/NetworkComponent.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/NetworkComponent.java
index 6795743a1..d2d409754 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/NetworkComponent.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/NetworkComponent.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network;
+package com.refinedmods.refinedstorage.api.network;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.Set;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyNetworkComponent.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyNetworkComponent.java
new file mode 100644
index 000000000..ccc7253db
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyNetworkComponent.java
@@ -0,0 +1,9 @@
+package com.refinedmods.refinedstorage.api.network.energy;
+
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.1")
+public interface EnergyNetworkComponent extends NetworkComponent, EnergyProvider {
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/energy/EnergyProvider.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyProvider.java
similarity index 83%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/energy/EnergyProvider.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyProvider.java
index 8af73c121..984f856d8 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/energy/EnergyProvider.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyProvider.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.energy;
+package com.refinedmods.refinedstorage.api.network.energy;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/energy/EnergyStorage.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyStorage.java
similarity index 86%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/energy/EnergyStorage.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyStorage.java
index 858c86c4a..153e001eb 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/energy/EnergyStorage.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/EnergyStorage.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network.energy;
+package com.refinedmods.refinedstorage.api.network.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
+import com.refinedmods.refinedstorage.api.core.Action;
import org.apiguardian.api.API;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/package-info.java
new file mode 100644
index 000000000..ea331cd8e
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/energy/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.energy;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/GraphNetworkComponent.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/GraphNetworkComponent.java
similarity index 82%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/GraphNetworkComponent.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/GraphNetworkComponent.java
index 4da9fa7f0..03c3aed19 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/GraphNetworkComponent.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/GraphNetworkComponent.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.node;
+package com.refinedmods.refinedstorage.api.network.node;
-import com.refinedmods.refinedstorage2.api.network.NetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.Set;
import javax.annotation.Nullable;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/NetworkNode.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/NetworkNode.java
new file mode 100644
index 000000000..1100f0d8c
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/NetworkNode.java
@@ -0,0 +1,15 @@
+package com.refinedmods.refinedstorage.api.network.node;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+
+import javax.annotation.Nullable;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
+public interface NetworkNode {
+ @Nullable
+ Network getNetwork();
+
+ void setNetwork(@Nullable Network network);
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/NetworkNodeActor.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/NetworkNodeActor.java
new file mode 100644
index 000000000..43f7567b9
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/NetworkNodeActor.java
@@ -0,0 +1,13 @@
+package com.refinedmods.refinedstorage.api.network.node;
+
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1")
+public record NetworkNodeActor(NetworkNode networkNode) implements Actor {
+ @Override
+ public String getName() {
+ return networkNode.getClass().getName();
+ }
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/container/NetworkNodeContainer.java
similarity index 82%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/container/NetworkNodeContainer.java
index de14588a4..1b414c0a2 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/container/NetworkNodeContainer.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network.node.container;
+package com.refinedmods.refinedstorage.api.network.node.container;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
import javax.annotation.Nullable;
@@ -18,7 +18,7 @@ public interface NetworkNodeContainer {
* If it changes after adding it into the graph, the container would not be removed from the key index when the
* container is removed!
* The container can be queried by
- * {@link com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent#getContainer(Object)}.
+ * {@link com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent#getContainer(Object)}.
*
* @return the key, or null if indexing is not required
*/
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/container/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/container/package-info.java
new file mode 100644
index 000000000..8c0763a46
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/container/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.node.container;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/exporter/ExporterTransferStrategy.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/exporter/ExporterTransferStrategy.java
new file mode 100644
index 000000000..6ce09c613
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/exporter/ExporterTransferStrategy.java
@@ -0,0 +1,15 @@
+package com.refinedmods.refinedstorage.api.network.node.exporter;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+import org.apiguardian.api.API;
+
+/**
+ * A transfer strategy that transfers a resource from the network to a destination.
+ */
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4")
+public interface ExporterTransferStrategy {
+ boolean transfer(ResourceKey resource, Actor actor, Network network);
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/exporter/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/exporter/package-info.java
new file mode 100644
index 000000000..ce347aea1
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/exporter/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.node.exporter;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/externalstorage/ExternalStorageProviderFactory.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/externalstorage/ExternalStorageProviderFactory.java
new file mode 100644
index 000000000..69340873a
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/externalstorage/ExternalStorageProviderFactory.java
@@ -0,0 +1,20 @@
+package com.refinedmods.refinedstorage.api.network.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider;
+
+import java.util.Optional;
+
+import org.apiguardian.api.API;
+
+/**
+ * Provides the {@link com.refinedmods.refinedstorage.api.storage.external.ExternalStorage}
+ * with an {@link ExternalStorageProvider}.
+ */
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4")
+@FunctionalInterface
+public interface ExternalStorageProviderFactory {
+ /**
+ * @return the external storage provider, if present
+ */
+ Optional create();
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/externalstorage/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/externalstorage/package-info.java
new file mode 100644
index 000000000..0042178e8
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/externalstorage/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/importer/ImporterTransferStrategy.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/importer/ImporterTransferStrategy.java
new file mode 100644
index 000000000..da68a629c
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/importer/ImporterTransferStrategy.java
@@ -0,0 +1,15 @@
+package com.refinedmods.refinedstorage.api.network.node.importer;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.resource.filter.Filter;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+import org.apiguardian.api.API;
+
+/**
+ * An importer transfer strategy transfers resources from a source to the network.
+ */
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1")
+public interface ImporterTransferStrategy {
+ boolean transfer(Filter filter, Actor actor, Network network);
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/importer/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/importer/package-info.java
new file mode 100644
index 000000000..6fd0ac2a4
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/importer/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.node.importer;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/package-info.java
new file mode 100644
index 000000000..e359ac89c
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.node;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/Task.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/Task.java
new file mode 100644
index 000000000..2812ed456
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/Task.java
@@ -0,0 +1,9 @@
+package com.refinedmods.refinedstorage.api.network.node.task;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.11")
+@FunctionalInterface
+public interface Task {
+ boolean run(C context);
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/task/TaskExecutor.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/TaskExecutor.java
similarity index 79%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/task/TaskExecutor.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/TaskExecutor.java
index 84ebec8ee..f29d55b0f 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/task/TaskExecutor.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/TaskExecutor.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.node.task;
+package com.refinedmods.refinedstorage.api.network.node.task;
import java.util.List;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/package-info.java
new file mode 100644
index 000000000..4499b3e43
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/node/task/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.node.task;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/package-info.java
new file mode 100644
index 000000000..deab398e8
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/Permission.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/Permission.java
new file mode 100644
index 000000000..8236a6d90
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/Permission.java
@@ -0,0 +1,7 @@
+package com.refinedmods.refinedstorage.api.network.security;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
+public interface Permission {
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityActor.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityActor.java
new file mode 100644
index 000000000..5c21a4ab1
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityActor.java
@@ -0,0 +1,7 @@
+package com.refinedmods.refinedstorage.api.network.security;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
+public interface SecurityActor {
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityDecision.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityDecision.java
similarity index 84%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityDecision.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityDecision.java
index 74f0ab94f..b990df0f4 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityDecision.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityDecision.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.security;
+package com.refinedmods.refinedstorage.api.network.security;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityDecisionProvider.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityDecisionProvider.java
similarity index 89%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityDecisionProvider.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityDecisionProvider.java
index eb4f3ff1f..bed8aa7bf 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityDecisionProvider.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityDecisionProvider.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.security;
+package com.refinedmods.refinedstorage.api.network.security;
import org.apiguardian.api.API;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityNetworkComponent.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityNetworkComponent.java
new file mode 100644
index 000000000..a6117412a
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityNetworkComponent.java
@@ -0,0 +1,12 @@
+package com.refinedmods.refinedstorage.api.network.security;
+
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.5")
+public interface SecurityNetworkComponent extends NetworkComponent {
+ boolean isAllowed(Permission permission, SecurityActor actor);
+
+ boolean contains(SecurityNetworkComponent component);
+}
diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityPolicy.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java
similarity index 90%
rename from refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityPolicy.java
rename to refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java
index 0f997651f..0f93e29c4 100644
--- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/security/SecurityPolicy.java
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/SecurityPolicy.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.security;
+package com.refinedmods.refinedstorage.api.network.security;
import java.util.Collections;
import java.util.Set;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/package-info.java
new file mode 100644
index 000000000..85f3f48eb
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/security/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.security;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java
new file mode 100644
index 000000000..7e46b6529
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageNetworkComponent.java
@@ -0,0 +1,18 @@
+package com.refinedmods.refinedstorage.api.network.storage;
+
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
+
+import java.util.List;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.1")
+public interface StorageNetworkComponent extends NetworkComponent, StorageChannel {
+ List getResources(Class extends Actor> actorType);
+
+ boolean contains(Storage storage);
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java
new file mode 100644
index 000000000..17ac3a481
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/StorageProvider.java
@@ -0,0 +1,26 @@
+package com.refinedmods.refinedstorage.api.network.storage;
+
+import com.refinedmods.refinedstorage.api.storage.Storage;
+
+import org.apiguardian.api.API;
+
+/**
+ * Implement this on {@link com.refinedmods.refinedstorage.api.network.node.NetworkNode}s that can provide a storage
+ * to the network.
+ * Never modify a {@link com.refinedmods.refinedstorage.api.storage.channel.StorageChannel}
+ * from a {@link com.refinedmods.refinedstorage.api.network.node.NetworkNode} directly.
+ * Use this interface to help you manage the lifecycle of your storage, to ensure that your storage is added or removed
+ * in the right cases.
+ * Use a {@link com.refinedmods.refinedstorage.api.storage.composite.CompositeStorage} to conditionally enable/disable
+ * a provided {@link Storage}.
+ */
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2")
+public interface StorageProvider {
+ /**
+ * This method is called when a {@link com.refinedmods.refinedstorage.api.network.node.NetworkNode} is added or
+ * removed from a network.
+ *
+ * @return the storage
+ */
+ Storage getStorage();
+}
diff --git a/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/package-info.java b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/package-info.java
new file mode 100644
index 000000000..d6f614a79
--- /dev/null
+++ b/refinedstorage-network-api/src/main/java/com/refinedmods/refinedstorage/api/network/storage/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.storage;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-api/src/main/resources/fabric.mod.json b/refinedstorage-network-api/src/main/resources/fabric.mod.json
new file mode 100644
index 000000000..cf67514dd
--- /dev/null
+++ b/refinedstorage-network-api/src/main/resources/fabric.mod.json
@@ -0,0 +1,19 @@
+{
+ "schemaVersion": 1,
+ "id": "refinedstorage-network-api",
+ "version": "${version}",
+ "name": "Refined Storage Network API",
+ "authors": [
+ "Refined Mods"
+ ],
+ "license": "MIT",
+ "environment": "*",
+ "custom": {
+ "modmenu": {
+ "parent": "refinedstorage",
+ "badges": [
+ "library"
+ ]
+ }
+ }
+}
diff --git a/refinedstorage-network-test/build.gradle b/refinedstorage-network-test/build.gradle
new file mode 100644
index 000000000..beffa9c07
--- /dev/null
+++ b/refinedstorage-network-test/build.gradle
@@ -0,0 +1,25 @@
+plugins {
+ id 'java-library'
+}
+
+archivesBaseName = 'refinedstorage-network-test'
+
+dependencies {
+ api project(':refinedstorage-network-api')
+ api project(':refinedstorage-network')
+ api project(':refinedstorage-storage-api')
+ api project(':refinedstorage-resource-api')
+ api project(':refinedstorage-core-api')
+ api project(':refinedstorage-grid-api')
+ implementation libs.junit.api
+ testRuntimeOnly libs.junit.engine
+ testImplementation libs.assertj
+}
+
+test {
+ useJUnitPlatform()
+}
+
+enableMutationTesting()
+enableJavadoc()
+enablePublishing()
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/AddNetworkNode.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/AddNetworkNode.java
similarity index 90%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/AddNetworkNode.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/AddNetworkNode.java
index b2e8f39d8..1fbdb0d6c 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/AddNetworkNode.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/AddNetworkNode.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetwork.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetwork.java
similarity index 85%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetwork.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetwork.java
index 2e75205f6..23ee838a1 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetwork.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetwork.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkEnergyComponent.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkEnergyComponent.java
similarity index 85%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkEnergyComponent.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkEnergyComponent.java
index 7bbf607e8..0d6067422 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkEnergyComponent.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkEnergyComponent.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkSecurityComponent.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkSecurityComponent.java
similarity index 85%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkSecurityComponent.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkSecurityComponent.java
index d0b87298c..b8aea8c8a 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkSecurityComponent.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkSecurityComponent.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkStorageComponent.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkStorageComponent.java
similarity index 85%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkStorageComponent.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkStorageComponent.java
index a78bd1f77..0442f21c0 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/InjectNetworkStorageComponent.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/InjectNetworkStorageComponent.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTest.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTest.java
new file mode 100644
index 000000000..bf3070406
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTest.java
@@ -0,0 +1,51 @@
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayInputNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
+import com.refinedmods.refinedstorage.network.test.nodefactory.ControllerNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.DetectorNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.ExporterNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.ExternalStorageNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.GridNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.ImporterNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.InterfaceNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.RelayInputNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.RelayOutputNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.SimpleNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.StorageNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.StorageTransferNetworkNodeFactory;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.junit.jupiter.api.extension.ExtendWith;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@ExtendWith(NetworkTestExtension.class)
+@RegisterNetworkNode(value = ControllerNetworkNodeFactory.class, clazz = ControllerNetworkNode.class)
+@RegisterNetworkNode(value = StorageNetworkNodeFactory.class, clazz = StorageNetworkNode.class)
+@RegisterNetworkNode(value = ExporterNetworkNodeFactory.class, clazz = ExporterNetworkNode.class)
+@RegisterNetworkNode(value = GridNetworkNodeFactory.class, clazz = GridNetworkNode.class)
+@RegisterNetworkNode(value = ImporterNetworkNodeFactory.class, clazz = ImporterNetworkNode.class)
+@RegisterNetworkNode(value = SimpleNetworkNodeFactory.class, clazz = SimpleNetworkNode.class)
+@RegisterNetworkNode(value = InterfaceNetworkNodeFactory.class, clazz = InterfaceNetworkNode.class)
+@RegisterNetworkNode(value = ExternalStorageNetworkNodeFactory.class, clazz = ExternalStorageNetworkNode.class)
+@RegisterNetworkNode(value = DetectorNetworkNodeFactory.class, clazz = DetectorNetworkNode.class)
+@RegisterNetworkNode(value = RelayInputNetworkNodeFactory.class, clazz = RelayInputNetworkNode.class)
+@RegisterNetworkNode(value = RelayOutputNetworkNodeFactory.class, clazz = RelayOutputNetworkNode.class)
+@RegisterNetworkNode(value = StorageTransferNetworkNodeFactory.class, clazz = StorageTransferNetworkNode.class)
+public @interface NetworkTest {
+}
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtension.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java
similarity index 91%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtension.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java
index dbcb0be5a..3e9a33b7a 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtension.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtension.java
@@ -1,16 +1,16 @@
-package com.refinedmods.refinedstorage2.network.test;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
-import com.refinedmods.refinedstorage2.api.network.impl.NetworkImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.energy.EnergyStorageImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.controller.ControllerNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.NetworkNodeFactory;
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.network.impl.NetworkImpl;
+import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.network.test.nodefactory.NetworkNodeFactory;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestFixtures.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestFixtures.java
new file mode 100644
index 000000000..ba433377d
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/NetworkTestFixtures.java
@@ -0,0 +1,45 @@
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyNetworkComponentImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.GraphNetworkComponentImpl;
+import com.refinedmods.refinedstorage.api.network.impl.security.SecurityNetworkComponentImpl;
+import com.refinedmods.refinedstorage.api.network.impl.storage.StorageNetworkComponentImpl;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl;
+import com.refinedmods.refinedstorage.network.test.fake.FakePermissions;
+
+import java.util.LinkedHashMap;
+
+public final class NetworkTestFixtures {
+ public static final ComponentMapFactory NETWORK_COMPONENT_MAP_FACTORY =
+ new ComponentMapFactory<>();
+
+ static {
+ NETWORK_COMPONENT_MAP_FACTORY.addFactory(
+ EnergyNetworkComponent.class,
+ network -> new EnergyNetworkComponentImpl()
+ );
+ NETWORK_COMPONENT_MAP_FACTORY.addFactory(
+ GraphNetworkComponent.class,
+ GraphNetworkComponentImpl::new
+ );
+ NETWORK_COMPONENT_MAP_FACTORY.addFactory(
+ StorageNetworkComponent.class,
+ network -> new StorageNetworkComponentImpl(new ResourceListImpl(new LinkedHashMap<>()))
+ );
+ NETWORK_COMPONENT_MAP_FACTORY.addFactory(
+ SecurityNetworkComponent.class,
+ network -> new SecurityNetworkComponentImpl(SecurityPolicy.of(FakePermissions.ALLOW_BY_DEFAULT))
+ );
+ }
+
+ private NetworkTestFixtures() {
+ }
+}
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/RegisterNetworkNode.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/RegisterNetworkNode.java
new file mode 100644
index 000000000..d436ee1fc
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/RegisterNetworkNode.java
@@ -0,0 +1,19 @@
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.network.test.nodefactory.NetworkNodeFactory;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Repeatable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Repeatable(RegisterNetworkNodes.class)
+public @interface RegisterNetworkNode {
+ Class extends NetworkNodeFactory> value();
+
+ Class extends NetworkNode> clazz();
+}
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/RegisterNetworkNodes.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/RegisterNetworkNodes.java
similarity index 84%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/RegisterNetworkNodes.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/RegisterNetworkNodes.java
index 216fb3ef8..07c123c01 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/RegisterNetworkNodes.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/RegisterNetworkNodes.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/SetupNetwork.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/SetupNetwork.java
similarity index 90%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/SetupNetwork.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/SetupNetwork.java
index 566fc4889..5793676c0 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/SetupNetwork.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/SetupNetwork.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/SetupNetworks.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/SetupNetworks.java
similarity index 85%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/SetupNetworks.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/SetupNetworks.java
index 409d5b997..7af5bf055 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/SetupNetworks.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/SetupNetworks.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeActor.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeActor.java
new file mode 100644
index 000000000..8cc2bb82a
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeActor.java
@@ -0,0 +1,15 @@
+package com.refinedmods.refinedstorage.network.test.fake;
+
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+public final class FakeActor implements Actor {
+ public static final FakeActor INSTANCE = new FakeActor();
+
+ private FakeActor() {
+ }
+
+ @Override
+ public String getName() {
+ return "Fake";
+ }
+}
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakePermissions.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakePermissions.java
new file mode 100644
index 000000000..ce1cd2fbf
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakePermissions.java
@@ -0,0 +1,7 @@
+package com.refinedmods.refinedstorage.network.test.fake;
+
+import com.refinedmods.refinedstorage.api.network.security.Permission;
+
+public enum FakePermissions implements Permission {
+ ALLOW_BY_DEFAULT, OTHER, OTHER2
+}
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeResources.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeResources.java
new file mode 100644
index 000000000..ad0726c6f
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeResources.java
@@ -0,0 +1,13 @@
+package com.refinedmods.refinedstorage.network.test.fake;
+
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+
+public enum FakeResources implements ResourceKey {
+ A,
+ A_ALTERNATIVE,
+ A_ALTERNATIVE2,
+ B,
+ B_ALTERNATIVE,
+ C,
+ D
+}
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeSecurityActors.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeSecurityActors.java
new file mode 100644
index 000000000..cff73542a
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/FakeSecurityActors.java
@@ -0,0 +1,7 @@
+package com.refinedmods.refinedstorage.network.test.fake;
+
+import com.refinedmods.refinedstorage.api.network.security.SecurityActor;
+
+public enum FakeSecurityActors implements SecurityActor {
+ A, B, C
+}
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/package-info.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/package-info.java
new file mode 100644
index 000000000..99740d1a9
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/fake/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.network.test.fake;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/AbstractNetworkNodeFactory.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java
similarity index 75%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/AbstractNetworkNodeFactory.java
rename to refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java
index 995a66a29..3f39a02c6 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/AbstractNetworkNodeFactory.java
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/AbstractNetworkNodeFactory.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.network.test.nodefactory;
+package com.refinedmods.refinedstorage.network.test.nodefactory;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
+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;
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
new file mode 100644
index 000000000..cc1abcb17
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ControllerNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..3b6f64a86
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/DetectorNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..b20ec5adb
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExporterNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..711c734c9
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ExternalStorageNetworkNodeFactory.java
@@ -0,0 +1,20 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ final ExternalStorageNetworkNode externalStorage = new ExternalStorageNetworkNode(
+ getEnergyUsage(properties),
+ () -> 0L
+ );
+ externalStorage.setTrackingRepository(new InMemoryTrackedStorageRepository());
+ return externalStorage;
+ }
+}
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
new file mode 100644
index 000000000..d883b3dc9
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/GridNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..140166c81
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/ImporterNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..df491a059
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/InterfaceNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..aac0d307e
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/NetworkNodeFactory.java
@@ -0,0 +1,11 @@
+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);
+}
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
new file mode 100644
index 000000000..704abcefa
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayInputNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..60305e8f2
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/RelayOutputNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..cc59936b1
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/SimpleNetworkNodeFactory.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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) {
+ 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
new file mode 100644
index 000000000..e36cc4722
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageNetworkNodeFactory.java
@@ -0,0 +1,23 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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;
+
+public class StorageNetworkNodeFactory extends AbstractNetworkNodeFactory {
+ public static final String PROPERTY_ENERGY_USAGE_PER_STORAGE = "energy_usage_per_storage";
+ public static final String PROPERTY_SIZE = "size";
+
+ @Override
+ protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, 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(
+ getEnergyUsage(properties),
+ energyUsagePerStorage,
+ size
+ );
+ }
+}
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
new file mode 100644
index 000000000..31405d6c0
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/StorageTransferNetworkNodeFactory.java
@@ -0,0 +1,23 @@
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+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;
+
+public class StorageTransferNetworkNodeFactory extends AbstractNetworkNodeFactory {
+ public static final String PROPERTY_ENERGY_USAGE_PER_STORAGE = "energy_usage_per_storage";
+ public static final String PROPERTY_SIZE = "size";
+
+ @Override
+ protected AbstractNetworkNode innerCreate(final AddNetworkNode ctx, 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(
+ getEnergyUsage(properties),
+ energyUsagePerStorage,
+ size
+ );
+ }
+}
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/package-info.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/package-info.java
new file mode 100644
index 000000000..406166594
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/nodefactory/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.network.test.nodefactory;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/package-info.java b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/package-info.java
new file mode 100644
index 000000000..91b976457
--- /dev/null
+++ b/refinedstorage-network-test/src/main/java/com/refinedmods/refinedstorage/network/test/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/InheritanceNetworkTestExtensionTest.java b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/InheritanceNetworkTestExtensionTest.java
similarity index 77%
rename from refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/InheritanceNetworkTestExtensionTest.java
rename to refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/InheritanceNetworkTestExtensionTest.java
index 9701c7175..9e03379d9 100644
--- a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/InheritanceNetworkTestExtensionTest.java
+++ b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/InheritanceNetworkTestExtensionTest.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.network.test;
+package com.refinedmods.refinedstorage.network.test;
-import com.refinedmods.refinedstorage2.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.Network;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkNodeFactoryTest.java b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkNodeFactoryTest.java
new file mode 100644
index 000000000..55612ee4d
--- /dev/null
+++ b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkNodeFactoryTest.java
@@ -0,0 +1,53 @@
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.detector.DetectorNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.exporter.ExporterNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.importer.ImporterNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayInputNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayOutputNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
+
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@NetworkTest
+@SetupNetwork
+class NetworkNodeFactoryTest {
+ @AddNetworkNode
+ ControllerNetworkNode controller;
+ @AddNetworkNode
+ ExporterNetworkNode exporter;
+ @AddNetworkNode
+ GridNetworkNode grid;
+ @AddNetworkNode
+ ImporterNetworkNode importer;
+ @AddNetworkNode
+ SimpleNetworkNode simple;
+ @AddNetworkNode
+ StorageNetworkNode storage;
+ @AddNetworkNode
+ InterfaceNetworkNode interfaceNode;
+ @AddNetworkNode
+ ExternalStorageNetworkNode externalStorage;
+ @AddNetworkNode
+ DetectorNetworkNode detector;
+ @AddNetworkNode
+ RelayInputNetworkNode relayInput;
+ @AddNetworkNode
+ RelayOutputNetworkNode relayOutput;
+ @AddNetworkNode
+ StorageTransferNetworkNode storageTransfer;
+
+ @Test
+ void testInitialization() {
+ // Assert
+ assertThat(this).hasNoNullFieldsOrProperties();
+ }
+}
diff --git a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java
similarity index 85%
rename from refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java
rename to refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java
index 7f75d9e2d..32a428b98 100644
--- a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java
+++ b/refinedstorage-network-test/src/test/java/com/refinedmods/refinedstorage/network/test/NetworkTestExtensionTest.java
@@ -1,16 +1,16 @@
-package com.refinedmods.refinedstorage2.network.test;
-
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.SimpleNetworkNodeFactory;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.StorageNetworkNodeFactory;
+package com.refinedmods.refinedstorage.network.test;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.impl.node.SimpleNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.SimpleNetworkNodeFactory;
+import com.refinedmods.refinedstorage.network.test.nodefactory.StorageNetworkNodeFactory;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage-network/build.gradle b/refinedstorage-network/build.gradle
new file mode 100644
index 000000000..4f2b3edab
--- /dev/null
+++ b/refinedstorage-network/build.gradle
@@ -0,0 +1,28 @@
+plugins {
+ id 'java-library'
+}
+
+archivesBaseName = 'refinedstorage-network'
+
+dependencies {
+ api project(':refinedstorage-core-api')
+ api project(':refinedstorage-network-api')
+ api project(':refinedstorage-resource-api')
+ api project(':refinedstorage-storage-api')
+ api project(':refinedstorage-grid-api')
+ implementation libs.slf4j.api
+ testRuntimeOnly libs.slf4j.impl
+ testImplementation libs.junit.api
+ testImplementation libs.junit.params
+ testRuntimeOnly libs.junit.engine
+ testImplementation libs.assertj
+ testImplementation libs.mockito
+ testImplementation project(':refinedstorage-network-test')
+}
+
+test {
+ useJUnitPlatform()
+}
+
+enableMutationTesting()
+enablePublishing()
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkBuilderImpl.java
similarity index 92%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkBuilderImpl.java
index 2ab334726..29bb97357 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkBuilderImpl.java
@@ -1,13 +1,13 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
-
-import com.refinedmods.refinedstorage2.api.core.CoreValidations;
-import com.refinedmods.refinedstorage2.api.network.ConnectionProvider;
-import com.refinedmods.refinedstorage2.api.network.Connections;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.NetworkBuilder;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+package com.refinedmods.refinedstorage.api.network.impl;
+
+import com.refinedmods.refinedstorage.api.core.CoreValidations;
+import com.refinedmods.refinedstorage.api.network.ConnectionProvider;
+import com.refinedmods.refinedstorage.api.network.Connections;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.NetworkBuilder;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.Collections;
import java.util.Comparator;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkFactory.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkFactory.java
new file mode 100644
index 000000000..a8540d522
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkFactory.java
@@ -0,0 +1,17 @@
+package com.refinedmods.refinedstorage.api.network.impl;
+
+import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+
+public class NetworkFactory {
+ private final ComponentMapFactory componentMapFactory;
+
+ public NetworkFactory(final ComponentMapFactory componentMapFactory) {
+ this.componentMapFactory = componentMapFactory;
+ }
+
+ public Network create() {
+ return new NetworkImpl(componentMapFactory);
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkImpl.java
new file mode 100644
index 000000000..138d12aa2
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/NetworkImpl.java
@@ -0,0 +1,47 @@
+package com.refinedmods.refinedstorage.api.network.impl;
+
+import com.refinedmods.refinedstorage.api.core.component.ComponentMap;
+import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+
+import java.util.Set;
+
+public class NetworkImpl implements Network {
+ private final ComponentMap componentMap;
+
+ public NetworkImpl(final ComponentMapFactory componentMapFactory) {
+ this.componentMap = componentMapFactory.buildComponentMap(this);
+ }
+
+ @Override
+ public void addContainer(final NetworkNodeContainer container) {
+ componentMap.getComponents().forEach(c -> c.onContainerAdded(container));
+ }
+
+ @Override
+ public void removeContainer(final NetworkNodeContainer container) {
+ componentMap.getComponents().forEach(c -> c.onContainerRemoved(container));
+ }
+
+ @Override
+ public void remove() {
+ componentMap.getComponents().forEach(NetworkComponent::onNetworkRemoved);
+ }
+
+ @Override
+ public void split(final Set networks) {
+ componentMap.getComponents().forEach(c -> c.onNetworkSplit(networks));
+ }
+
+ @Override
+ public void merge(final Network network) {
+ componentMap.getComponents().forEach(c -> c.onNetworkMergedWith(network));
+ }
+
+ @Override
+ public I getComponent(final Class componentType) {
+ return componentMap.getComponent(componentType);
+ }
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/AbstractListeningEnergyStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/AbstractListeningEnergyStorage.java
similarity index 80%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/AbstractListeningEnergyStorage.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/AbstractListeningEnergyStorage.java
index fa61feb4a..b4d737fc2 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/AbstractListeningEnergyStorage.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/AbstractListeningEnergyStorage.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
public abstract class AbstractListeningEnergyStorage extends AbstractProxyEnergyStorage {
protected AbstractListeningEnergyStorage(final EnergyStorage delegate) {
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/AbstractProxyEnergyStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/AbstractProxyEnergyStorage.java
similarity index 78%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/AbstractProxyEnergyStorage.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/AbstractProxyEnergyStorage.java
index edad26ca2..797f8d9b7 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/AbstractProxyEnergyStorage.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/AbstractProxyEnergyStorage.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
public abstract class AbstractProxyEnergyStorage implements EnergyStorage {
private final EnergyStorage energyStorage;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyNetworkComponentImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyNetworkComponentImpl.java
similarity index 85%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyNetworkComponentImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyNetworkComponentImpl.java
index 2c158a91a..7928a41da 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyNetworkComponentImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyNetworkComponentImpl.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyProvider;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyProvider;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.LinkedHashSet;
import java.util.Set;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyStorageImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyStorageImpl.java
similarity index 81%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyStorageImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyStorageImpl.java
index b98e91f2f..4a8ee4ded 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyStorageImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyStorageImpl.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.core.CoreValidations;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.core.CoreValidations;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
public class EnergyStorageImpl implements EnergyStorage {
private final long capacity;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/package-info.java
new file mode 100644
index 000000000..66c1b7399
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/energy/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.energy;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/AbstractNetworkNode.java
similarity index 77%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/AbstractNetworkNode.java
index ab56f816f..895c46a56 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/AbstractNetworkNode.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node;
+package com.refinedmods.refinedstorage.api.network.impl.node;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
import javax.annotation.Nullable;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractStorageContainerNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/AbstractStorageContainerNetworkNode.java
similarity index 93%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractStorageContainerNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/AbstractStorageContainerNetworkNode.java
index ab85afb5d..cce55cf4a 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractStorageContainerNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/AbstractStorageContainerNetworkNode.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node;
+package com.refinedmods.refinedstorage.api.network.impl.node;
-import com.refinedmods.refinedstorage2.api.storage.StateTrackedStorage;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.StorageState;
+import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.StorageState;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/GraphNetworkComponentImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/GraphNetworkComponentImpl.java
similarity index 93%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/GraphNetworkComponentImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/GraphNetworkComponentImpl.java
index 8abdde984..a45e64a27 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/GraphNetworkComponentImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/GraphNetworkComponentImpl.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node;
+package com.refinedmods.refinedstorage.api.network.impl.node;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.Collections;
import java.util.HashMap;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/SimpleNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNode.java
similarity index 85%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/SimpleNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNode.java
index c96642d8f..0f5f24848 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/SimpleNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNode.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node;
+package com.refinedmods.refinedstorage.api.network.impl.node;
public class SimpleNetworkNode extends AbstractNetworkNode {
private long energyUsage;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/container/NetworkNodeContainerPriorities.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java
similarity index 93%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/container/NetworkNodeContainerPriorities.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java
index 98e9c8113..987e4d235 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/container/NetworkNodeContainerPriorities.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/NetworkNodeContainerPriorities.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.container;
+package com.refinedmods.refinedstorage.api.network.impl.node.container;
public final class NetworkNodeContainerPriorities {
/**
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/package-info.java
new file mode 100644
index 000000000..fc81a1dfc
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/container/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.container;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerEnergyState.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerEnergyState.java
new file mode 100644
index 000000000..44e2a9f11
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerEnergyState.java
@@ -0,0 +1,8 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.controller;
+
+public enum ControllerEnergyState {
+ OFF,
+ NEARLY_ON,
+ ON,
+ NEARLY_OFF
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/controller/ControllerNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerNetworkNode.java
similarity index 83%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/controller/ControllerNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerNetworkNode.java
index c5ff7f7aa..bc94239f7 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/controller/ControllerNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerNetworkNode.java
@@ -1,9 +1,9 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.controller;
+package com.refinedmods.refinedstorage.api.network.impl.node.controller;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyProvider;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyProvider;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
import javax.annotation.Nullable;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/package-info.java
new file mode 100644
index 000000000..139ecea02
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.controller;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java
new file mode 100644
index 000000000..b139f568d
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/AbstractDetectorAmountStrategy.java
@@ -0,0 +1,11 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
+
+public abstract class AbstractDetectorAmountStrategy implements DetectorAmountStrategy {
+ protected StorageChannel getStorageChannel(final Network network) {
+ return network.getComponent(StorageNetworkComponent.class);
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategy.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategy.java
new file mode 100644
index 000000000..c8e1a246a
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategy.java
@@ -0,0 +1,8 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+
+public interface DetectorAmountStrategy {
+ long getAmount(Network network, ResourceKey configuredResource);
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java
new file mode 100644
index 000000000..3b0ef8c65
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorAmountStrategyImpl.java
@@ -0,0 +1,15 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+
+public class DetectorAmountStrategyImpl extends AbstractDetectorAmountStrategy {
+ @Override
+ public long getAmount(final Network network, final ResourceKey configuredResource) {
+ return getStorageChannel(network)
+ .get(configuredResource)
+ .map(ResourceAmount::getAmount)
+ .orElse(0L);
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorMode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorMode.java
new file mode 100644
index 000000000..be798eff1
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorMode.java
@@ -0,0 +1,7 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
+
+public enum DetectorMode {
+ UNDER,
+ EQUAL,
+ ABOVE
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/detector/DetectorNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNode.java
similarity index 87%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/detector/DetectorNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNode.java
index 80a6d0ece..a0577e32b 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/detector/DetectorNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNode.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.detector;
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
import javax.annotation.Nullable;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/package-info.java
new file mode 100644
index 000000000..22744e885
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/CompositeExporterTransferStrategy.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/CompositeExporterTransferStrategy.java
new file mode 100644
index 000000000..00d648e68
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/CompositeExporterTransferStrategy.java
@@ -0,0 +1,26 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+import java.util.List;
+
+public class CompositeExporterTransferStrategy implements ExporterTransferStrategy {
+ private final List strategies;
+
+ public CompositeExporterTransferStrategy(final List strategies) {
+ this.strategies = strategies;
+ }
+
+ @Override
+ public boolean transfer(final ResourceKey resource, final Actor actor, final Network network) {
+ for (final ExporterTransferStrategy strategy : strategies) {
+ if (strategy.transfer(resource, actor, network)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/ExporterNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterNetworkNode.java
similarity index 75%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/ExporterNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterNetworkNode.java
index 456528588..b6ade059f 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/ExporterNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterNetworkNode.java
@@ -1,13 +1,13 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor;
-import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.node.task.Task;
-import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.node.task.Task;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
import java.util.ArrayList;
import java.util.List;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java
similarity index 75%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java
index 086e9250c..0118f91b0 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/ExporterTransferStrategyImpl.java
@@ -1,13 +1,13 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;
-
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;
-import com.refinedmods.refinedstorage2.api.storage.TransferHelper;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.InsertableStorage;
+import com.refinedmods.refinedstorage.api.storage.TransferHelper;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.Collection;
import java.util.Collections;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/package-info.java
new file mode 100644
index 000000000..470bb08f8
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExposedExternalStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExposedExternalStorage.java
similarity index 79%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExposedExternalStorage.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExposedExternalStorage.java
index 72d6860de..143b6d52e 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExposedExternalStorage.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExposedExternalStorage.java
@@ -1,17 +1,17 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage;
+package com.refinedmods.refinedstorage.api.network.impl.node.externalstorage;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractConfiguredProxyStorage;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.StorageConfiguration;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.composite.ParentComposite;
-import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorage;
-import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageListener;
-import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.storage.AbstractConfiguredProxyStorage;
+import com.refinedmods.refinedstorage.api.network.impl.storage.StorageConfiguration;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.composite.ParentComposite;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorage;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageListener;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorage;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageRepository;
import java.util.HashSet;
import java.util.Optional;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java
new file mode 100644
index 000000000..b81258831
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java
@@ -0,0 +1,76 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.storage.NetworkNodeStorageConfiguration;
+import com.refinedmods.refinedstorage.api.network.impl.storage.StorageConfiguration;
+import com.refinedmods.refinedstorage.api.network.node.externalstorage.ExternalStorageProviderFactory;
+import com.refinedmods.refinedstorage.api.network.storage.StorageProvider;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorage;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageRepository;
+
+import java.util.function.LongSupplier;
+import javax.annotation.Nullable;
+
+public class ExternalStorageNetworkNode extends AbstractNetworkNode implements StorageProvider {
+ private final long energyUsage;
+ private final StorageConfiguration storageConfiguration;
+ private final ExposedExternalStorage storage;
+ @Nullable
+ private ExternalStorage externalStorage;
+
+ public ExternalStorageNetworkNode(final long energyUsage, final LongSupplier clock) {
+ this.energyUsage = energyUsage;
+ this.storageConfiguration = new NetworkNodeStorageConfiguration(this);
+ this.storage = new ExposedExternalStorage(storageConfiguration, clock);
+ }
+
+ public StorageConfiguration getStorageConfiguration() {
+ return storageConfiguration;
+ }
+
+ public void setTrackingRepository(final TrackedStorageRepository trackingRepository) {
+ storage.setTrackingRepository(trackingRepository);
+ }
+
+ public void initialize(final ExternalStorageProviderFactory factory) {
+ storage.tryClearDelegate();
+ factory.create().ifPresent(provider -> {
+ this.externalStorage = new ExternalStorage(provider, storage);
+ if (isActive()) {
+ setVisible(true);
+ }
+ });
+ }
+
+ @Override
+ protected void onActiveChanged(final boolean newActive) {
+ super.onActiveChanged(newActive);
+ setVisible(newActive);
+ }
+
+ public boolean detectChanges() {
+ return storage.detectChanges();
+ }
+
+ @Override
+ public long getEnergyUsage() {
+ return energyUsage;
+ }
+
+ @Override
+ public Storage getStorage() {
+ return storage;
+ }
+
+ private void setVisible(final boolean visible) {
+ if (visible) {
+ if (externalStorage == null) {
+ return;
+ }
+ storage.setDelegate(externalStorage);
+ } else {
+ storage.tryClearDelegate();
+ }
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/package-info.java
new file mode 100644
index 000000000..7694f5c5b
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNode.java
new file mode 100644
index 000000000..519b95b74
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNode.java
@@ -0,0 +1,52 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.grid;
+
+import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher;
+import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManager;
+import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcherManagerImpl;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+import javax.annotation.Nullable;
+
+import static java.util.Objects.requireNonNull;
+
+public class GridNetworkNode extends AbstractNetworkNode {
+ private final long energyUsage;
+ private final GridWatcherManager watchers = new GridWatcherManagerImpl();
+
+ public GridNetworkNode(final long energyUsage) {
+ this.energyUsage = energyUsage;
+ }
+
+ @Override
+ public long getEnergyUsage() {
+ return energyUsage;
+ }
+
+ public void addWatcher(final GridWatcher watcher, final Class extends Actor> actorType) {
+ watchers.addWatcher(watcher, actorType, requireNonNull(network).getComponent(StorageNetworkComponent.class));
+ }
+
+ public void removeWatcher(final GridWatcher watcher) {
+ watchers.removeWatcher(watcher, requireNonNull(network).getComponent(StorageNetworkComponent.class));
+ }
+
+ @Override
+ protected void onActiveChanged(final boolean newActive) {
+ super.onActiveChanged(newActive);
+ watchers.activeChanged(newActive);
+ }
+
+ @Override
+ public void setNetwork(@Nullable final Network network) {
+ if (this.network != null) {
+ watchers.detachAll(this.network.getComponent(StorageNetworkComponent.class));
+ }
+ super.setNetwork(network);
+ if (this.network != null) {
+ watchers.attachAll(this.network.getComponent(StorageNetworkComponent.class));
+ }
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/package-info.java
new file mode 100644
index 000000000..c0ddda2b2
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.grid;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceExportState.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java
similarity index 76%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceExportState.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java
index 17a48ff1a..2c71fb43f 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceExportState.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportState.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.Collection;
import javax.annotation.Nullable;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java
similarity index 88%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java
index 2e48a7f8d..994f6ea7c 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNode.java
@@ -1,15 +1,15 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExposedExternalStorage;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.externalstorage.InterfaceExternalStorageProvider;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExposedExternalStorage;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage.InterfaceExternalStorageProvider;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.Collection;
import java.util.function.ToLongFunction;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProvider.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProvider.java
new file mode 100644
index 000000000..4af8d2718
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProvider.java
@@ -0,0 +1,11 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider;
+
+import javax.annotation.Nullable;
+
+public interface InterfaceExternalStorageProvider extends ExternalStorageProvider {
+ @Nullable
+ InterfaceNetworkNode getInterface();
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImpl.java
similarity index 80%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImpl.java
index 1f1bb9c77..c07ef1c63 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImpl.java
@@ -1,12 +1,12 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface.externalstorage;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceExportState;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceExportState;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/package-info.java
new file mode 100644
index 000000000..cda240816
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/package-info.java
new file mode 100644
index 000000000..50a6db6ee
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNode.java
new file mode 100644
index 000000000..efb345c29
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNode.java
@@ -0,0 +1,68 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.importer;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor;
+import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.Filter;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.function.UnaryOperator;
+
+public class ImporterNetworkNode extends AbstractNetworkNode {
+ private long energyUsage;
+ private final Filter filter = new Filter();
+ private final Actor actor = new NetworkNodeActor(this);
+ private final List transferStrategies = new ArrayList<>();
+
+ public ImporterNetworkNode(final long energyUsage) {
+ this.energyUsage = energyUsage;
+ }
+
+ public void setTransferStrategies(final List transferStrategies) {
+ this.transferStrategies.clear();
+ this.transferStrategies.addAll(transferStrategies);
+ }
+
+ @Override
+ public void doWork() {
+ super.doWork();
+ if (network == null || !isActive()) {
+ return;
+ }
+ for (final ImporterTransferStrategy transferStrategy : transferStrategies) {
+ if (transferStrategy.transfer(filter, actor, network)) {
+ return;
+ }
+ }
+ }
+
+ public FilterMode getFilterMode() {
+ return filter.getMode();
+ }
+
+ public void setFilterMode(final FilterMode mode) {
+ filter.setMode(mode);
+ }
+
+ public void setNormalizer(final UnaryOperator normalizer) {
+ filter.setNormalizer(normalizer);
+ }
+
+ public void setFilters(final Set filters) {
+ filter.setFilters(filters);
+ }
+
+ public void setEnergyUsage(final long energyUsage) {
+ this.energyUsage = energyUsage;
+ }
+
+ @Override
+ public long getEnergyUsage() {
+ return energyUsage;
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterSource.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterSource.java
new file mode 100644
index 000000000..f74cb7da4
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterSource.java
@@ -0,0 +1,24 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.importer;
+
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.ExtractableStorage;
+import com.refinedmods.refinedstorage.api.storage.InsertableStorage;
+
+import java.util.Iterator;
+
+import org.apiguardian.api.API;
+
+/**
+ * Represents a source for the importer.
+ * A valid source for the importer needs to be an {@link ExtractableStorage}, so the resources can be extracted
+ * for insertion into the target network.
+ * A valid source for the importer needs to be a {@link InsertableStorage} as well, so that transfers that end up
+ * failing can be given back to the source.
+ */
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1")
+public interface ImporterSource extends ExtractableStorage, InsertableStorage {
+ /**
+ * @return the resources that this source has
+ */
+ Iterator getResources();
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/importer/ImporterTransferStrategyImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java
similarity index 80%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/importer/ImporterTransferStrategyImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java
index bd343045f..5f09e2b49 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/importer/ImporterTransferStrategyImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterTransferStrategyImpl.java
@@ -1,13 +1,13 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.importer;
+package com.refinedmods.refinedstorage.api.network.impl.node.importer;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.Filter;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.TransferHelper;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.Filter;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.TransferHelper;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.Iterator;
import java.util.Objects;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/package-info.java
new file mode 100644
index 000000000..cd7ee5d7b
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.importer;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/package-info.java
new file mode 100644
index 000000000..37b5feaa4
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java
new file mode 100644
index 000000000..5366e818d
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayComponentType.java
@@ -0,0 +1,7 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+public enum RelayComponentType {
+ ENERGY,
+ SECURITY,
+ STORAGE
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayInputNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java
similarity index 83%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayInputNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java
index 955f7c097..cdca4d326 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayInputNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayInputNetworkNode.java
@@ -1,13 +1,13 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.relay;
-
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
import java.util.HashSet;
import java.util.Set;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayOutputNetworkNode.java
similarity index 75%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayOutputNetworkNode.java
index 2abe51359..6e7b6e7c1 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayOutputNetworkNode.java
@@ -1,19 +1,19 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.relay;
-
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyProvider;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.security.Permission;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageProvider;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyProvider;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.security.Permission;
+import com.refinedmods.refinedstorage.api.network.security.SecurityActor;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecision;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecisionProvider;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageProvider;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.Storage;
import java.util.Set;
import java.util.function.UnaryOperator;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayOutputStorage.java
similarity index 83%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayOutputStorage.java
index 0df45fbc0..96f1756f5 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayOutputStorage.java
@@ -1,19 +1,19 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.relay;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.Filter;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceList;
-import com.refinedmods.refinedstorage2.api.resource.list.listenable.ResourceListListener;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.composite.CompositeAwareChild;
-import com.refinedmods.refinedstorage2.api.storage.composite.ParentComposite;
-import com.refinedmods.refinedstorage2.api.storage.composite.PriorityProvider;
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.Filter;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
+import com.refinedmods.refinedstorage.api.resource.list.listenable.ResourceListListener;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.composite.CompositeAwareChild;
+import com.refinedmods.refinedstorage.api.storage.composite.ParentComposite;
+import com.refinedmods.refinedstorage.api.storage.composite.PriorityProvider;
import java.util.Collection;
import java.util.Collections;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/package-info.java
new file mode 100644
index 000000000..a7792b5f4
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/security/SecurityDecisionProviderProxyNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/security/SecurityDecisionProviderProxyNetworkNode.java
similarity index 79%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/security/SecurityDecisionProviderProxyNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/security/SecurityDecisionProviderProxyNetworkNode.java
index db3c3b443..53b112f1d 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/security/SecurityDecisionProviderProxyNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/security/SecurityDecisionProviderProxyNetworkNode.java
@@ -1,10 +1,10 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.security;
+package com.refinedmods.refinedstorage.api.network.impl.node.security;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.security.Permission;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.security.Permission;
+import com.refinedmods.refinedstorage.api.network.security.SecurityActor;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecision;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecisionProvider;
import javax.annotation.Nullable;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/security/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/security/package-info.java
new file mode 100644
index 000000000..b832a7db8
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/security/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.security;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/ExposedStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/ExposedStorage.java
new file mode 100644
index 000000000..403db7e6f
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/ExposedStorage.java
@@ -0,0 +1,76 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.storage;
+
+import com.refinedmods.refinedstorage.api.network.impl.storage.AbstractImmutableConfiguredProxyStorage;
+import com.refinedmods.refinedstorage.api.network.impl.storage.StorageConfiguration;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.composite.CompositeStorage;
+import com.refinedmods.refinedstorage.api.storage.composite.CompositeStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.composite.ParentComposite;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorage;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+
+import java.util.List;
+import java.util.Optional;
+
+class ExposedStorage extends AbstractImmutableConfiguredProxyStorage implements CompositeStorage {
+ protected ExposedStorage(final StorageConfiguration config) {
+ super(config, new CompositeStorageImpl(new ResourceListImpl()));
+ }
+
+ long getCapacity() {
+ final CompositeStorageImpl delegate = getUnsafeDelegate();
+ if (delegate == null) {
+ return 0;
+ }
+ return delegate.getSources()
+ .stream()
+ .filter(LimitedStorage.class::isInstance)
+ .map(LimitedStorage.class::cast)
+ .mapToLong(LimitedStorage::getCapacity)
+ .sum();
+ }
+
+ @Override
+ public void sortSources() {
+ // no-op: cannot sort individual storages.
+ }
+
+ @Override
+ public void addSource(final Storage source) {
+ getDelegate().addSource(source);
+ }
+
+ @Override
+ public void removeSource(final Storage source) {
+ getDelegate().removeSource(source);
+ }
+
+ @Override
+ public List getSources() {
+ return getDelegate().getSources();
+ }
+
+ @Override
+ public void clearSources() {
+ getDelegate().clearSources();
+ }
+
+ @Override
+ public Optional findTrackedResourceByActorType(final ResourceKey resource,
+ final Class extends Actor> actorType) {
+ return getDelegate().findTrackedResourceByActorType(resource, actorType);
+ }
+
+ @Override
+ public void onAddedIntoComposite(final ParentComposite parentComposite) {
+ getDelegate().onAddedIntoComposite(parentComposite);
+ }
+
+ @Override
+ public void onRemovedFromComposite(final ParentComposite parentComposite) {
+ getDelegate().onRemovedFromComposite(parentComposite);
+ }
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNode.java
similarity index 78%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNode.java
index 7a92a5971..c141c3e4b 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNode.java
@@ -1,11 +1,11 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.storage;
+package com.refinedmods.refinedstorage.api.network.impl.node.storage;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractStorageContainerNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.NetworkNodeStorageConfiguration;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.StorageConfiguration;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageProvider;
-import com.refinedmods.refinedstorage2.api.storage.StateTrackedStorage;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractStorageContainerNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.storage.NetworkNodeStorageConfiguration;
+import com.refinedmods.refinedstorage.api.network.impl.storage.StorageConfiguration;
+import com.refinedmods.refinedstorage.api.network.storage.StorageProvider;
+import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/package-info.java
new file mode 100644
index 000000000..81db7a8b7
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.storage;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferListener.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferListener.java
new file mode 100644
index 000000000..7ed2f9ba9
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferListener.java
@@ -0,0 +1,6 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer;
+
+@FunctionalInterface
+public interface StorageTransferListener {
+ void onTransferSuccess(int index);
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferMode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferMode.java
new file mode 100644
index 000000000..55ef387b7
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferMode.java
@@ -0,0 +1,6 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer;
+
+public enum StorageTransferMode {
+ INSERT_INTO_NETWORK,
+ EXTRACT_FROM_NETWORK
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
similarity index 84%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
index 59fd6bace..a6d0bcbf3 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
@@ -1,17 +1,17 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer;
-
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractStorageContainerNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.Filter;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.StateTrackedStorage;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.TransferHelper;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorage;
+package com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractStorageContainerNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.Filter;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.TransferHelper;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorage;
import java.util.Collection;
import java.util.LinkedHashSet;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/package-info.java
new file mode 100644
index 000000000..413856ef4
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/DefaultTaskExecutor.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/DefaultTaskExecutor.java
new file mode 100644
index 000000000..111857b52
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/DefaultTaskExecutor.java
@@ -0,0 +1,17 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.task;
+
+import com.refinedmods.refinedstorage.api.network.node.task.Task;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
+
+import java.util.List;
+
+public class DefaultTaskExecutor implements TaskExecutor {
+ @Override
+ public void execute(final List extends Task> tasks, final C context) {
+ for (final Task task : tasks) {
+ if (task.run(context)) {
+ return;
+ }
+ }
+ }
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/task/RandomTaskExecutor.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/RandomTaskExecutor.java
similarity index 78%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/task/RandomTaskExecutor.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/RandomTaskExecutor.java
index 1767caf79..1b8e8aff3 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/task/RandomTaskExecutor.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/RandomTaskExecutor.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.task;
+package com.refinedmods.refinedstorage.api.network.impl.node.task;
-import com.refinedmods.refinedstorage2.api.network.node.task.Task;
-import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.network.node.task.Task;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
import java.util.ArrayList;
import java.util.List;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/task/RoundRobinTaskExecutor.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/RoundRobinTaskExecutor.java
similarity index 86%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/task/RoundRobinTaskExecutor.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/RoundRobinTaskExecutor.java
index 624449460..ee10f89b7 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/task/RoundRobinTaskExecutor.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/RoundRobinTaskExecutor.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.task;
+package com.refinedmods.refinedstorage.api.network.impl.node.task;
-import com.refinedmods.refinedstorage2.api.network.node.task.Task;
-import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.network.node.task.Task;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
import java.util.List;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/package-info.java
new file mode 100644
index 000000000..1cb37eec4
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/node/task/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.node.task;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/package-info.java
new file mode 100644
index 000000000..0e794b049
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityDecisionProviderImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityDecisionProviderImpl.java
similarity index 76%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityDecisionProviderImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityDecisionProviderImpl.java
index 006dc6e91..cd45c5adb 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityDecisionProviderImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityDecisionProviderImpl.java
@@ -1,10 +1,10 @@
-package com.refinedmods.refinedstorage2.api.network.impl.security;
+package com.refinedmods.refinedstorage.api.network.impl.security;
-import com.refinedmods.refinedstorage2.api.network.security.Permission;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.api.network.security.Permission;
+import com.refinedmods.refinedstorage.api.network.security.SecurityActor;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecision;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecisionProvider;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
import java.util.HashMap;
import java.util.Map;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityNetworkComponentImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityNetworkComponentImpl.java
similarity index 80%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityNetworkComponentImpl.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityNetworkComponentImpl.java
index a2d7f9918..2ea075c42 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityNetworkComponentImpl.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityNetworkComponentImpl.java
@@ -1,13 +1,13 @@
-package com.refinedmods.refinedstorage2.api.network.impl.security;
+package com.refinedmods.refinedstorage.api.network.impl.security;
-import com.refinedmods.refinedstorage2.api.core.CoreValidations;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
-import com.refinedmods.refinedstorage2.api.network.security.Permission;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityActor;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecision;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityDecisionProvider;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.api.core.CoreValidations;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.security.Permission;
+import com.refinedmods.refinedstorage.api.network.security.SecurityActor;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecision;
+import com.refinedmods.refinedstorage.api.network.security.SecurityDecisionProvider;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
import java.util.LinkedHashSet;
import java.util.Set;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/package-info.java
new file mode 100644
index 000000000..8af1b04db
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/security/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.security;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractConfiguredProxyStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/AbstractConfiguredProxyStorage.java
similarity index 84%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractConfiguredProxyStorage.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/AbstractConfiguredProxyStorage.java
index cf4c35272..eac3f8872 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractConfiguredProxyStorage.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/AbstractConfiguredProxyStorage.java
@@ -1,14 +1,14 @@
-package com.refinedmods.refinedstorage2.api.network.impl.storage;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.core.CoreValidations;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.composite.CompositeAwareChild;
-import com.refinedmods.refinedstorage2.api.storage.composite.PriorityProvider;
+package com.refinedmods.refinedstorage.api.network.impl.storage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.core.CoreValidations;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.composite.CompositeAwareChild;
+import com.refinedmods.refinedstorage.api.storage.composite.PriorityProvider;
import java.util.Collection;
import java.util.Collections;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractImmutableConfiguredProxyStorage.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/AbstractImmutableConfiguredProxyStorage.java
similarity index 85%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractImmutableConfiguredProxyStorage.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/AbstractImmutableConfiguredProxyStorage.java
index 174e59b36..f870f5bd3 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractImmutableConfiguredProxyStorage.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/AbstractImmutableConfiguredProxyStorage.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network.impl.storage;
+package com.refinedmods.refinedstorage.api.network.impl.storage;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
import org.apiguardian.api.API;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/NetworkNodeStorageConfiguration.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/NetworkNodeStorageConfiguration.java
similarity index 78%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/NetworkNodeStorageConfiguration.java
rename to refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/NetworkNodeStorageConfiguration.java
index 3e469fe36..d2ede1e4c 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/NetworkNodeStorageConfiguration.java
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/NetworkNodeStorageConfiguration.java
@@ -1,12 +1,12 @@
-package com.refinedmods.refinedstorage2.api.network.impl.storage;
-
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.Filter;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
+package com.refinedmods.refinedstorage.api.network.impl.storage;
+
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.Filter;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
import java.util.Set;
import java.util.function.UnaryOperator;
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageConfiguration.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageConfiguration.java
new file mode 100644
index 000000000..e878d2880
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageConfiguration.java
@@ -0,0 +1,36 @@
+package com.refinedmods.refinedstorage.api.network.impl.storage;
+
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.composite.PriorityProvider;
+
+import java.util.Set;
+import java.util.function.UnaryOperator;
+
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4")
+public interface StorageConfiguration extends PriorityProvider {
+ AccessMode getAccessMode();
+
+ boolean isVoidExcess();
+
+ void setVoidExcess(boolean voidExcess);
+
+ void setAccessMode(AccessMode accessMode);
+
+ FilterMode getFilterMode();
+
+ boolean isAllowed(ResourceKey resource);
+
+ void setFilters(Set filters);
+
+ void setNormalizer(UnaryOperator normalizer);
+
+ void setFilterMode(FilterMode filterMode);
+
+ void setPriority(int priority);
+
+ boolean isActive();
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java
new file mode 100644
index 000000000..144a71d71
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImpl.java
@@ -0,0 +1,54 @@
+package com.refinedmods.refinedstorage.api.network.impl.storage;
+
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageProvider;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceList;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannelImpl;
+
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class StorageNetworkComponentImpl extends StorageChannelImpl implements StorageNetworkComponent {
+ private static final Logger LOGGER = LoggerFactory.getLogger(StorageNetworkComponentImpl.class);
+
+ public StorageNetworkComponentImpl(final ResourceList list) {
+ super(list);
+ }
+
+ @Override
+ public void onContainerAdded(final NetworkNodeContainer container) {
+ if (container.getNode() instanceof StorageProvider provider) {
+ final Storage storage = provider.getStorage();
+ LOGGER.debug("Adding source {} from provider {}", storage, provider);
+ addSource(storage);
+ }
+ }
+
+ @Override
+ public void onContainerRemoved(final NetworkNodeContainer container) {
+ if (container.getNode() instanceof StorageProvider provider) {
+ final Storage storage = provider.getStorage();
+ LOGGER.debug("Removing source {} of provider {}", storage, provider);
+ removeSource(storage);
+ }
+ }
+
+ @Override
+ public List getResources(final Class extends Actor> actorType) {
+ return getAll().stream().map(resourceAmount -> new TrackedResourceAmount(
+ resourceAmount,
+ findTrackedResourceByActorType(resourceAmount.getResource(), actorType).orElse(null)
+ )).toList();
+ }
+
+ @Override
+ public boolean contains(final Storage storage) {
+ return this.storage.contains(storage);
+ }
+}
diff --git a/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/package-info.java b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/package-info.java
new file mode 100644
index 000000000..d319b171e
--- /dev/null
+++ b/refinedstorage-network/src/main/java/com/refinedmods/refinedstorage/api/network/impl/storage/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage.api.network.impl.storage;
+
+import com.refinedmods.refinedstorage.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage-network/src/main/resources/fabric.mod.json b/refinedstorage-network/src/main/resources/fabric.mod.json
new file mode 100644
index 000000000..fd70f35e4
--- /dev/null
+++ b/refinedstorage-network/src/main/resources/fabric.mod.json
@@ -0,0 +1,19 @@
+{
+ "schemaVersion": 1,
+ "id": "refinedstorage-network",
+ "version": "${version}",
+ "name": "Refined Storage Network",
+ "authors": [
+ "Refined Mods"
+ ],
+ "license": "MIT",
+ "environment": "*",
+ "custom": {
+ "modmenu": {
+ "parent": "refinedstorage",
+ "badges": [
+ "library"
+ ]
+ }
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java
similarity index 88%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java
index 7baf1d54b..06c4656de 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/AbstractNetworkBuilderImplTest.java
@@ -1,12 +1,12 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
-
-import com.refinedmods.refinedstorage2.api.core.component.ComponentMapFactory;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.NetworkBuilder;
-import com.refinedmods.refinedstorage2.api.network.NetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
-import com.refinedmods.refinedstorage2.network.test.NetworkTestFixtures;
+package com.refinedmods.refinedstorage.api.network.impl;
+
+import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory;
+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.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.network.test.NetworkTestFixtures;
import java.util.ArrayList;
import java.util.List;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/FakeConnectionProvider.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/FakeConnectionProvider.java
similarity index 90%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/FakeConnectionProvider.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/FakeConnectionProvider.java
index 30635e346..7d946a673 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/FakeConnectionProvider.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/FakeConnectionProvider.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
+package com.refinedmods.refinedstorage.api.network.impl;
-import com.refinedmods.refinedstorage2.api.network.ConnectionProvider;
-import com.refinedmods.refinedstorage2.api.network.Connections;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.ConnectionProvider;
+import com.refinedmods.refinedstorage.api.network.Connections;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/InitializeNetworkBuilderImplTest.java
similarity index 97%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/InitializeNetworkBuilderImplTest.java
index 4fdfe747f..71356d4df 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/InitializeNetworkBuilderImplTest.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
+package com.refinedmods.refinedstorage.api.network.impl;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java
similarity index 80%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java
index 625e32e7c..7920bfef2 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/PriorityNetworkBuilderImplTest.java
@@ -1,17 +1,17 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.grid.watcher.GridWatcher;
-import com.refinedmods.refinedstorage2.api.network.ConnectionProvider;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.impl.node.container.NetworkNodeContainerPriorities;
-import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeActor;
+package com.refinedmods.refinedstorage.api.network.impl;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher;
+import com.refinedmods.refinedstorage.api.network.ConnectionProvider;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.impl.node.container.NetworkNodeContainerPriorities;
+import com.refinedmods.refinedstorage.api.network.impl.node.grid.GridNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.network.test.fake.FakeActor;
import java.util.Optional;
import java.util.function.Supplier;
@@ -19,8 +19,8 @@
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;
-import static com.refinedmods.refinedstorage2.api.network.impl.PriorityNetworkBuilderImplTest.MasterSlave.MASTER;
-import static com.refinedmods.refinedstorage2.api.network.impl.PriorityNetworkBuilderImplTest.MasterSlave.SLAVE;
+import static com.refinedmods.refinedstorage.api.network.impl.PriorityNetworkBuilderImplTest.MasterSlave.MASTER;
+import static com.refinedmods.refinedstorage.api.network.impl.PriorityNetworkBuilderImplTest.MasterSlave.SLAVE;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.inOrder;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java
similarity index 97%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java
index d83d71a2a..0906e28a3 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/RemoveNetworkBuilderImplTest.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
+package com.refinedmods.refinedstorage.api.network.impl;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.List;
import java.util.Set;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/SpyingNetworkNode.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java
similarity index 80%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/SpyingNetworkNode.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java
index 8d9ab159a..2293aebdc 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/SpyingNetworkNode.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/SpyingNetworkNode.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
+package com.refinedmods.refinedstorage.api.network.impl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode;
public final class SpyingNetworkNode extends AbstractNetworkNode {
private final long energyUsage;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/UpdateNetworkBuilderImplTest.java
similarity index 98%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/UpdateNetworkBuilderImplTest.java
index bfa4da26f..429409722 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/UpdateNetworkBuilderImplTest.java
@@ -1,8 +1,8 @@
-package com.refinedmods.refinedstorage2.api.network.impl;
+package com.refinedmods.refinedstorage.api.network.impl;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import java.util.Set;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyNetworkComponentImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyNetworkComponentImplTest.java
similarity index 92%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyNetworkComponentImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyNetworkComponentImplTest.java
index 90778ffe3..7214f001d 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyNetworkComponentImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyNetworkComponentImplTest.java
@@ -1,10 +1,10 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
-import com.refinedmods.refinedstorage2.api.network.impl.node.controller.ControllerNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.network.impl.node.controller.ControllerNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyStorageImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyStorageImplTest.java
similarity index 95%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyStorageImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyStorageImplTest.java
index 558600c51..cec96dc5b 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/EnergyStorageImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/EnergyStorageImplTest.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/ListeningEnergyStorageTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/ListeningEnergyStorageTest.java
similarity index 95%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/ListeningEnergyStorageTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/ListeningEnergyStorageTest.java
index de8f4165d..bfb269fd6 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/ListeningEnergyStorageTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/ListeningEnergyStorageTest.java
@@ -1,7 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/ProxyEnergyStorageTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/ProxyEnergyStorageTest.java
similarity index 87%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/ProxyEnergyStorageTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/ProxyEnergyStorageTest.java
index 2e391cbb1..effc61287 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/energy/ProxyEnergyStorageTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/energy/ProxyEnergyStorageTest.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network.impl.energy;
+package com.refinedmods.refinedstorage.api.network.impl.energy;
-import com.refinedmods.refinedstorage2.api.core.Action;
+import com.refinedmods.refinedstorage.api.core.Action;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/GraphNetworkComponentImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/GraphNetworkComponentImplTest.java
similarity index 95%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/GraphNetworkComponentImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/GraphNetworkComponentImplTest.java
index b577f37c2..a8432d265 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/GraphNetworkComponentImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/GraphNetworkComponentImplTest.java
@@ -1,10 +1,10 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node;
+package com.refinedmods.refinedstorage.api.network.impl.node;
-import com.refinedmods.refinedstorage2.api.network.impl.NetworkImpl;
-import com.refinedmods.refinedstorage2.api.network.node.GraphNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
-import com.refinedmods.refinedstorage2.network.test.NetworkTestFixtures;
+import com.refinedmods.refinedstorage.api.network.impl.NetworkImpl;
+import com.refinedmods.refinedstorage.api.network.node.GraphNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.network.test.NetworkTestFixtures;
import java.util.Set;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/ProviderImpl.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/ProviderImpl.java
similarity index 81%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/ProviderImpl.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/ProviderImpl.java
index a55d74eda..b10c79396 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/ProviderImpl.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/ProviderImpl.java
@@ -1,6 +1,6 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node;
+package com.refinedmods.refinedstorage.api.network.impl.node;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
import java.util.HashMap;
import java.util.Map;
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
new file mode 100644
index 000000000..cdb7cd507
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/SimpleNetworkNodeTest.java
@@ -0,0 +1,78 @@
+package com.refinedmods.refinedstorage.api.network.impl.node;
+
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+
+import org.junit.jupiter.api.Test;
+
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
+@NetworkTest
+@SetupNetwork(energyStored = 10, energyCapacity = 100)
+class SimpleNetworkNodeTest {
+ @AddNetworkNode(properties = {
+ @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = 10),
+ @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false)
+ })
+ SimpleNetworkNode sut;
+
+ @AddNetworkNode(networkId = "nonexistent")
+ SimpleNetworkNode sutWithoutNetwork;
+
+ @Test
+ void testInitialState() {
+ // Assert
+ assertThat(sut.isActive()).isFalse();
+ assertThat(sut.getNetwork()).isNotNull();
+ assertThat(sut.getEnergyUsage()).isEqualTo(10);
+
+ assertThat(sutWithoutNetwork.isActive()).isTrue();
+ assertThat(sutWithoutNetwork.getNetwork()).isNull();
+ }
+
+ @Test
+ void shouldNotExtractEnergyWhenInactive(@InjectNetworkEnergyComponent final EnergyNetworkComponent energy) {
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(energy.getStored()).isEqualTo(10);
+ }
+
+ @Test
+ void shouldNotExtractEnergyWithoutNetwork() {
+ // Act
+ assertDoesNotThrow(sutWithoutNetwork::doWork);
+ }
+
+ @Test
+ void shouldExtractEnergy(@InjectNetworkEnergyComponent final EnergyNetworkComponent energy) {
+ // Arrange
+ sut.setActive(true);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(energy.getStored()).isZero();
+ }
+
+ @Test
+ void shouldSetEnergyUsage(@InjectNetworkEnergyComponent final EnergyNetworkComponent energy) {
+ // Arrange
+ sut.setActive(true);
+ sut.setEnergyUsage(2);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(energy.getStored()).isEqualTo(8);
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/controller/ControllerNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerNetworkNodeTest.java
similarity index 90%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/controller/ControllerNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerNetworkNodeTest.java
index f813245b3..fbb749a6a 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/controller/ControllerNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/controller/ControllerNetworkNodeTest.java
@@ -1,10 +1,10 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.controller;
+package com.refinedmods.refinedstorage.api.network.impl.node.controller;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.energy.EnergyStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.energy.EnergyStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import java.util.stream.Stream;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/detector/DetectorNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java
similarity index 83%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/detector/DetectorNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java
index d22d2903b..b2e1d165a 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/detector/DetectorNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/detector/DetectorNetworkNodeTest.java
@@ -1,14 +1,14 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.detector;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory;
+package com.refinedmods.refinedstorage.api.network.impl.node.detector;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory;
import java.util.stream.Stream;
@@ -19,7 +19,7 @@
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.MethodSource;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java
similarity index 88%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java
index da0d68d44..fa57ebdce 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/AbstractExporterNetworkNodeTest.java
@@ -1,32 +1,32 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.InsertableStorage;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkEnergyComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.InsertableStorage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java
similarity index 76%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java
index b993f78d3..0c249d982 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/FirstAvailableExporterNetworkNodeTest.java
@@ -1,28 +1,28 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.node.task.DefaultTaskExecutor;
-import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor;
-import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.task.DefaultTaskExecutor;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNodeActor;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
import java.util.List;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
import static org.assertj.core.api.Assertions.assertThat;
class FirstAvailableExporterNetworkNodeTest extends AbstractExporterNetworkNodeTest {
diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java
new file mode 100644
index 000000000..57c7d9446
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RandomExporterNetworkNodeTest.java
@@ -0,0 +1,96 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.task.RandomTaskExecutor;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static org.assertj.core.api.Assertions.assertThat;
+
+class RandomExporterNetworkNodeTest extends AbstractExporterNetworkNodeTest {
+ @Override
+ protected TaskExecutor createTaskExecutor() {
+ return new RandomTaskExecutor<>(list -> {
+ list.clear();
+ list.add(sut.new TaskImpl(A));
+ list.add(sut.new TaskImpl(B));
+ });
+ }
+
+ @Test
+ void shouldTransfer(@InjectNetworkStorageComponent final StorageNetworkComponent storage) {
+ // Arrange
+ storage.addSource(new InMemoryStorageImpl());
+ storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE);
+ storage.insert(B, 100, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage destination = new InMemoryStorageImpl();
+ final ExporterTransferStrategy strategy = createTransferStrategy(destination, 5);
+
+ sut.setTransferStrategy(strategy);
+ sut.setFilters(List.of(B, A));
+
+ // Act & assert
+ sut.doWork();
+
+ assertThat(storage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 95),
+ new ResourceAmount(B, 100)
+ );
+ assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+
+ sut.doWork();
+
+ assertThat(storage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 90),
+ new ResourceAmount(B, 100)
+ );
+ assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 10)
+ );
+ }
+
+ @Test
+ void shouldUseNextResourceIfFirstOneIsNotAvailableInSameCycle(
+ @InjectNetworkStorageComponent final StorageNetworkComponent storage
+ ) {
+ // Arrange
+ storage.addSource(new InMemoryStorageImpl());
+ storage.insert(B, 7, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage destination = new InMemoryStorageImpl();
+ final ExporterTransferStrategy strategy = createTransferStrategy(destination, 10);
+
+ sut.setTransferStrategy(strategy);
+ sut.setFilters(List.of(A, B));
+
+ // Act & assert
+ sut.doWork();
+
+ assertThat(storage.getAll()).isEmpty();
+ assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 7)
+ );
+
+ sut.doWork();
+
+ assertThat(storage.getAll()).isEmpty();
+ assertThat(destination.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 7)
+ );
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java
similarity index 87%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java
index 2df0a9909..8b0f7cc98 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/exporter/RoundRobinExporterNetworkNodeTest.java
@@ -1,25 +1,25 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.exporter;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.node.task.RoundRobinTaskExecutor;
-import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
+package com.refinedmods.refinedstorage.api.network.impl.node.exporter;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.task.RoundRobinTaskExecutor;
+import com.refinedmods.refinedstorage.api.network.node.exporter.ExporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.node.task.TaskExecutor;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.D;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.D;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
similarity index 93%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
index 0ecdbe604..0abc32032 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
@@ -1,24 +1,24 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeActor;
+package com.refinedmods.refinedstorage.api.network.impl.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakeActor;
import java.util.Optional;
import java.util.Set;
@@ -30,10 +30,10 @@
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.ValueSource;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageProviderFactoryImpl.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageProviderFactoryImpl.java
new file mode 100644
index 000000000..797f86e6b
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/ExternalStorageProviderFactoryImpl.java
@@ -0,0 +1,14 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.network.node.externalstorage.ExternalStorageProviderFactory;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider;
+
+import java.util.Optional;
+
+public record ExternalStorageProviderFactoryImpl(ExternalStorageProvider provider)
+ implements ExternalStorageProviderFactory {
+ @Override
+ public Optional create() {
+ return Optional.of(provider);
+ }
+}
diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/StorageExternalStorageProvider.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/StorageExternalStorageProvider.java
new file mode 100644
index 000000000..2acf13735
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/externalstorage/StorageExternalStorageProvider.java
@@ -0,0 +1,33 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.external.ExternalStorageProvider;
+
+import java.util.Iterator;
+
+public class StorageExternalStorageProvider implements ExternalStorageProvider {
+ private final Storage storage;
+
+ public StorageExternalStorageProvider(final Storage storage) {
+ this.storage = storage;
+ }
+
+ @Override
+ public long extract(final ResourceKey resource, final long amount, final Action action, final Actor actor) {
+ return storage.extract(resource, amount, action, actor);
+ }
+
+ @Override
+ public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) {
+ return storage.insert(resource, amount, action, actor);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return storage.getAll().iterator();
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/grid/GridNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java
similarity index 79%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/grid/GridNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java
index 5d28eab96..b8407205c 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/grid/GridNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/grid/GridNetworkNodeTest.java
@@ -1,32 +1,32 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.grid;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.grid.watcher.GridWatcher;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeActor;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory;
+package com.refinedmods.refinedstorage.api.network.impl.node.grid;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.grid.watcher.GridWatcher;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakeActor;
+import com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.D;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.D;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.anyLong;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java
similarity index 87%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java
index 27a2b136a..e99fa2e1a 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ClearSlotInterfaceNetworkNodeTest.java
@@ -1,19 +1,19 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java
similarity index 82%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java
index a54ed32c7..e8e52f5e4 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/ExportToEmptySlotInterfaceNetworkNodeTest.java
@@ -1,22 +1,22 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE2;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE2;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceExportStateImpl.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java
similarity index 90%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceExportStateImpl.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java
index ed4e50d7c..25dab3158 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceExportStateImpl.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceExportStateImpl.java
@@ -1,9 +1,9 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel;
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.channel.StorageChannel;
import java.util.ArrayList;
import java.util.Collection;
@@ -13,9 +13,9 @@
import java.util.Map;
import javax.annotation.Nullable;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE2;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE2;
public class InterfaceExportStateImpl implements InterfaceExportState {
private final Map requested = new HashMap<>();
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java
similarity index 81%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java
index 3ce965776..421a724a6 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/InterfaceNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/InterfaceNetworkNodeTest.java
@@ -1,21 +1,21 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkEnergyComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java
similarity index 92%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java
index 14886930f..a8b780434 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/KeepExportingInterfaceNetworkNodeTest.java
@@ -1,23 +1,23 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE2;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE2;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImplTest.java
similarity index 87%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImplTest.java
index efe2a893b..17e285368 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/InterfaceExternalStorageProviderImplTest.java
@@ -1,25 +1,25 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface.externalstorage;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExternalStorageProviderFactoryImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceExportStateImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageProviderFactoryImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceExportStateImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java
similarity index 87%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java
index 10fca42e2..08c862be6 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/IoLoopInterfaceExternalStorageProviderImplTest.java
@@ -1,27 +1,27 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.iface.externalstorage;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExternalStorageProviderFactoryImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.StorageExternalStorageProvider;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceExportStateImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageProviderFactoryImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.StorageExternalStorageProvider;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceExportStateImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/SelfIoInterfaceExternalStorageProviderImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/SelfIoInterfaceExternalStorageProviderImplTest.java
new file mode 100644
index 000000000..441fb5c0b
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/iface/externalstorage/SelfIoInterfaceExternalStorageProviderImplTest.java
@@ -0,0 +1,64 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.iface.externalstorage;
+
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.impl.node.externalstorage.ExternalStorageProviderFactoryImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceExportStateImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.iface.InterfaceNetworkNode;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@NetworkTest
+@SetupNetwork
+class SelfIoInterfaceExternalStorageProviderImplTest {
+ @AddNetworkNode
+ InterfaceNetworkNode iface;
+ InterfaceExportStateImpl exportState;
+ @AddNetworkNode
+ ExternalStorageNetworkNode connection;
+
+ @BeforeEach
+ void setUp() {
+ exportState = new InterfaceExportStateImpl(2);
+ iface.setExportState(exportState);
+ iface.setTransferQuotaProvider(resource -> 100);
+ connection.initialize(new ExternalStorageProviderFactoryImpl(new InterfaceExternalStorageProviderImpl(iface)));
+ }
+
+ // We don't allow self-insertions and self-extractions for the same reasons mentioned in
+ // IoLoopInterfaceExternalStorageProviderImplTest.
+ @Test
+ void shouldNotAllowSelfInsertionOrSelfExtraction(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ // this would try to do a self-insert as it's an unwanted resource.
+ exportState.setCurrentlyExported(0, B, 15);
+ // this would try to do a self-extract because we have the resource.
+ exportState.setRequestedResource(1, B, 1);
+
+ // Act
+ iface.doWork();
+ connection.detectChanges();
+
+ // Assert
+ assertThat(exportState.getExportedResource(0)).isEqualTo(B);
+ assertThat(exportState.getExportedAmount(0)).isEqualTo(15);
+
+ assertThat(exportState.getExportedResource(1)).isNull();
+ assertThat(exportState.getExportedAmount(1)).isZero();
+
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(B, 15)
+ );
+ }
+}
diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java
new file mode 100644
index 000000000..5c89ea603
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/FakeImporterSource.java
@@ -0,0 +1,47 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.importer;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+public class FakeImporterSource implements ImporterSource {
+ private final List resources;
+ private final InMemoryStorageImpl storage = new InMemoryStorageImpl();
+
+ public FakeImporterSource(final ResourceKey... resources) {
+ this.resources = Arrays.stream(resources).toList();
+ }
+
+ public FakeImporterSource add(final ResourceKey resource, final long amount) {
+ storage.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE);
+ return this;
+ }
+
+ @Override
+ public Iterator getResources() {
+ return resources.iterator();
+ }
+
+ @Override
+ public long extract(final ResourceKey resource, final long amount, final Action action, final Actor actor) {
+ // Extract a maximum of 5 to ensure that we try to extract multiple times from different slots.
+ return storage.extract(resource, Math.min(amount, 5), action, actor);
+ }
+
+ public Collection getAll() {
+ return storage.getAll();
+ }
+
+ @Override
+ public long insert(final ResourceKey resource, final long amount, final Action action, final Actor actor) {
+ return storage.insert(resource, amount, action, actor);
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/importer/ImporterNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java
similarity index 90%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/importer/ImporterNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java
index d01189c90..9bb000da5 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/importer/ImporterNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/importer/ImporterNetworkNodeTest.java
@@ -1,21 +1,21 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.importer;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkEnergyComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.importer;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.node.importer.ImporterTransferStrategy;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import java.util.List;
import java.util.Set;
@@ -23,11 +23,11 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE2;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE2;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
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
new file mode 100644
index 000000000..9ac83d57d
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayEnergyNetworkNodeTest.java
@@ -0,0 +1,106 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkSecurityComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakePermissions;
+import com.refinedmods.refinedstorage.network.test.fake.FakeSecurityActors;
+
+import java.util.Set;
+
+import org.junit.jupiter.api.Test;
+
+import static com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayNetworkNodeTest.addSecurityPolicy;
+import static com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayNetworkNodeTest.addStorageSource;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@NetworkTest
+@SetupNetwork(id = "input")
+@SetupNetwork(id = "output", setupEnergy = false)
+class RelayEnergyNetworkNodeTest {
+ @AddNetworkNode(properties = {
+ @AddNetworkNode.Property(key = PROPERTY_ACTIVE, boolValue = false)
+ }, networkId = "input")
+ private RelayInputNetworkNode input;
+
+ @AddNetworkNode(networkId = "output")
+ private RelayOutputNetworkNode output;
+
+ @Test
+ void shouldPassEnergyComponent(
+ @InjectNetworkEnergyComponent(networkId = "input") final EnergyNetworkComponent inputEnergy,
+ @InjectNetworkSecurityComponent(networkId = "input") final SecurityNetworkComponent inputSecurity,
+ @InjectNetworkStorageComponent(networkId = "input") final StorageNetworkComponent inputStorage,
+ @InjectNetworkEnergyComponent(networkId = "output") final EnergyNetworkComponent outputEnergy,
+ @InjectNetworkSecurityComponent(networkId = "output") final SecurityNetworkComponent outputSecurity,
+ @InjectNetworkStorageComponent(networkId = "output") final StorageNetworkComponent outputStorage
+ ) {
+ // Arrange
+ input.setActive(true);
+ input.setOutputNode(output);
+
+ addSecurityPolicy(inputSecurity, FakePermissions.OTHER);
+ addStorageSource(inputStorage);
+
+ final long originalStored = inputEnergy.getStored();
+
+ // Act
+ input.setComponentTypes(Set.of(RelayComponentType.ENERGY));
+ final long extracted = output.extract(10);
+
+ // Assert
+ assertThat(extracted).isEqualTo(10);
+ assertThat(outputEnergy.getCapacity()).isEqualTo(inputEnergy.getCapacity());
+ assertThat(outputEnergy.getStored()).isEqualTo(originalStored - 10);
+ assertThat(outputSecurity.isAllowed(FakePermissions.ALLOW_BY_DEFAULT, FakeSecurityActors.A)).isTrue();
+ assertThat(outputSecurity.isAllowed(FakePermissions.OTHER, FakeSecurityActors.A)).isFalse();
+ assertThat(outputStorage.getAll()).isEmpty();
+ assertThat(outputStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE)).isZero();
+ assertThat(input.hasComponentType(RelayComponentType.ENERGY)).isTrue();
+ assertThat(input.hasComponentType(RelayComponentType.SECURITY)).isFalse();
+ assertThat(input.hasComponentType(RelayComponentType.STORAGE)).isFalse();
+ }
+
+ @Test
+ @SetupNetwork(id = "cycle_input", energyStored = 1, energyCapacity = 2)
+ @SetupNetwork(id = "cycle_input_alt", energyStored = 3, energyCapacity = 4)
+ void shouldDetectEnergyCycles(
+ @InjectNetwork("cycle_input") final Network inputNetwork,
+ @InjectNetworkEnergyComponent(networkId = "cycle_input") final EnergyNetworkComponent inputEnergy,
+ @InjectNetwork("cycle_input_alt") final Network inputAlternativeNetwork,
+ @InjectNetworkEnergyComponent(networkId = "cycle_input_alt") final EnergyNetworkComponent inputAlternativeEnergy
+ ) {
+ // Arrange
+ final RelayOutputNetworkNode cycleOutput = new RelayOutputNetworkNode(0);
+ cycleOutput.setEnergyDelegate(inputAlternativeEnergy);
+ cycleOutput.setNetwork(inputNetwork);
+ inputNetwork.addContainer(() -> cycleOutput);
+
+ final RelayOutputNetworkNode cycleOutputAlternative = new RelayOutputNetworkNode(0);
+ cycleOutputAlternative.setEnergyDelegate(inputEnergy);
+ cycleOutputAlternative.setNetwork(inputAlternativeNetwork);
+ inputAlternativeNetwork.addContainer(() -> cycleOutputAlternative);
+
+ // Assert
+ assertThat(inputEnergy.getStored()).isEqualTo(1);
+ assertThat(inputAlternativeEnergy.getStored()).isEqualTo(3);
+
+ assertThat(inputEnergy.getCapacity()).isEqualTo(2);
+ assertThat(inputAlternativeEnergy.getCapacity()).isEqualTo(4);
+
+ assertThat(inputEnergy.extract(10)).isEqualTo(1);
+ assertThat(inputAlternativeEnergy.extract(10)).isEqualTo(3);
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java
similarity index 89%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java
index 777be1c1e..0655d2a1a 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayNetworkNodeTest.java
@@ -1,25 +1,25 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.relay;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.impl.security.SecurityDecisionProviderImpl;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkEnergyComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkSecurityComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.fake.FakePermissions;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeSecurityActors;
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.impl.security.SecurityDecisionProviderImpl;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkSecurityComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakePermissions;
+import com.refinedmods.refinedstorage.network.test.fake.FakeSecurityActors;
import java.util.Set;
@@ -27,12 +27,12 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
-import static com.refinedmods.refinedstorage2.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
+import static com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java
similarity index 78%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java
index e2b61c35c..739b24d01 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelaySecurityNetworkNodeTest.java
@@ -1,31 +1,31 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.relay;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.impl.security.SecurityDecisionProviderImpl;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkEnergyComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkSecurityComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.fake.FakePermissions;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeSecurityActors;
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.impl.security.SecurityDecisionProviderImpl;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkSecurityComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakePermissions;
+import com.refinedmods.refinedstorage.network.test.fake.FakeSecurityActors;
import java.util.Set;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.api.network.impl.node.relay.RelayNetworkNodeTest.addStorageSource;
-import static com.refinedmods.refinedstorage2.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
+import static com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayNetworkNodeTest.addStorageSource;
+import static com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java
similarity index 92%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java
index 5688f54e9..c1aaf57ec 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/relay/RelayStorageNetworkNodeTest.java
@@ -1,38 +1,38 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.relay;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.energy.EnergyNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.composite.PriorityStorage;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkEnergyComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkSecurityComponent;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.fake.FakePermissions;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeSecurityActors;
+package com.refinedmods.refinedstorage.api.network.impl.node.relay;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.composite.PriorityStorage;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkEnergyComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkSecurityComponent;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakePermissions;
+import com.refinedmods.refinedstorage.network.test.fake.FakeSecurityActors;
import java.util.Set;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.api.network.impl.node.relay.RelayNetworkNodeTest.addSecurityPolicy;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
+import static com.refinedmods.refinedstorage.api.network.impl.node.relay.RelayNetworkNodeTest.addSecurityPolicy;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ACTIVE;
import static org.assertj.core.api.Assertions.assertThat;
@NetworkTest
diff --git a/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/PriorityStorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/PriorityStorageNetworkNodeTest.java
new file mode 100644
index 000000000..b2ec65662
--- /dev/null
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/PriorityStorageNetworkNodeTest.java
@@ -0,0 +1,76 @@
+package com.refinedmods.refinedstorage.api.network.impl.node.storage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.ProviderImpl;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@NetworkTest
+@SetupNetwork
+class PriorityStorageNetworkNodeTest {
+ @AddNetworkNode
+ StorageNetworkNode a;
+
+ @AddNetworkNode
+ StorageNetworkNode b;
+
+ ProviderImpl provider;
+
+ @BeforeEach
+ void setUp() {
+ provider = new ProviderImpl();
+ }
+
+ @ParameterizedTest
+ @ValueSource(booleans = {true, false})
+ void shouldRespectPriority(
+ final boolean storageAHasPriority,
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ final Storage storage1 = new LimitedStorageImpl(100);
+ final ProviderImpl provider1 = new ProviderImpl();
+ provider1.set(1, storage1);
+ a.setProvider(provider1);
+ a.setActive(true);
+
+ final Storage storage2 = new LimitedStorageImpl(100);
+ final ProviderImpl provider2 = new ProviderImpl();
+ provider2.set(1, storage2);
+ b.setProvider(provider2);
+ b.setActive(true);
+
+ if (storageAHasPriority) {
+ a.getStorageConfiguration().setPriority(5);
+ b.getStorageConfiguration().setPriority(2);
+ } else {
+ a.getStorageConfiguration().setPriority(2);
+ b.getStorageConfiguration().setPriority(5);
+ }
+
+ // Act
+ networkStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ // Assert
+ if (storageAHasPriority) {
+ assertThat(storage1.getAll()).isNotEmpty();
+ assertThat(storage2.getAll()).isEmpty();
+ } else {
+ assertThat(storage1.getAll()).isEmpty();
+ assertThat(storage2.getAll()).isNotEmpty();
+ }
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java
similarity index 91%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java
index aa100309b..c27a7eac1 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storage/StorageNetworkNodeTest.java
@@ -1,25 +1,25 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.storage;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.Network;
-import com.refinedmods.refinedstorage2.api.network.impl.node.ProviderImpl;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.storage.AccessMode;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.StateTrackedStorage;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.StorageState;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetwork;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeActor;
+package com.refinedmods.refinedstorage.api.network.impl.node.storage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.impl.node.ProviderImpl;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.storage.AccessMode;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.StateTrackedStorage;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.StorageState;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetwork;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
+import com.refinedmods.refinedstorage.network.test.fake.FakeActor;
import java.util.Collection;
import java.util.HashSet;
@@ -31,14 +31,14 @@
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.ValueSource;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE2;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
-import static com.refinedmods.refinedstorage2.network.test.nodefactory.StorageNetworkNodeFactory.PROPERTY_ENERGY_USAGE_PER_STORAGE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE2;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.AbstractNetworkNodeFactory.PROPERTY_ENERGY_USAGE;
+import static com.refinedmods.refinedstorage.network.test.nodefactory.StorageNetworkNodeFactory.PROPERTY_ENERGY_USAGE_PER_STORAGE;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
similarity index 94%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
index 8cc1dee94..9a0763f5a 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
@@ -1,21 +1,21 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.node.ProviderImpl;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
-import com.refinedmods.refinedstorage2.network.test.InjectNetworkStorageComponent;
-import com.refinedmods.refinedstorage2.network.test.NetworkTest;
-import com.refinedmods.refinedstorage2.network.test.SetupNetwork;
+package com.refinedmods.refinedstorage.api.network.impl.node.storagetransfer;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.node.ProviderImpl;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl;
+import com.refinedmods.refinedstorage.api.storage.Actor;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.InMemoryStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.Storage;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.AddNetworkNode;
+import com.refinedmods.refinedstorage.network.test.InjectNetworkStorageComponent;
+import com.refinedmods.refinedstorage.network.test.NetworkTest;
+import com.refinedmods.refinedstorage.network.test.SetupNetwork;
import java.util.LinkedHashMap;
import java.util.Set;
@@ -25,11 +25,11 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A_ALTERNATIVE;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.C;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.D;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A_ALTERNATIVE;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.C;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.D;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityNetworkComponentImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityNetworkComponentImplTest.java
similarity index 92%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityNetworkComponentImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityNetworkComponentImplTest.java
index 50494ba03..9a1ffdb86 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/security/SecurityNetworkComponentImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/security/SecurityNetworkComponentImplTest.java
@@ -1,15 +1,15 @@
-package com.refinedmods.refinedstorage2.api.network.impl.security;
+package com.refinedmods.refinedstorage.api.network.impl.security;
-import com.refinedmods.refinedstorage2.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityNetworkComponent;
-import com.refinedmods.refinedstorage2.api.network.security.SecurityPolicy;
-import com.refinedmods.refinedstorage2.network.test.fake.FakePermissions;
-import com.refinedmods.refinedstorage2.network.test.fake.FakeSecurityActors;
+import com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode;
+import com.refinedmods.refinedstorage.api.network.security.SecurityNetworkComponent;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.network.test.fake.FakePermissions;
+import com.refinedmods.refinedstorage.network.test.fake.FakeSecurityActors;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider;
+import static com.refinedmods.refinedstorage.api.network.impl.node.security.SecurityDecisionProviderProxyNetworkNode.activeSecurityDecisionProvider;
import static org.assertj.core.api.Assertions.assertThat;
class SecurityNetworkComponentImplTest {
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImplTest.java
similarity index 76%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java
rename to refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImplTest.java
index f1f4757ab..b7beebb1d 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java
+++ b/refinedstorage-network/src/test/java/com/refinedmods/refinedstorage/api/network/impl/storage/StorageNetworkComponentImplTest.java
@@ -1,18 +1,18 @@
-package com.refinedmods.refinedstorage2.api.network.impl.storage;
-
-import com.refinedmods.refinedstorage2.api.core.Action;
-import com.refinedmods.refinedstorage2.api.network.impl.NetworkImpl;
-import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer;
-import com.refinedmods.refinedstorage2.api.network.storage.StorageNetworkComponent;
-import com.refinedmods.refinedstorage2.api.resource.ResourceAmount;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
-import com.refinedmods.refinedstorage2.api.storage.EmptyActor;
-import com.refinedmods.refinedstorage2.api.storage.TrackedResourceAmount;
-import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl;
-import com.refinedmods.refinedstorage2.network.test.NetworkTestFixtures;
+package com.refinedmods.refinedstorage.api.network.impl.storage;
+
+import com.refinedmods.refinedstorage.api.core.Action;
+import com.refinedmods.refinedstorage.api.network.impl.NetworkImpl;
+import com.refinedmods.refinedstorage.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage.api.network.node.container.NetworkNodeContainer;
+import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent;
+import com.refinedmods.refinedstorage.api.resource.ResourceAmount;
+import com.refinedmods.refinedstorage.api.resource.list.ResourceListImpl;
+import com.refinedmods.refinedstorage.api.storage.EmptyActor;
+import com.refinedmods.refinedstorage.api.storage.TrackedResourceAmount;
+import com.refinedmods.refinedstorage.api.storage.limited.LimitedStorageImpl;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedResource;
+import com.refinedmods.refinedstorage.api.storage.tracked.TrackedStorageImpl;
+import com.refinedmods.refinedstorage.network.test.NetworkTestFixtures;
import java.util.Collection;
import java.util.HashSet;
@@ -22,8 +22,8 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.A;
-import static com.refinedmods.refinedstorage2.network.test.fake.FakeResources.B;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.A;
+import static com.refinedmods.refinedstorage.network.test.fake.FakeResources.B;
import static org.assertj.core.api.Assertions.assertThat;
class StorageNetworkComponentImplTest {
diff --git a/refinedstorage-platform-api/build.gradle b/refinedstorage-platform-api/build.gradle
new file mode 100644
index 000000000..91a28b78d
--- /dev/null
+++ b/refinedstorage-platform-api/build.gradle
@@ -0,0 +1,28 @@
+plugins {
+ id 'java-library'
+}
+
+commonProject()
+
+archivesBaseName = 'refinedstorage-platform-api'
+
+dependencies {
+ api libs.apiguardian
+ api project(':refinedstorage-core-api')
+ api project(':refinedstorage-storage-api')
+ api project(':refinedstorage-resource-api')
+ api project(':refinedstorage-network-api')
+ api project(':refinedstorage-grid-api')
+ testImplementation libs.junit.api
+ testImplementation libs.junit.params
+ testRuntimeOnly libs.junit.engine
+ testImplementation libs.assertj
+ testImplementation libs.equalsverifier
+}
+
+test {
+ useJUnitPlatform()
+}
+
+enableJavadoc()
+enablePublishing()
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
new file mode 100644
index 000000000..f9a49ed50
--- /dev/null
+++ b/refinedstorage-platform-api/src/main/java/com/refinedmods/refinedstorage/platform/api/PlatformApi.java
@@ -0,0 +1,208 @@
+package com.refinedmods.refinedstorage.platform.api;
+
+import com.refinedmods.refinedstorage.api.core.component.ComponentMapFactory;
+import com.refinedmods.refinedstorage.api.network.Network;
+import com.refinedmods.refinedstorage.api.network.NetworkComponent;
+import com.refinedmods.refinedstorage.api.network.energy.EnergyStorage;
+import com.refinedmods.refinedstorage.api.network.node.NetworkNode;
+import com.refinedmods.refinedstorage.api.network.security.SecurityPolicy;
+import com.refinedmods.refinedstorage.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage.platform.api.constructordestructor.ConstructorStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.constructordestructor.DestructorStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.exporter.ExporterTransferStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.grid.Grid;
+import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHint;
+import com.refinedmods.refinedstorage.platform.api.grid.GridInsertionHints;
+import com.refinedmods.refinedstorage.platform.api.grid.GridSynchronizer;
+import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategy;
+import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridExtractionStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategy;
+import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridInsertionStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategy;
+import com.refinedmods.refinedstorage.platform.api.grid.strategy.GridScrollingStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.importer.ImporterTransferStrategyFactory;
+import com.refinedmods.refinedstorage.platform.api.security.BuiltinPermissions;
+import com.refinedmods.refinedstorage.platform.api.security.PlatformPermission;
+import com.refinedmods.refinedstorage.platform.api.storage.StorageContainerItemHelper;
+import com.refinedmods.refinedstorage.platform.api.storage.StorageRepository;
+import com.refinedmods.refinedstorage.platform.api.storage.StorageType;
+import com.refinedmods.refinedstorage.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory;
+import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorExtractionStrategy;
+import com.refinedmods.refinedstorage.platform.api.storagemonitor.StorageMonitorInsertionStrategy;
+import com.refinedmods.refinedstorage.platform.api.support.energy.EnergyItemHelper;
+import com.refinedmods.refinedstorage.platform.api.support.network.ConnectionLogic;
+import com.refinedmods.refinedstorage.platform.api.support.network.InWorldNetworkNodeContainer;
+import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.NetworkBoundItemHelper;
+import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReference;
+import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceFactory;
+import com.refinedmods.refinedstorage.platform.api.support.network.bounditem.SlotReferenceProvider;
+import com.refinedmods.refinedstorage.platform.api.support.registry.PlatformRegistry;
+import com.refinedmods.refinedstorage.platform.api.support.resource.RecipeModIngredientConverter;
+import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceFactory;
+import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceRendering;
+import com.refinedmods.refinedstorage.platform.api.support.resource.ResourceType;
+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 java.util.Collection;
+import java.util.Optional;
+import java.util.Set;
+import java.util.function.Supplier;
+import javax.annotation.Nullable;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.network.chat.Component;
+import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.world.InteractionHand;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.entity.BlockEntity;
+import net.minecraft.world.level.block.entity.BlockEntityType;
+import net.minecraft.world.level.block.state.BlockState;
+import org.apiguardian.api.API;
+
+@API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0")
+public interface PlatformApi {
+ PlatformApi INSTANCE = new PlatformApiProxy();
+
+ PlatformRegistry getStorageTypeRegistry();
+
+ StorageRepository getClientStorageRepository();
+
+ StorageRepository getStorageRepository(Level level);
+
+ StorageContainerItemHelper getStorageContainerItemHelper();
+
+ PlatformRegistry getResourceTypeRegistry();
+
+ PlatformRegistry getImporterTransferStrategyRegistry();
+
+ PlatformRegistry getExporterTransferStrategyRegistry();
+
+ void addExternalStorageProviderFactory(PlatformExternalStorageProviderFactory factory);
+
+ Collection getExternalStorageProviderFactories();
+
+ Collection getDestructorStrategyFactories();
+
+ void addDestructorStrategyFactory(DestructorStrategyFactory factory);
+
+ Collection getConstructorStrategyFactories();
+
+ void addConstructorStrategyFactory(ConstructorStrategyFactory factory);
+
+ void addStorageMonitorExtractionStrategy(StorageMonitorExtractionStrategy strategy);
+
+ StorageMonitorExtractionStrategy getStorageMonitorExtractionStrategy();
+
+ void addStorageMonitorInsertionStrategy(StorageMonitorInsertionStrategy strategy);
+
+ StorageMonitorInsertionStrategy getStorageMonitorInsertionStrategy();
+
+ ComponentMapFactory getNetworkComponentMapFactory();
+
+ PlatformRegistry getGridSynchronizerRegistry();
+
+ UpgradeRegistry getUpgradeRegistry();
+
+ BuiltinUpgradeDestinations getBuiltinUpgradeDestinations();
+
+ InWorldNetworkNodeContainer createInWorldNetworkNodeContainer(BlockEntity blockEntity,
+ NetworkNode node,
+ String name,
+ int priority,
+ ConnectionLogic connectionLogic,
+ @Nullable Supplier