diff --git a/CHANGELOG.md b/CHANGELOG.md
index de3d58a13..ddf7695d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,19 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
+## [2.0.0-milestone.3.14] - 2024-06-28
+
+### Added
+
+- Disk Interface (formerly known as the "Disk Manipulator").
+- Item tag translations.
+
+### Fixed
+
+- Relay having no help tooltip.
+- Fixed bug where adding more Speed Upgrades would actually slow down the device even more.
+- Fixed missing textures for scheduling mode side button.
+
## [2.0.0-milestone.3.13] - 2024-06-16
## [2.0.0-milestone.3.12] - 2024-06-16
@@ -606,7 +619,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- The Grid can now use smooth scrolling.
- The Grid now has syntax highlighting for the search query.
-[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.13...HEAD
+[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.14...HEAD
+
+[2.0.0-milestone.3.14]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.13...v2.0.0-milestone.3.14
[2.0.0-milestone.3.13]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.12...v2.0.0-milestone.3.13
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 87191bb2b..0f886cd2a 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -21,7 +21,7 @@
-
+
diff --git a/config/intellij-code-style.xml b/config/intellij-code-style.xml
index 9a82b0fd0..49b79c2e9 100644
--- a/config/intellij-code-style.xml
+++ b/config/intellij-code-style.xml
@@ -1,5 +1,7 @@
+
+
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTest.java b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTest.java
index 15b6880bb..d7cc58db4 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTest.java
+++ b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTest.java
@@ -8,10 +8,10 @@
import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.importer.ImporterNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.relay.RelayInputNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.relay.RelayOutputNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
import com.refinedmods.refinedstorage2.network.test.nodefactory.ControllerNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.DetectorNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.ExporterNetworkNodeFactory;
@@ -19,11 +19,11 @@
import com.refinedmods.refinedstorage2.network.test.nodefactory.GridNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.ImporterNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.InterfaceNetworkNodeFactory;
-import com.refinedmods.refinedstorage2.network.test.nodefactory.MultiStorageNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.RelayInputNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.RelayOutputNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.SimpleNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.StorageNetworkNodeFactory;
+import com.refinedmods.refinedstorage2.network.test.nodefactory.StorageTransferNetworkNodeFactory;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -36,16 +36,16 @@
@Target(ElementType.TYPE)
@ExtendWith(NetworkTestExtension.class)
@RegisterNetworkNode(value = ControllerNetworkNodeFactory.class, clazz = ControllerNetworkNode.class)
-@RegisterNetworkNode(value = MultiStorageNetworkNodeFactory.class, clazz = MultiStorageNetworkNode.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 = StorageNetworkNodeFactory.class, clazz = StorageNetworkNode.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/NetworkTestFixtures.java b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTestFixtures.java
index 4cbfc678c..aa4a5a1c5 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTestFixtures.java
+++ b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/NetworkTestFixtures.java
@@ -15,6 +15,8 @@
import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
import com.refinedmods.refinedstorage2.network.test.fake.FakePermissions;
+import java.util.LinkedHashMap;
+
public final class NetworkTestFixtures {
public static final ComponentMapFactory NETWORK_COMPONENT_MAP_FACTORY =
new ComponentMapFactory<>();
@@ -30,7 +32,7 @@ public final class NetworkTestFixtures {
);
NETWORK_COMPONENT_MAP_FACTORY.addFactory(
StorageNetworkComponent.class,
- network -> new StorageNetworkComponentImpl(new ResourceListImpl())
+ network -> new StorageNetworkComponentImpl(new ResourceListImpl(new LinkedHashMap<>()))
);
NETWORK_COMPONENT_MAP_FACTORY.addFactory(
SecurityNetworkComponent.class,
diff --git a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageNetworkNodeFactory.java b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageNetworkNodeFactory.java
index 9600b77f0..df47e8da8 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageNetworkNodeFactory.java
+++ b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageNetworkNodeFactory.java
@@ -7,8 +7,17 @@
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) {
- return new StorageNetworkNode(getEnergyUsage(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/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/MultiStorageNetworkNodeFactory.java b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageTransferNetworkNodeFactory.java
similarity index 76%
rename from refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/MultiStorageNetworkNodeFactory.java
rename to refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageTransferNetworkNodeFactory.java
index 0e56caffe..3dc766bd3 100644
--- a/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/MultiStorageNetworkNodeFactory.java
+++ b/refinedstorage2-network-test/src/main/java/com/refinedmods/refinedstorage2/network/test/nodefactory/StorageTransferNetworkNodeFactory.java
@@ -1,20 +1,20 @@
package com.refinedmods.refinedstorage2.network.test.nodefactory;
import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
import com.refinedmods.refinedstorage2.network.test.AddNetworkNode;
import java.util.Map;
-public class MultiStorageNetworkNodeFactory extends AbstractNetworkNodeFactory {
+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, 9);
- return new MultiStorageNetworkNode(
+ final int size = (int) properties.getOrDefault(PROPERTY_SIZE, 6);
+ return new StorageTransferNetworkNode(
getEnergyUsage(properties),
energyUsagePerStorage,
size
diff --git a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkNodeFactoryTest.java b/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkNodeFactoryTest.java
index baf5f2079..cff8bdbf9 100644
--- a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkNodeFactoryTest.java
+++ b/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkNodeFactoryTest.java
@@ -8,8 +8,10 @@
import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.importer.ImporterNetworkNode;
-import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.relay.RelayInputNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.relay.RelayOutputNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
import org.junit.jupiter.api.Test;
@@ -21,8 +23,6 @@ class NetworkNodeFactoryTest {
@AddNetworkNode
ControllerNetworkNode controller;
@AddNetworkNode
- MultiStorageNetworkNode multiStorage;
- @AddNetworkNode
ExporterNetworkNode exporter;
@AddNetworkNode
GridNetworkNode grid;
@@ -38,6 +38,12 @@ class NetworkNodeFactoryTest {
ExternalStorageNetworkNode externalStorage;
@AddNetworkNode
DetectorNetworkNode detector;
+ @AddNetworkNode
+ RelayInputNetworkNode relayInput;
+ @AddNetworkNode
+ RelayOutputNetworkNode relayOutput;
+ @AddNetworkNode
+ StorageTransferNetworkNode storageTransfer;
@Test
void testInitialization() {
diff --git a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java b/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java
index f842ed7c8..7f75d9e2d 100644
--- a/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java
+++ b/refinedstorage2-network-test/src/test/java/com/refinedmods/refinedstorage2/network/test/NetworkTestExtensionTest.java
@@ -3,14 +3,12 @@
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.multistorage.MultiStorageNetworkNode;
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.MultiStorageNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.SimpleNetworkNodeFactory;
import com.refinedmods.refinedstorage2.network.test.nodefactory.StorageNetworkNodeFactory;
@@ -23,7 +21,7 @@
@ExtendWith({NetworkTestExtension.class})
@SetupNetwork(id = "a", energyCapacity = 100, energyStored = 50)
@SetupNetwork(id = "b")
-@RegisterNetworkNode(value = MultiStorageNetworkNodeFactory.class, clazz = MultiStorageNetworkNode.class)
+@RegisterNetworkNode(value = StorageNetworkNodeFactory.class, clazz = StorageNetworkNode.class)
@RegisterNetworkNode(value = StorageNetworkNodeFactory.class, clazz = StorageNetworkNode.class)
@RegisterNetworkNode(value = SimpleNetworkNodeFactory.class, clazz = SimpleNetworkNode.class)
class NetworkTestExtensionTest {
@@ -41,7 +39,7 @@ class NetworkTestExtensionTest {
@AddNetworkNode(networkId = "b", properties = {
@AddNetworkNode.Property(key = AbstractNetworkNodeFactory.PROPERTY_ACTIVE, boolValue = false)
})
- MultiStorageNetworkNode storageInB;
+ StorageNetworkNode storageInB;
@AddNetworkNode(networkId = "nonexistent")
SimpleNetworkNode nonexistentNetworkNode;
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractStorageContainerNetworkNode.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractStorageContainerNetworkNode.java
new file mode 100644
index 000000000..ab85afb5d
--- /dev/null
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/AbstractStorageContainerNetworkNode.java
@@ -0,0 +1,122 @@
+package com.refinedmods.refinedstorage2.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 java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
+import javax.annotation.Nullable;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractStorageContainerNetworkNode extends AbstractNetworkNode {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractStorageContainerNetworkNode.class);
+
+ protected final StateTrackedStorage[] storages;
+
+ private long energyUsage;
+ private final long energyUsagePerStorage;
+
+ @Nullable
+ private Provider provider;
+ @Nullable
+ private StateTrackedStorage.Listener listener;
+ private int activeStorages;
+
+ protected AbstractStorageContainerNetworkNode(final long energyUsage,
+ final long energyUsagePerStorage,
+ final int size) {
+ this.energyUsage = energyUsage;
+ this.energyUsagePerStorage = energyUsagePerStorage;
+ this.storages = new StateTrackedStorage[size];
+ }
+
+ public void setListener(final StateTrackedStorage.Listener listener) {
+ this.listener = listener;
+ }
+
+ public void setProvider(final Provider provider) {
+ this.provider = provider;
+ final List changes = new ArrayList<>();
+ for (int i = 0; i < storages.length; ++i) {
+ changes.addAll(initializeStorage(i));
+ }
+ // If we are already initialized, update all the storages to keep the exposed storages in sync.
+ // If we are not initialized, update nothing as we have to wait for an activeness update.
+ if (activeStorages > 0) {
+ changes.forEach(this::onStorageChange);
+ }
+ updateActiveStorageCount();
+ }
+
+ public void onStorageChanged(final int index) {
+ if (index < 0 || index >= storages.length) {
+ LOGGER.warn("Invalid index {}", index);
+ return;
+ }
+ initializeStorage(index).forEach(this::onStorageChange);
+ updateActiveStorageCount();
+ }
+
+ protected void onStorageChange(final StorageChange change) {
+ // no op
+ }
+
+ private Set initializeStorage(final int index) {
+ final Set results = new HashSet<>();
+ if (storages[index] != null) {
+ results.add(new StorageChange(true, storages[index]));
+ }
+ if (provider != null) {
+ provider.resolve(index).ifPresentOrElse(resolved -> {
+ final StateTrackedStorage newStorage = new StateTrackedStorage(resolved, listener);
+ storages[index] = newStorage;
+ results.add(new StorageChange(false, newStorage));
+ }, () -> storages[index] = null);
+ }
+ return results;
+ }
+
+ private void updateActiveStorageCount() {
+ this.activeStorages = (int) Arrays.stream(storages).filter(Objects::nonNull).count();
+ }
+
+ public void setEnergyUsage(final long energyUsage) {
+ this.energyUsage = energyUsage;
+ }
+
+ @Override
+ public long getEnergyUsage() {
+ return energyUsage + (energyUsagePerStorage * activeStorages);
+ }
+
+ public int getSize() {
+ return storages.length;
+ }
+
+ public StorageState getState(final int index) {
+ final var storage = storages[index];
+ if (storage == null) {
+ return StorageState.NONE;
+ }
+ if (!isActive()) {
+ return StorageState.INACTIVE;
+ }
+ return storage.getState();
+ }
+
+ protected record StorageChange(boolean removed, StateTrackedStorage storage) {
+ }
+
+ @FunctionalInterface
+ public interface Provider {
+ Optional resolve(int index);
+ }
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java
index 7ea8a845b..7a9028ecb 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNode.java
@@ -1,6 +1,8 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractStorageNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractNetworkNode;
+import com.refinedmods.refinedstorage2.api.network.impl.storage.NetworkNodeStorageConfiguration;
+import com.refinedmods.refinedstorage2.api.network.impl.storage.StorageConfiguration;
import com.refinedmods.refinedstorage2.api.network.node.externalstorage.ExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.api.network.storage.StorageProvider;
import com.refinedmods.refinedstorage2.api.storage.Storage;
@@ -10,15 +12,21 @@
import java.util.function.LongSupplier;
import javax.annotation.Nullable;
-public class ExternalStorageNetworkNode extends AbstractStorageNetworkNode implements StorageProvider {
+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.storage = new ExposedExternalStorage(this, clock);
+ this.storageConfiguration = new NetworkNodeStorageConfiguration(this);
+ this.storage = new ExposedExternalStorage(storageConfiguration, clock);
+ }
+
+ public StorageConfiguration getStorageConfiguration() {
+ return storageConfiguration;
}
public void setTrackingRepository(final TrackedStorageRepository trackingRepository) {
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/ExposedMultiStorage.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/ExposedMultiStorage.java
deleted file mode 100644
index 7823b4dc5..000000000
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/ExposedMultiStorage.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.multistorage;
-
-import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractImmutableConfiguredProxyStorage;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.StorageConfiguration;
-import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
-import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
-import com.refinedmods.refinedstorage2.api.storage.Actor;
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-import com.refinedmods.refinedstorage2.api.storage.composite.CompositeStorage;
-import com.refinedmods.refinedstorage2.api.storage.composite.CompositeStorageImpl;
-import com.refinedmods.refinedstorage2.api.storage.composite.ParentComposite;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-
-import java.util.List;
-import java.util.Optional;
-
-class ExposedMultiStorage extends AbstractImmutableConfiguredProxyStorage
- implements CompositeStorage {
- protected ExposedMultiStorage(final StorageConfiguration config) {
- super(config, new CompositeStorageImpl(new ResourceListImpl()));
- }
-
- @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/multistorage/MultiStorageNetworkNode.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageNetworkNode.java
deleted file mode 100644
index 463778f84..000000000
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageNetworkNode.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.multistorage;
-
-import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractStorageNetworkNode;
-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.refinedstorage2.api.storage.StorageState;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Set;
-import javax.annotation.Nullable;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MultiStorageNetworkNode extends AbstractStorageNetworkNode implements StorageProvider {
- private static final Logger LOGGER = LoggerFactory.getLogger(MultiStorageNetworkNode.class);
-
- @Nullable
- private MultiStorageProvider provider;
- @Nullable
- private StateTrackedStorage.Listener listener;
-
- private final long energyUsage;
- private final long energyUsagePerStorage;
-
- private final StateTrackedStorage[] cache;
- private final ExposedMultiStorage storage;
- private int activeStorages;
-
- public MultiStorageNetworkNode(final long energyUsage,
- final long energyUsagePerStorage,
- final int size) {
- this.energyUsage = energyUsage;
- this.energyUsagePerStorage = energyUsagePerStorage;
- this.storage = new ExposedMultiStorage(this);
- this.cache = new StateTrackedStorage[size];
- }
-
- public void setProvider(final MultiStorageProvider provider) {
- this.provider = provider;
- final List changes = new ArrayList<>();
- for (int i = 0; i < cache.length; ++i) {
- changes.addAll(initializeStorage(i));
- }
- // If we are already initialized, update all the storages to keep the exposed storages in sync.
- // If we are not initialized, update nothing as we have to wait for an activeness update.
- if (activeStorages > 0) {
- changes.forEach(this::processStorageChange);
- }
- updateActiveStorageCount();
- }
-
- public void onStorageChanged(final int index) {
- if (index < 0 || index >= cache.length) {
- LOGGER.warn("Invalid index {}", index);
- return;
- }
- initializeStorage(index).forEach(this::processStorageChange);
- updateActiveStorageCount();
- }
-
- private Set initializeStorage(final int index) {
- final Set results = new HashSet<>();
-
- if (cache[index] != null) {
- results.add(new StorageChange(true, cache[index]));
- }
-
- if (provider != null) {
- provider.resolve(index).ifPresentOrElse(resolved -> {
- final StateTrackedStorage newStorage = new StateTrackedStorage(resolved, listener);
- cache[index] = newStorage;
- results.add(new StorageChange(false, newStorage));
- }, () -> cache[index] = null);
- }
-
- return results;
- }
-
- private void processStorageChange(final StorageChange change) {
- if (!isActive()) {
- return;
- }
- if (change.removed) {
- storage.removeSource(change.storage);
- } else {
- storage.addSource(change.storage);
- }
- }
-
- private void updateActiveStorageCount() {
- this.activeStorages = (int) Arrays.stream(cache).filter(Objects::nonNull).count();
- }
-
- @Override
- protected void onActiveChanged(final boolean newActive) {
- super.onActiveChanged(newActive);
- if (network == null) {
- return;
- }
- LOGGER.debug("Activeness got changed to {}, updating underlying internal storages", newActive);
- if (newActive) {
- enableAllStorages();
- } else {
- disableAllStorages();
- }
- }
-
- private void enableAllStorages() {
- for (final StateTrackedStorage internalStorage : cache) {
- if (internalStorage != null) {
- storage.addSource(internalStorage);
- }
- }
- }
-
- private void disableAllStorages() {
- storage.clearSources();
- }
-
- public void setListener(final StateTrackedStorage.Listener listener) {
- this.listener = listener;
- }
-
- @Override
- public long getEnergyUsage() {
- return energyUsage + (energyUsagePerStorage * activeStorages);
- }
-
- public int getSize() {
- return cache.length;
- }
-
- public StorageState getState(final int index) {
- final var cached = cache[index];
- if (cached == null) {
- return StorageState.NONE;
- }
- if (!isActive()) {
- return StorageState.INACTIVE;
- }
- return cached.getState();
- }
-
- @Override
- public Storage getStorage() {
- return storage;
- }
-
- private record StorageChange(boolean removed, StateTrackedStorage storage) {
- }
-}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageProvider.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageProvider.java
deleted file mode 100644
index 8dd420fa1..000000000
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageProvider.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.multistorage;
-
-import com.refinedmods.refinedstorage2.api.storage.Storage;
-
-import java.util.Optional;
-
-@FunctionalInterface
-public interface MultiStorageProvider {
- Optional resolve(int index);
-}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java
index c0693fb68..0df45fbc0 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/relay/RelayOutputStorage.java
@@ -13,7 +13,7 @@
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.Priority;
+import com.refinedmods.refinedstorage2.api.storage.composite.PriorityProvider;
import java.util.Collection;
import java.util.Collections;
@@ -22,7 +22,7 @@
import java.util.function.UnaryOperator;
import javax.annotation.Nullable;
-class RelayOutputStorage implements CompositeAwareChild, ResourceListListener, Priority {
+class RelayOutputStorage implements CompositeAwareChild, ResourceListListener, PriorityProvider {
private final Set parentComposites = new HashSet<>();
private final Filter filter = new Filter();
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/ExposedStorage.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/ExposedStorage.java
index c4e7b035b..48a2104f7 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/ExposedStorage.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/ExposedStorage.java
@@ -1,60 +1,76 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.storage;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractConfiguredProxyStorage;
+import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractImmutableConfiguredProxyStorage;
import com.refinedmods.refinedstorage2.api.network.impl.storage.StorageConfiguration;
import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl;
import com.refinedmods.refinedstorage2.api.storage.Actor;
import com.refinedmods.refinedstorage2.api.storage.Storage;
+import com.refinedmods.refinedstorage2.api.storage.composite.CompositeStorage;
+import com.refinedmods.refinedstorage2.api.storage.composite.CompositeStorageImpl;
import com.refinedmods.refinedstorage2.api.storage.composite.ParentComposite;
import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorage;
import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource;
-import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage;
-import java.util.HashSet;
+import java.util.List;
import java.util.Optional;
-import java.util.Set;
-class ExposedStorage extends AbstractConfiguredProxyStorage implements TrackedStorage {
- private final Set parents = new HashSet<>();
+class ExposedStorage extends AbstractImmutableConfiguredProxyStorage implements CompositeStorage {
+ protected ExposedStorage(final StorageConfiguration config) {
+ super(config, new CompositeStorageImpl(new ResourceListImpl()));
+ }
- ExposedStorage(final StorageConfiguration config) {
- super(config);
+ 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 Optional findTrackedResourceByActorType(final ResourceKey resource,
- final Class extends Actor> actorType) {
- return getUnsafeDelegate() instanceof TrackedStorage trackedStorage
- ? trackedStorage.findTrackedResourceByActorType(resource, actorType)
- : Optional.empty();
+ public void sortSources() {
+ // no-op: cannot sort individual storages.
}
@Override
- public void onAddedIntoComposite(final ParentComposite parentComposite) {
- parents.add(parentComposite);
+ public void addSource(final Storage source) {
+ getDelegate().addSource(source);
}
@Override
- public void onRemovedFromComposite(final ParentComposite parentComposite) {
- parents.remove(parentComposite);
+ public void removeSource(final Storage source) {
+ getDelegate().removeSource(source);
+ }
+
+ @Override
+ public List getSources() {
+ return getDelegate().getSources();
}
- public long getCapacity() {
- return getUnsafeDelegate() instanceof LimitedStorage limitedStorage
- ? limitedStorage.getCapacity()
- : 0L;
+ @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 setDelegate(final Storage newDelegate) {
- super.setDelegate(newDelegate);
- parents.forEach(parent -> parent.onSourceAddedToChild(newDelegate));
+ public void onAddedIntoComposite(final ParentComposite parentComposite) {
+ getDelegate().onAddedIntoComposite(parentComposite);
}
@Override
- public void clearDelegate() {
- final Storage delegate = getDelegate();
- parents.forEach(parent -> parent.onSourceRemovedFromChild(delegate));
- super.clearDelegate();
+ 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/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNode.java
index ca7e2773f..7a92a5971 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNode.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNode.java
@@ -1,48 +1,67 @@
package com.refinedmods.refinedstorage2.api.network.impl.node.storage;
-import com.refinedmods.refinedstorage2.api.network.impl.storage.AbstractStorageNetworkNode;
+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 javax.annotation.Nullable;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class StorageNetworkNode extends AbstractStorageNetworkNode implements StorageProvider {
+public class StorageNetworkNode extends AbstractStorageContainerNetworkNode implements StorageProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(StorageNetworkNode.class);
- private final long energyUsage;
- private final ExposedStorage storage = new ExposedStorage(this);
- @Nullable
- private Storage internalStorage;
+ private final StorageConfiguration storageConfiguration;
+ private final ExposedStorage storage;
- public StorageNetworkNode(final long energyUsage) {
- this.energyUsage = energyUsage;
+ public StorageNetworkNode(final long energyUsage, final long energyUsagePerStorage, final int size) {
+ super(energyUsage, energyUsagePerStorage, size);
+ this.storageConfiguration = new NetworkNodeStorageConfiguration(this);
+ this.storage = new ExposedStorage(storageConfiguration);
}
- public void setStorage(final Storage storage) {
- LOGGER.debug("Loading storage {}", storage);
- this.internalStorage = storage;
+ @Override
+ protected void onStorageChange(final AbstractStorageContainerNetworkNode.StorageChange change) {
+ if (!isActive()) {
+ return;
+ }
+ if (change.removed()) {
+ storage.removeSource(change.storage());
+ } else {
+ storage.addSource(change.storage());
+ }
}
@Override
protected void onActiveChanged(final boolean newActive) {
super.onActiveChanged(newActive);
- if (network == null || internalStorage == null) {
+ if (network == null) {
return;
}
- LOGGER.debug("Storage activeness got changed to '{}', updating underlying storage", newActive);
+ LOGGER.debug("Activeness got changed to {}, updating underlying internal storages", newActive);
if (newActive) {
- storage.setDelegate(internalStorage);
+ enableAllStorages();
} else {
- storage.clearDelegate();
+ disableAllStorages();
}
}
- @Override
- public long getEnergyUsage() {
- return energyUsage;
+ private void enableAllStorages() {
+ for (final StateTrackedStorage internalStorage : storages) {
+ if (internalStorage != null) {
+ storage.addSource(internalStorage);
+ }
+ }
+ }
+
+ private void disableAllStorages() {
+ storage.clearSources();
+ }
+
+ public StorageConfiguration getStorageConfiguration() {
+ return storageConfiguration;
}
public long getStored() {
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferListener.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferListener.java
new file mode 100644
index 000000000..b4e34ced4
--- /dev/null
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferListener.java
@@ -0,0 +1,6 @@
+package com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer;
+
+@FunctionalInterface
+public interface StorageTransferListener {
+ void onTransferSuccess(int index);
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferMode.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferMode.java
new file mode 100644
index 000000000..e431b2721
--- /dev/null
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferMode.java
@@ -0,0 +1,6 @@
+package com.refinedmods.refinedstorage2.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/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
new file mode 100644
index 000000000..59fd6bace
--- /dev/null
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNode.java
@@ -0,0 +1,167 @@
+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;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.function.Predicate;
+import java.util.function.ToLongFunction;
+import java.util.function.UnaryOperator;
+import javax.annotation.Nullable;
+
+public class StorageTransferNetworkNode extends AbstractStorageContainerNetworkNode {
+ private final Actor actor = new NetworkNodeActor(this);
+ private final Filter filter = new Filter();
+
+ private StorageTransferMode mode = StorageTransferMode.INSERT_INTO_NETWORK;
+ @Nullable
+ private ToLongFunction transferQuotaProvider;
+ @Nullable
+ private StorageTransferListener listener;
+
+ public StorageTransferNetworkNode(final long energyUsage, final long energyUsagePerStorage, final int size) {
+ super(energyUsage, energyUsagePerStorage, size);
+ }
+
+ public void setMode(final StorageTransferMode mode) {
+ this.mode = mode;
+ }
+
+ public StorageTransferMode getMode() {
+ return mode;
+ }
+
+ public void setTransferQuotaProvider(final ToLongFunction transferQuotaProvider) {
+ this.transferQuotaProvider = transferQuotaProvider;
+ }
+
+ public void setListener(@Nullable final StorageTransferListener listener) {
+ this.listener = listener;
+ }
+
+ public FilterMode getFilterMode() {
+ return filter.getMode();
+ }
+
+ public void setFilterMode(final FilterMode filterMode) {
+ filter.setMode(filterMode);
+ }
+
+ public void setFilters(final Set filters) {
+ filter.setFilters(filters);
+ }
+
+ public void setNormalizer(final UnaryOperator normalizer) {
+ filter.setNormalizer(normalizer);
+ }
+
+ @Override
+ public void doWork() {
+ super.doWork();
+ if (!isActive() || network == null) {
+ return;
+ }
+ final StorageNetworkComponent networkStorage = network.getComponent(StorageNetworkComponent.class);
+ for (int i = 0; i < storages.length / 2; ++i) {
+ final StateTrackedStorage storage = storages[i];
+ if (storage == null) {
+ continue;
+ }
+ final Result result = transfer(storage, networkStorage);
+ if (processResult(result, i)) {
+ return;
+ }
+ }
+ }
+
+ private Result transfer(final StateTrackedStorage storage, final StorageNetworkComponent networkStorage) {
+ if (transferQuotaProvider == null) {
+ return Result.FAILURE;
+ }
+ final long transferQuota = transferQuotaProvider.applyAsLong(storage.getDelegate());
+ if (mode == StorageTransferMode.INSERT_INTO_NETWORK) {
+ return transfer(storage, networkStorage, transferQuota, this::hasNoExtractableResources);
+ }
+ return transfer(
+ networkStorage,
+ storage,
+ transferQuota,
+ source -> hasNoExtractableResources(source) || storageIsFull(storage)
+ );
+ }
+
+ private Result transfer(final Storage source,
+ final Storage destination,
+ final long transferQuota,
+ final Predicate readyPredicate) {
+ if (readyPredicate.test(source)) {
+ return Result.SUCCESS;
+ }
+ if (transfer(source, destination, transferQuota)) {
+ return readyPredicate.test(source)
+ ? Result.SUCCESS
+ : Result.PARTIAL;
+ }
+ return Result.FAILURE;
+ }
+
+ private boolean transfer(final Storage source, final Storage destination, final long transferQuota) {
+ long remainder = transferQuota;
+ final Collection sourceContents = new LinkedHashSet<>(source.getAll());
+ for (final ResourceAmount resourceAmount : sourceContents) {
+ final ResourceKey resource = resourceAmount.getResource();
+ if (!filter.isAllowed(resource)) {
+ continue;
+ }
+ final long amount = Math.min(remainder, resourceAmount.getAmount());
+ final long transferred = TransferHelper.transfer(resource, amount, actor, source, destination, source);
+ remainder -= transferred;
+ if (remainder == 0) {
+ return true;
+ }
+ }
+ return remainder != transferQuota;
+ }
+
+ private boolean hasNoExtractableResources(final Storage source) {
+ return source.getAll().stream().noneMatch(resourceAmount -> filter.isAllowed(resourceAmount.getResource()));
+ }
+
+ private boolean storageIsFull(final Storage storage) {
+ return storage instanceof LimitedStorage limitedStorage
+ && limitedStorage.getCapacity() > 0
+ && limitedStorage.getCapacity() == limitedStorage.getStored();
+ }
+
+ private boolean processResult(final Result result, final int index) {
+ if (result.isSuccess()) {
+ if (result == Result.SUCCESS && listener != null) {
+ listener.onTransferSuccess(index);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ private enum Result {
+ SUCCESS,
+ PARTIAL,
+ FAILURE;
+
+ private boolean isSuccess() {
+ return this == PARTIAL || this == SUCCESS;
+ }
+ }
+}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/package-info.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/package-info.java
new file mode 100644
index 000000000..6f817bc33
--- /dev/null
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer;
+
+import com.refinedmods.refinedstorage2.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/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractConfiguredProxyStorage.java
index 0d15bff67..cf4c35272 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractConfiguredProxyStorage.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractConfiguredProxyStorage.java
@@ -8,7 +8,7 @@
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.Priority;
+import com.refinedmods.refinedstorage2.api.storage.composite.PriorityProvider;
import java.util.Collection;
import java.util.Collections;
@@ -18,7 +18,8 @@
import org.apiguardian.api.API;
@API(status = API.Status.STABLE, since = "2.0.0-milestone.2.4")
-public abstract class AbstractConfiguredProxyStorage implements CompositeAwareChild, Priority {
+public abstract class AbstractConfiguredProxyStorage
+ implements CompositeAwareChild, PriorityProvider {
@Nullable
private S delegate;
private final StorageConfiguration config;
@@ -47,7 +48,10 @@ public Amount compositeInsert(final ResourceKey resource,
final long amount,
final Action action,
final Actor actor) {
- if (delegate == null || config.isExtractOnly() || !config.isActive() || !config.isAllowed(resource)) {
+ if (delegate == null
+ || config.getAccessMode().isExtractOnly()
+ || !config.isActive()
+ || !config.isAllowed(resource)) {
return Amount.ZERO;
}
final long inserted = delegate.insert(resource, amount, action, actor);
@@ -62,7 +66,7 @@ public Amount compositeExtract(final ResourceKey resource,
final long amount,
final Action action,
final Actor actor) {
- if (delegate == null || config.isInsertOnly() || !config.isActive()) {
+ if (delegate == null || config.getAccessMode().isInsertOnly() || !config.isActive()) {
return Amount.ZERO;
}
final long extracted = delegate.extract(resource, amount, action, actor);
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractStorageNetworkNode.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/NetworkNodeStorageConfiguration.java
similarity index 78%
rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractStorageNetworkNode.java
rename to refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/NetworkNodeStorageConfiguration.java
index c2cad2cd6..3e469fe36 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/AbstractStorageNetworkNode.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/NetworkNodeStorageConfiguration.java
@@ -1,5 +1,6 @@
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;
@@ -10,18 +11,16 @@
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 abstract class AbstractStorageNetworkNode extends AbstractNetworkNode implements StorageConfiguration {
+public class NetworkNodeStorageConfiguration implements StorageConfiguration {
+ private final AbstractNetworkNode node;
private final Filter filter = new Filter();
+
private int priority;
private AccessMode accessMode = AccessMode.INSERT_EXTRACT;
private boolean voidExcess;
- @Override
- public int getPriority() {
- return priority;
+ public NetworkNodeStorageConfiguration(final AbstractNetworkNode node) {
+ this.node = node;
}
@Override
@@ -29,6 +28,16 @@ public AccessMode getAccessMode() {
return accessMode;
}
+ @Override
+ public boolean isVoidExcess() {
+ return voidExcess;
+ }
+
+ @Override
+ public void setVoidExcess(final boolean voidExcess) {
+ this.voidExcess = voidExcess;
+ }
+
@Override
public void setAccessMode(final AccessMode accessMode) {
this.accessMode = accessMode;
@@ -45,27 +54,28 @@ public boolean isAllowed(final ResourceKey resource) {
}
@Override
- public void setFilterMode(final FilterMode mode) {
- filter.setMode(mode);
+ public void setFilters(final Set filters) {
+ filter.setFilters(filters);
}
@Override
- public void setPriority(final int priority) {
- this.priority = priority;
- trySortSources();
+ public void setNormalizer(final UnaryOperator normalizer) {
+ filter.setNormalizer(normalizer);
}
@Override
- public boolean isVoidExcess() {
- return voidExcess;
+ public void setFilterMode(final FilterMode filterMode) {
+ filter.setMode(filterMode);
}
@Override
- public void setVoidExcess(final boolean voidExcess) {
- this.voidExcess = voidExcess;
+ public void setPriority(final int priority) {
+ this.priority = priority;
+ trySortSources();
}
private void trySortSources() {
+ final Network network = node.getNetwork();
if (network == null) {
return;
}
@@ -73,11 +83,13 @@ private void trySortSources() {
storage.sortSources();
}
- public void setFilters(final Set filters) {
- filter.setFilters(filters);
+ @Override
+ public int getPriority() {
+ return priority;
}
- public void setNormalizer(final UnaryOperator normalizer) {
- filter.setNormalizer(normalizer);
+ @Override
+ public boolean isActive() {
+ return node.isActive();
}
}
diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageConfiguration.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageConfiguration.java
index 518945726..f193264c9 100644
--- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageConfiguration.java
+++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageConfiguration.java
@@ -3,22 +3,17 @@
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.composite.Priority;
+import com.refinedmods.refinedstorage2.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 Priority {
+public interface StorageConfiguration extends PriorityProvider {
AccessMode getAccessMode();
- default boolean isInsertOnly() {
- return getAccessMode() == AccessMode.INSERT;
- }
-
- default boolean isExtractOnly() {
- return getAccessMode() == AccessMode.EXTRACT;
- }
-
boolean isVoidExcess();
void setVoidExcess(boolean voidExcess);
@@ -29,6 +24,10 @@ default boolean isExtractOnly() {
boolean isAllowed(ResourceKey resource);
+ void setFilters(Set filters);
+
+ void setNormalizer(UnaryOperator normalizer);
+
void setFilterMode(FilterMode filterMode);
void setPriority(int priority);
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java
index b5b5bea44..625e32e7c 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/PriorityNetworkBuilderImplTest.java
@@ -13,6 +13,7 @@
import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl;
import com.refinedmods.refinedstorage2.network.test.fake.FakeActor;
+import java.util.Optional;
import java.util.function.Supplier;
import org.junit.jupiter.api.Test;
@@ -115,10 +116,10 @@ void shouldRespectPriorityWhenMerging() {
private NetworkSide createNetworkSide(final MasterSlave side,
final Supplier networkFactory) {
- final StorageNetworkNode nodeA = new StorageNetworkNode(0);
+ final StorageNetworkNode nodeA = new StorageNetworkNode(0, 0, 1);
final InMemoryStorageImpl storage = new InMemoryStorageImpl();
storage.insert(side, 10, Action.EXECUTE, FakeActor.INSTANCE);
- nodeA.setStorage(storage);
+ nodeA.setProvider(index -> Optional.of(storage));
final NetworkNodeContainer a = createContainerWithNetwork(
nodeA,
container -> networkFactory.get(),
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageProviderImpl.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/ProviderImpl.java
similarity index 78%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageProviderImpl.java
rename to refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/ProviderImpl.java
index 09df89765..a55d74eda 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageProviderImpl.java
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/ProviderImpl.java
@@ -1,4 +1,4 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.multistorage;
+package com.refinedmods.refinedstorage2.api.network.impl.node;
import com.refinedmods.refinedstorage2.api.storage.Storage;
@@ -6,7 +6,7 @@
import java.util.Map;
import java.util.Optional;
-class MultiStorageProviderImpl implements MultiStorageProvider {
+public class ProviderImpl implements AbstractStorageContainerNetworkNode.Provider {
private final Map storages = new HashMap<>();
@Override
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
index 218848016..0ecdbe604 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/externalstorage/ExternalStorageNetworkNodeTest.java
@@ -56,10 +56,10 @@ void testInitialState(@InjectNetworkStorageComponent final StorageNetworkCompone
// Assert
assertThat(inserted).isZero();
assertThat(extracted).isZero();
- assertThat(sut.getAccessMode()).isEqualTo(AccessMode.INSERT_EXTRACT);
+ assertThat(sut.getStorageConfiguration().getAccessMode()).isEqualTo(AccessMode.INSERT_EXTRACT);
assertThat(sut.getEnergyUsage()).isEqualTo(ENERGY_USAGE);
- assertThat(sut.getPriority()).isZero();
- assertThat(sut.getFilterMode()).isEqualTo(FilterMode.BLOCK);
+ assertThat(sut.getStorageConfiguration().getPriority()).isZero();
+ assertThat(sut.getStorageConfiguration().getFilterMode()).isEqualTo(FilterMode.BLOCK);
assertThat(networkStorage.getAll()).isEmpty();
assertThat(networkStorage.getStored()).isZero();
assertThat(networkStorage.findTrackedResourceByActorType(A, FakeActor.class)).isEmpty();
@@ -157,8 +157,8 @@ void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent
void shouldRespectAllowlistWhenInserting(
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
// Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of(A, B));
+ sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW);
+ sut.getStorageConfiguration().setFilters(Set.of(A, B));
final Storage storage = new InMemoryStorageImpl();
final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage);
@@ -180,8 +180,8 @@ void shouldRespectEmptyAllowlistWhenInserting(
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
) {
// Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of());
+ sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW);
+ sut.getStorageConfiguration().setFilters(Set.of());
final Storage storage = new InMemoryStorageImpl();
final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage);
@@ -202,8 +202,8 @@ void shouldRespectEmptyAllowlistWhenInserting(
void shouldRespectBlocklistWhenInserting(
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
// Arrange
- sut.setFilterMode(FilterMode.BLOCK);
- sut.setFilters(Set.of(A, B));
+ sut.getStorageConfiguration().setFilterMode(FilterMode.BLOCK);
+ sut.getStorageConfiguration().setFilters(Set.of(A, B));
final Storage storage = new InMemoryStorageImpl();
final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage);
@@ -224,8 +224,8 @@ void shouldRespectBlocklistWhenInserting(
void shouldRespectEmptyBlocklistWhenInserting(
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
// Arrange
- sut.setFilterMode(FilterMode.BLOCK);
- sut.setFilters(Set.of());
+ sut.getStorageConfiguration().setFilterMode(FilterMode.BLOCK);
+ sut.getStorageConfiguration().setFilters(Set.of());
final Storage storage = new InMemoryStorageImpl();
final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage);
@@ -249,7 +249,7 @@ void shouldRespectAccessModeWhenInserting(final AccessMode accessMode,
final StorageNetworkComponent networkStorage
) {
// Arrange
- sut.setAccessMode(accessMode);
+ sut.getStorageConfiguration().setAccessMode(accessMode);
final Storage storage = new InMemoryStorageImpl();
final ExternalStorageProvider provider = new StorageExternalStorageProvider(storage);
@@ -272,7 +272,7 @@ void shouldRespectAccessModeWhenExtracting(final AccessMode accessMode,
final StorageNetworkComponent networkStorage
) {
// Arrange
- sut.setAccessMode(accessMode);
+ sut.getStorageConfiguration().setAccessMode(accessMode);
final Storage storage = new InMemoryStorageImpl();
storage.insert(A, 20, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -647,11 +647,11 @@ void shouldRespectPriority(final boolean oneHasPriority,
otherStorage.initialize(new ExternalStorageProviderFactoryImpl(provider2));
if (oneHasPriority) {
- sut.setPriority(5);
- otherStorage.setPriority(2);
+ sut.getStorageConfiguration().setPriority(5);
+ otherStorage.getStorageConfiguration().setPriority(2);
} else {
- sut.setPriority(2);
- otherStorage.setPriority(5);
+ sut.getStorageConfiguration().setPriority(2);
+ otherStorage.getStorageConfiguration().setPriority(5);
}
// Act
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageNetworkNodeTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageNetworkNodeTest.java
deleted file mode 100644
index 3c696ab91..000000000
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/MultiStorageNetworkNodeTest.java
+++ /dev/null
@@ -1,698 +0,0 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.multistorage;
-
-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.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;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-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 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.MultiStorageNetworkNodeFactory.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;
-import static org.mockito.Mockito.verify;
-
-@NetworkTest
-@SetupNetwork
-class MultiStorageNetworkNodeTest {
- private static final long BASE_USAGE = 10;
- private static final long USAGE_PER_STORAGE = 3;
-
- @AddNetworkNode(properties = {
- @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = BASE_USAGE),
- @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE_PER_STORAGE, longValue = USAGE_PER_STORAGE)
- })
- MultiStorageNetworkNode sut;
-
- MultiStorageProviderImpl provider;
-
- @BeforeEach
- void setUp() {
- provider = new MultiStorageProviderImpl();
- }
-
- @Test
- void shouldInitializeButNotShowResourcesYet(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(10);
- storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage);
-
- // Act
- sut.setProvider(provider);
-
- // Assert
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
- assertThat(networkStorage.getAll()).isEmpty();
- assertThat(networkStorage.getStored()).isZero();
- }
-
- @Test
- void shouldInitializeAndShowResourcesAfterEnabling(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage);
-
- // Act
- sut.setProvider(provider);
- sut.setActive(true);
-
- // Assert
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(A, 50),
- new ResourceAmount(B, 50)
- );
- }
-
- @Test
- void shouldInitializeMultipleTimes(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage1 = new LimitedStorageImpl(10);
- storage1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(8, storage1);
- sut.setProvider(provider);
- sut.setActive(true);
-
- final Storage storage2 = new LimitedStorageImpl(10);
- storage2.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(8, storage2);
-
- // Act
- sut.setProvider(provider);
-
- // Assert
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(B, 5)
- );
- }
-
- @Test
- void testInitialState(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Assert
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE);
- assertThat(sut.getFilterMode()).isEqualTo(FilterMode.BLOCK);
- assertThat(networkStorage.getAll()).isEmpty();
- assertThat(networkStorage.getStored()).isZero();
- assertThat(sut.getSize()).isEqualTo(9);
- for (int i = 0; i < 9; ++i) {
- assertThat(sut.getState(i)).isEqualTo(StorageState.NONE);
- }
- }
-
- @ParameterizedTest
- @ValueSource(booleans = {true, false})
- void testState(final boolean active) {
- // Arrange
- final Storage normalStorage = new LimitedStorageImpl(100);
- normalStorage.insert(A, 74, Action.EXECUTE, EmptyActor.INSTANCE);
-
- final Storage nearCapacityStorage = new LimitedStorageImpl(100);
- nearCapacityStorage.insert(A, 75, Action.EXECUTE, EmptyActor.INSTANCE);
-
- final Storage fullStorage = new LimitedStorageImpl(100);
- fullStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE);
-
- final Storage unlimitedStorage = new InMemoryStorageImpl();
-
- provider.set(2, unlimitedStorage);
- provider.set(3, normalStorage);
- provider.set(5, nearCapacityStorage);
- provider.set(7, fullStorage);
-
- // Act
- sut.setProvider(provider);
- sut.setActive(active);
-
- // Assert
- assertThat(sut.getState(0)).isEqualTo(StorageState.NONE);
- assertThat(sut.getState(1)).isEqualTo(StorageState.NONE);
- assertThat(sut.getState(2)).isEqualTo(active ? StorageState.NORMAL : StorageState.INACTIVE);
- assertThat(sut.getState(3)).isEqualTo(active ? StorageState.NORMAL : StorageState.INACTIVE);
- assertThat(sut.getState(4)).isEqualTo(StorageState.NONE);
- assertThat(sut.getState(5)).isEqualTo(active ? StorageState.NEAR_CAPACITY : StorageState.INACTIVE);
- assertThat(sut.getState(6)).isEqualTo(StorageState.NONE);
- assertThat(sut.getState(7)).isEqualTo(active ? StorageState.FULL : StorageState.INACTIVE);
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + (USAGE_PER_STORAGE * 4));
- }
-
- @Test
- void shouldDetectNewStorage(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- initializeAndActivate();
-
- final Storage storage = new LimitedStorageImpl(10);
- storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(8, storage);
-
- // Act
- sut.onStorageChanged(8);
-
- // Assert
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 5)
- );
- }
-
- @Test
- void shouldDetectChangedStorage(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- final Storage originalStorage = new LimitedStorageImpl(10);
- originalStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(0, originalStorage);
- initializeAndActivate();
-
- final Storage replacedStorage = new LimitedStorageImpl(10);
- replacedStorage.insert(B, 2, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(0, replacedStorage);
-
- // Act
- final Collection preChanging = new HashSet<>(networkStorage.getAll());
- sut.onStorageChanged(0);
- final Collection postChanging = networkStorage.getAll();
-
- // Assert
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
- assertThat(preChanging).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 5)
- );
- assertThat(postChanging).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(B, 2)
- );
- assertThat(networkStorage.getStored()).isEqualTo(2L);
- }
-
- @Test
- void shouldDetectRemovedStorage(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(10);
- storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(7, storage);
- initializeAndActivate();
-
- provider.remove(7);
-
- // Act
- final Collection preRemoval = new HashSet<>(networkStorage.getAll());
- sut.onStorageChanged(7);
- final Collection postRemoval = networkStorage.getAll();
-
- // Assert
- assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE);
- assertThat(preRemoval).isNotEmpty();
- assertThat(postRemoval).isEmpty();
- assertThat(networkStorage.getStored()).isZero();
- }
-
- @Test
- void shouldNotDetectStorageChangeInInvalidIndex() {
- // Act
- sut.onStorageChanged(-1);
- sut.onStorageChanged(9);
-
- // Assert
- assertThat(sut.getSize()).isEqualTo(9);
- for (int i = 0; i < 9; ++i) {
- assertThat(sut.getState(i)).isEqualTo(StorageState.NONE);
- }
- }
-
- @Test
- void shouldNotUpdateNetworkStorageWhenChangingStorageWhenInactive(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final Collection preInactiveness = new HashSet<>(networkStorage.getAll());
- sut.setActive(false);
- sut.onStorageChanged(1);
- final Collection postInactiveness = networkStorage.getAll();
-
- // Assert
- assertThat(preInactiveness).isNotEmpty();
- assertThat(postInactiveness).isEmpty();
- assertThat(networkStorage.getStored()).isZero();
- }
-
- @Test
- void shouldHaveResourcesFromStoragePresentInNetwork(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage);
-
- initializeAndActivate();
-
- // Act
- final Collection resources = networkStorage.getAll();
- final long stored = networkStorage.getStored();
-
- // Assert
- assertThat(resources).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(A, 50),
- new ResourceAmount(B, 50)
- );
- assertThat(stored).isEqualTo(100);
- }
-
- @Test
- void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- final Storage storage1 = new LimitedStorageImpl(100);
- provider.set(1, storage1);
-
- final Storage storage2 = new LimitedStorageImpl(100);
- provider.set(2, storage2);
-
- final Storage storage3 = new LimitedStorageImpl(100);
- provider.set(3, storage3);
-
- initializeAndActivate();
-
- // Act
- final long inserted1 = networkStorage.insert(A, 150, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted3 = networkStorage.insert(B, 300, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isEqualTo(150);
- assertThat(inserted2).isEqualTo(10);
- assertThat(inserted3).isEqualTo(140);
-
- assertThat(storage1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 100)
- );
- assertThat(storage2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(A, 60),
- new ResourceAmount(B, 40)
- );
- assertThat(storage3.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(B, 100)
- );
-
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(B, 140),
- new ResourceAmount(A, 160)
- );
- assertThat(networkStorage.getStored()).isEqualTo(inserted1 + inserted2 + inserted3);
- }
-
- @Test
- void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- final Storage storage1 = new LimitedStorageImpl(100);
- storage1.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage1.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage1);
-
- final Storage storage2 = new LimitedStorageImpl(100);
- storage2.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage2.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(2, storage2);
-
- final Storage storage3 = new LimitedStorageImpl(100);
- storage3.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(3, storage3);
-
- initializeAndActivate();
-
- // Act
- final long extracted = networkStorage.extract(A, 85, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(extracted).isEqualTo(85);
-
- assertThat(storage1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(B, 50)
- );
- assertThat(storage2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(B, 50),
- new ResourceAmount(A, 15)
- );
- assertThat(storage3.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(C, 10)
- );
-
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(B, 100),
- new ResourceAmount(A, 15),
- new ResourceAmount(C, 10)
- );
- assertThat(networkStorage.getStored()).isEqualTo(125);
- }
-
- @Test
- void shouldRespectAllowlistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of(A, B));
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(B, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted3 = networkStorage.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isEqualTo(12);
- assertThat(inserted2).isEqualTo(12);
- assertThat(inserted3).isZero();
- }
-
- @Test
- void shouldRespectAllowlistWithNormalizerWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of(A));
- sut.setNormalizer(resource -> {
- if (resource == A_ALTERNATIVE || resource == A_ALTERNATIVE2) {
- return A;
- }
- if (resource == B_ALTERNATIVE) {
- return B;
- }
- return resource;
- });
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted1 = networkStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(A_ALTERNATIVE, 1, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted3 = networkStorage.insert(A_ALTERNATIVE2, 1, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted4 = networkStorage.insert(B, 1, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted5 = networkStorage.insert(B_ALTERNATIVE, 1, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isEqualTo(1);
- assertThat(inserted2).isEqualTo(1);
- assertThat(inserted3).isEqualTo(1);
- assertThat(inserted4).isZero();
- assertThat(inserted5).isZero();
- }
-
- @Test
- void shouldRespectEmptyAllowlistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of());
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(B, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted3 = networkStorage.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isZero();
- assertThat(inserted2).isZero();
- assertThat(inserted3).isZero();
- }
-
- @Test
- void shouldRespectBlocklistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setFilterMode(FilterMode.BLOCK);
- sut.setFilters(Set.of(A, B));
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(B, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted3 = networkStorage.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isZero();
- assertThat(inserted2).isZero();
- assertThat(inserted3).isEqualTo(10);
- }
-
- @Test
- void shouldRespectEmptyBlocklistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setFilterMode(FilterMode.BLOCK);
- sut.setFilters(Set.of());
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(B, 12, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted3 = networkStorage.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isEqualTo(12);
- assertThat(inserted2).isEqualTo(12);
- assertThat(inserted3).isEqualTo(10);
- }
-
- @ParameterizedTest
- @EnumSource(AccessMode.class)
- void shouldRespectAccessModeWhenInserting(
- final AccessMode accessMode,
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setAccessMode(accessMode);
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted = networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- switch (accessMode) {
- case INSERT_EXTRACT, INSERT -> assertThat(inserted).isEqualTo(5);
- case EXTRACT -> assertThat(inserted).isZero();
- }
- }
-
- @ParameterizedTest
- @EnumSource(AccessMode.class)
- void shouldRespectAccessModeWhenExtracting(
- final AccessMode accessMode,
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- sut.setAccessMode(accessMode);
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- storage.insert(A, 20, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Act
- final long extracted = networkStorage.extract(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- switch (accessMode) {
- case INSERT_EXTRACT, EXTRACT -> assertThat(extracted).isEqualTo(5);
- case INSERT -> assertThat(extracted).isZero();
- }
- }
-
- @Test
- void shouldNotAllowInsertsWhenInactive(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- sut.setActive(false);
-
- // Act
- final long inserted = networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted).isZero();
- }
-
- @Test
- void shouldNotAllowExtractsWhenInactive(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 20, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage);
- initializeAndActivate();
-
- sut.setActive(false);
-
- // Act
- final long extracted = networkStorage.extract(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(extracted).isZero();
- }
-
- @Test
- void shouldHideFromNetworkWhenInactive(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final Collection preInactiveness = new HashSet<>(networkStorage.getAll());
- sut.setActive(false);
- final Collection postInactiveness = networkStorage.getAll();
-
- // Assert
- assertThat(preInactiveness).isNotEmpty();
- assertThat(postInactiveness).isEmpty();
- }
-
- @Test
- void shouldNoLongerShowOnNetworkWhenRemoved(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage,
- @InjectNetwork final Network network
- ) {
- // Arrange
- final Storage storage1 = new LimitedStorageImpl(100);
- storage1.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(1, storage1);
- initializeAndActivate();
-
- // Act & assert
- final Storage storage2 = new LimitedStorageImpl(100);
- storage2.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(2, storage2);
- sut.onStorageChanged(2);
-
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(A, 50),
- new ResourceAmount(B, 50)
- );
-
- network.removeContainer(() -> sut);
- assertThat(networkStorage.getAll()).isEmpty();
-
- final Storage storage3 = new LimitedStorageImpl(100);
- storage3.insert(C, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- provider.set(3, storage3);
- sut.onStorageChanged(3);
-
- assertThat(networkStorage.getAll()).isEmpty();
- }
-
- @Test
- void shouldTrackChanges(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- final Storage storage = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- final long inserted = networkStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE);
-
- // Assert
- assertThat(inserted).isEqualTo(10);
- assertThat(networkStorage.findTrackedResourceByActorType(A, FakeActor.class)).isNotEmpty();
- }
-
- @Test
- void shouldNotifyListenerWhenStateChanges(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final StateTrackedStorage.Listener listener = mock(StateTrackedStorage.Listener.class);
- sut.setListener(listener);
-
- final Storage storage = new LimitedStorageImpl(100);
- provider.set(1, storage);
- initializeAndActivate();
-
- // Act
- networkStorage.insert(A, 75, Action.EXECUTE, FakeActor.INSTANCE);
-
- // Assert
- verify(listener, times(1)).onStorageStateChanged();
- }
-
- private void initializeAndActivate() {
- sut.setProvider(provider);
- sut.setActive(true);
- }
-}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/PriorityMultiStorageNetworkNodeTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/PriorityStorageNetworkNodeTest.java
similarity index 71%
rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/PriorityMultiStorageNetworkNodeTest.java
rename to refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/PriorityStorageNetworkNodeTest.java
index baf6d15f1..af1a17426 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/multistorage/PriorityMultiStorageNetworkNodeTest.java
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/PriorityStorageNetworkNodeTest.java
@@ -1,6 +1,7 @@
-package com.refinedmods.refinedstorage2.api.network.impl.node.multistorage;
+package com.refinedmods.refinedstorage2.api.network.impl.node.storage;
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.storage.EmptyActor;
import com.refinedmods.refinedstorage2.api.storage.Storage;
@@ -19,52 +20,52 @@
@NetworkTest
@SetupNetwork
-class PriorityMultiStorageNetworkNodeTest {
+class PriorityStorageNetworkNodeTest {
@AddNetworkNode
- MultiStorageNetworkNode a;
+ StorageNetworkNode a;
@AddNetworkNode
- MultiStorageNetworkNode b;
+ StorageNetworkNode b;
- MultiStorageProviderImpl provider;
+ ProviderImpl provider;
@BeforeEach
void setUp() {
- provider = new MultiStorageProviderImpl();
+ provider = new ProviderImpl();
}
@ParameterizedTest
@ValueSource(booleans = {true, false})
void shouldRespectPriority(
- final boolean multiStorageAHasPriority,
+ final boolean storageAHasPriority,
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
) {
// Arrange
final Storage storage1 = new LimitedStorageImpl(100);
- final MultiStorageProviderImpl provider1 = new MultiStorageProviderImpl();
+ final ProviderImpl provider1 = new ProviderImpl();
provider1.set(1, storage1);
a.setProvider(provider1);
a.setActive(true);
final Storage storage2 = new LimitedStorageImpl(100);
- final MultiStorageProviderImpl provider2 = new MultiStorageProviderImpl();
+ final ProviderImpl provider2 = new ProviderImpl();
provider2.set(1, storage2);
b.setProvider(provider2);
b.setActive(true);
- if (multiStorageAHasPriority) {
- a.setPriority(5);
- b.setPriority(2);
+ if (storageAHasPriority) {
+ a.getStorageConfiguration().setPriority(5);
+ b.getStorageConfiguration().setPriority(2);
} else {
- a.setPriority(2);
- b.setPriority(5);
+ a.getStorageConfiguration().setPriority(2);
+ b.getStorageConfiguration().setPriority(5);
}
// Act
networkStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE);
// Assert
- if (multiStorageAHasPriority) {
+ if (storageAHasPriority) {
assertThat(storage1.getAll()).isNotEmpty();
assertThat(storage2.getAll()).isEmpty();
} else {
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java
index bb04a9e36..aa100309b 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storage/StorageNetworkNodeTest.java
@@ -1,133 +1,407 @@
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.limited.LimitedStorage;
+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;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Set;
-import org.junit.jupiter.api.Nested;
+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 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 org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
@NetworkTest
@SetupNetwork
class StorageNetworkNodeTest {
- private static final int ENERGY_USAGE = 5;
+ private static final long BASE_USAGE = 10;
+ private static final long USAGE_PER_STORAGE = 3;
@AddNetworkNode(properties = {
- @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = ENERGY_USAGE)
+ @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE, longValue = BASE_USAGE),
+ @AddNetworkNode.Property(key = PROPERTY_ENERGY_USAGE_PER_STORAGE, longValue = USAGE_PER_STORAGE)
})
StorageNetworkNode sut;
+ ProviderImpl provider;
+
+ @BeforeEach
+ void setUp() {
+ provider = new ProviderImpl();
+ }
+
@Test
- void testInitialState(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ void shouldInitializeButNotShowResourcesYet(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ final Storage storage = new LimitedStorageImpl(10);
+ storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage);
+
// Act
- final long inserted = networkStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE);
- final long extracted = networkStorage.extract(A, 10, Action.EXECUTE, EmptyActor.INSTANCE);
+ sut.setProvider(provider);
// Assert
- assertThat(inserted).isZero();
- assertThat(extracted).isZero();
- assertThat(sut.getEnergyUsage()).isEqualTo(ENERGY_USAGE);
- assertThat(sut.getAccessMode()).isEqualTo(AccessMode.INSERT_EXTRACT);
- assertThat(sut.getFilterMode()).isEqualTo(FilterMode.BLOCK);
- assertThat(sut.getStored()).isZero();
- assertThat(sut.getCapacity()).isZero();
- assertThat(sut.getPriority()).isZero();
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
assertThat(networkStorage.getAll()).isEmpty();
assertThat(networkStorage.getStored()).isZero();
}
@Test
- void shouldInitialize(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ void shouldInitializeAndShowResourcesAfterEnabling(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ final Storage storage = new LimitedStorageImpl(100);
+ storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage);
+
+ // Act
+ sut.setProvider(provider);
+ sut.setActive(true);
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 50),
+ new ResourceAmount(B, 50)
+ );
+ }
+
+ @Test
+ void shouldInitializeMultipleTimes(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
- final LimitedStorage limitedStorage = new LimitedStorageImpl(100);
- limitedStorage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ final Storage storage1 = new LimitedStorageImpl(10);
+ storage1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(8, storage1);
+ sut.setProvider(provider);
+ sut.setActive(true);
+
+ final Storage storage2 = new LimitedStorageImpl(10);
+ storage2.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(8, storage2);
// Act
- activateStorage(limitedStorage);
+ sut.setProvider(provider);
// Assert
- assertThat(sut.getStored()).isEqualTo(50L);
- assertThat(sut.getCapacity()).isEqualTo(100L);
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 50L)
+ new ResourceAmount(B, 5)
);
}
@Test
- void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ void testInitialState(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Assert
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE);
+ assertThat(sut.getStorageConfiguration().getFilterMode()).isEqualTo(FilterMode.BLOCK);
+ assertThat(networkStorage.getAll()).isEmpty();
+ assertThat(networkStorage.getStored()).isZero();
+ assertThat(sut.getSize()).isEqualTo(9);
+ for (int i = 0; i < 9; ++i) {
+ assertThat(sut.getState(i)).isEqualTo(StorageState.NONE);
+ }
+ }
+
+ @ParameterizedTest
+ @ValueSource(booleans = {true, false})
+ void testState(final boolean active) {
+ // Arrange
+ final Storage normalStorage = new LimitedStorageImpl(100);
+ normalStorage.insert(A, 74, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage nearCapacityStorage = new LimitedStorageImpl(100);
+ nearCapacityStorage.insert(A, 75, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage fullStorage = new LimitedStorageImpl(100);
+ fullStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage unlimitedStorage = new InMemoryStorageImpl();
+
+ provider.set(2, unlimitedStorage);
+ provider.set(3, normalStorage);
+ provider.set(5, nearCapacityStorage);
+ provider.set(7, fullStorage);
+
+ // Act
+ sut.setProvider(provider);
+ sut.setActive(active);
+
+ // Assert
+ assertThat(sut.getState(0)).isEqualTo(StorageState.NONE);
+ assertThat(sut.getState(1)).isEqualTo(StorageState.NONE);
+ assertThat(sut.getState(2)).isEqualTo(active ? StorageState.NORMAL : StorageState.INACTIVE);
+ assertThat(sut.getState(3)).isEqualTo(active ? StorageState.NORMAL : StorageState.INACTIVE);
+ assertThat(sut.getState(4)).isEqualTo(StorageState.NONE);
+ assertThat(sut.getState(5)).isEqualTo(active ? StorageState.NEAR_CAPACITY : StorageState.INACTIVE);
+ assertThat(sut.getState(6)).isEqualTo(StorageState.NONE);
+ assertThat(sut.getState(7)).isEqualTo(active ? StorageState.FULL : StorageState.INACTIVE);
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + (USAGE_PER_STORAGE * 4));
+ }
+
+ @Test
+ void shouldDetectNewStorage(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ initializeAndActivate();
+
+ final Storage storage = new LimitedStorageImpl(10);
+ storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(8, storage);
+
+ // Act
+ sut.onStorageChanged(8);
+
+ // Assert
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+ }
+
+ @Test
+ void shouldDetectChangedStorage(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ final Storage originalStorage = new LimitedStorageImpl(10);
+ originalStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, originalStorage);
+ initializeAndActivate();
+
+ final Storage replacedStorage = new LimitedStorageImpl(10);
+ replacedStorage.insert(B, 2, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, replacedStorage);
+
+ // Act
+ final Collection preChanging = new HashSet<>(networkStorage.getAll());
+ sut.onStorageChanged(0);
+ final Collection postChanging = networkStorage.getAll();
+
+ // Assert
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE + USAGE_PER_STORAGE);
+ assertThat(preChanging).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+ assertThat(postChanging).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(B, 2)
+ );
+ assertThat(networkStorage.getStored()).isEqualTo(2L);
+ }
+
+ @Test
+ void shouldDetectRemovedStorage(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ final Storage storage = new LimitedStorageImpl(10);
+ storage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(7, storage);
+ initializeAndActivate();
+
+ provider.remove(7);
+
+ // Act
+ final Collection preRemoval = new HashSet<>(networkStorage.getAll());
+ sut.onStorageChanged(7);
+ final Collection postRemoval = networkStorage.getAll();
+
+ // Assert
+ assertThat(sut.getEnergyUsage()).isEqualTo(BASE_USAGE);
+ assertThat(preRemoval).isNotEmpty();
+ assertThat(postRemoval).isEmpty();
+ assertThat(networkStorage.getStored()).isZero();
+ }
+
+ @Test
+ void shouldNotDetectStorageChangeInInvalidIndex() {
+ // Act
+ sut.onStorageChanged(-1);
+ sut.onStorageChanged(9);
+
+ // Assert
+ assertThat(sut.getSize()).isEqualTo(9);
+ for (int i = 0; i < 9; ++i) {
+ assertThat(sut.getState(i)).isEqualTo(StorageState.NONE);
+ }
+ }
+
+ @Test
+ void shouldNotUpdateNetworkStorageWhenChangingStorageWhenInactive(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
- final long inserted = networkStorage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE);
+ final Collection preInactiveness = new HashSet<>(networkStorage.getAll());
+ sut.setActive(false);
+ sut.onStorageChanged(1);
+ final Collection postInactiveness = networkStorage.getAll();
// Assert
- assertThat(inserted).isEqualTo(100);
- assertThat(storage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 100)
+ assertThat(preInactiveness).isNotEmpty();
+ assertThat(postInactiveness).isEmpty();
+ assertThat(networkStorage.getStored()).isZero();
+ }
+
+ @Test
+ void shouldHaveResourcesFromStoragePresentInNetwork(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ final Storage storage = new LimitedStorageImpl(100);
+ storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage);
+
+ initializeAndActivate();
+
+ // Act
+ final Collection resources = networkStorage.getAll();
+ final long stored = networkStorage.getStored();
+
+ // Assert
+ assertThat(resources).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 50),
+ new ResourceAmount(B, 50)
);
- assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ assertThat(stored).isEqualTo(100);
+ }
+
+ @Test
+ void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ final Storage storage1 = new LimitedStorageImpl(100);
+ provider.set(1, storage1);
+
+ final Storage storage2 = new LimitedStorageImpl(100);
+ provider.set(2, storage2);
+
+ final Storage storage3 = new LimitedStorageImpl(100);
+ provider.set(3, storage3);
+
+ initializeAndActivate();
+
+ // Act
+ final long inserted1 = networkStorage.insert(A, 150, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted2 = networkStorage.insert(A, 10, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted3 = networkStorage.insert(B, 300, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ // Assert
+ assertThat(inserted1).isEqualTo(150);
+ assertThat(inserted2).isEqualTo(10);
+ assertThat(inserted3).isEqualTo(140);
+
+ assertThat(storage1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
new ResourceAmount(A, 100)
);
+ assertThat(storage2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 60),
+ new ResourceAmount(B, 40)
+ );
+ assertThat(storage3.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(B, 100)
+ );
+
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 140),
+ new ResourceAmount(A, 160)
+ );
+ assertThat(networkStorage.getStored()).isEqualTo(inserted1 + inserted2 + inserted3);
}
@Test
void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
// Arrange
- final Storage storage = new LimitedStorageImpl(200);
- storage.insert(A, 100, Action.EXECUTE, EmptyActor.INSTANCE);
- storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- activateStorage(storage);
+ final Storage storage1 = new LimitedStorageImpl(100);
+ storage1.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ storage1.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage1);
+
+ final Storage storage2 = new LimitedStorageImpl(100);
+ storage2.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ storage2.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(2, storage2);
+
+ final Storage storage3 = new LimitedStorageImpl(100);
+ storage3.insert(C, 10, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(3, storage3);
+
+ initializeAndActivate();
// Act
- final long extracted = networkStorage.extract(A, 30, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long extracted = networkStorage.extract(A, 85, Action.EXECUTE, EmptyActor.INSTANCE);
// Assert
- assertThat(extracted).isEqualTo(30);
- assertThat(storage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(A, 70),
+ assertThat(extracted).isEqualTo(85);
+
+ assertThat(storage1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
new ResourceAmount(B, 50)
);
+ assertThat(storage2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 50),
+ new ResourceAmount(A, 15)
+ );
+ assertThat(storage3.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(C, 10)
+ );
+
assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
- new ResourceAmount(A, 70),
- new ResourceAmount(B, 50)
+ new ResourceAmount(B, 100),
+ new ResourceAmount(A, 15),
+ new ResourceAmount(C, 10)
);
+ assertThat(networkStorage.getStored()).isEqualTo(125);
}
@Test
void shouldRespectAllowlistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of(A, B));
+ sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW);
+ sut.getStorageConfiguration().setFilters(Set.of(A, B));
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -140,15 +414,53 @@ void shouldRespectAllowlistWhenInserting(
assertThat(inserted3).isZero();
}
+ @Test
+ void shouldRespectAllowlistWithNormalizerWhenInserting(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW);
+ sut.getStorageConfiguration().setFilters(Set.of(A));
+ sut.getStorageConfiguration().setNormalizer(resource -> {
+ if (resource == A_ALTERNATIVE || resource == A_ALTERNATIVE2) {
+ return A;
+ }
+ if (resource == B_ALTERNATIVE) {
+ return B;
+ }
+ return resource;
+ });
+
+ final Storage storage = new LimitedStorageImpl(100);
+ provider.set(1, storage);
+ initializeAndActivate();
+
+ // Act
+ final long inserted1 = networkStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted2 = networkStorage.insert(A_ALTERNATIVE, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted3 = networkStorage.insert(A_ALTERNATIVE2, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted4 = networkStorage.insert(B, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted5 = networkStorage.insert(B_ALTERNATIVE, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ // Assert
+ assertThat(inserted1).isEqualTo(1);
+ assertThat(inserted2).isEqualTo(1);
+ assertThat(inserted3).isEqualTo(1);
+ assertThat(inserted4).isZero();
+ assertThat(inserted5).isZero();
+ }
+
@Test
void shouldRespectEmptyAllowlistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of());
+ sut.getStorageConfiguration().setFilterMode(FilterMode.ALLOW);
+ sut.getStorageConfiguration().setFilters(Set.of());
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -163,13 +475,15 @@ void shouldRespectEmptyAllowlistWhenInserting(
@Test
void shouldRespectBlocklistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
- sut.setFilterMode(FilterMode.BLOCK);
- sut.setFilters(Set.of(A, B));
+ sut.getStorageConfiguration().setFilterMode(FilterMode.BLOCK);
+ sut.getStorageConfiguration().setFilters(Set.of(A, B));
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -184,13 +498,15 @@ void shouldRespectBlocklistWhenInserting(
@Test
void shouldRespectEmptyBlocklistWhenInserting(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
- sut.setFilterMode(FilterMode.BLOCK);
- sut.setFilters(Set.of());
+ sut.getStorageConfiguration().setFilterMode(FilterMode.BLOCK);
+ sut.getStorageConfiguration().setFilters(Set.of());
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
final long inserted1 = networkStorage.insert(A, 12, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -205,15 +521,16 @@ void shouldRespectEmptyBlocklistWhenInserting(
@ParameterizedTest
@EnumSource(AccessMode.class)
- void shouldRespectAccessModeWhenInserting(final AccessMode accessMode,
- @InjectNetworkStorageComponent
- final StorageNetworkComponent networkStorage
+ void shouldRespectAccessModeWhenInserting(
+ final AccessMode accessMode,
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
) {
// Arrange
- sut.setAccessMode(accessMode);
+ sut.getStorageConfiguration().setAccessMode(accessMode);
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
final long inserted = networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -227,16 +544,18 @@ void shouldRespectAccessModeWhenInserting(final AccessMode accessMode,
@ParameterizedTest
@EnumSource(AccessMode.class)
- void shouldRespectAccessModeWhenExtracting(final AccessMode accessMode,
- @InjectNetworkStorageComponent
- final StorageNetworkComponent networkStorage
+ void shouldRespectAccessModeWhenExtracting(
+ final AccessMode accessMode,
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
) {
// Arrange
- sut.setAccessMode(accessMode);
+ sut.getStorageConfiguration().setAccessMode(accessMode);
final Storage storage = new LimitedStorageImpl(100);
+ provider.set(1, storage);
+ initializeAndActivate();
+
storage.insert(A, 20, Action.EXECUTE, EmptyActor.INSTANCE);
- activateStorage(storage);
// Act
final long extracted = networkStorage.extract(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
@@ -249,10 +568,14 @@ void shouldRespectAccessModeWhenExtracting(final AccessMode accessMode,
}
@Test
- void shouldNotInsertWhenInactive(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ void shouldNotAllowInsertsWhenInactive(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
+
sut.setActive(false);
// Act
@@ -263,10 +586,14 @@ void shouldNotInsertWhenInactive(@InjectNetworkStorageComponent final StorageNet
}
@Test
- void shouldNotExtractWhenInactive(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ void shouldNotAllowExtractsWhenInactive(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
// Arrange
final Storage storage = new LimitedStorageImpl(100);
- activateStorage(storage);
+ storage.insert(A, 20, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage);
+ initializeAndActivate();
sut.setActive(false);
@@ -278,189 +605,95 @@ void shouldNotExtractWhenInactive(@InjectNetworkStorageComponent final StorageNe
}
@Test
- void shouldHideStorageContentsWhenInactive(
+ void shouldHideFromNetworkWhenInactive(
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
) {
// Arrange
final Storage storage = new LimitedStorageImpl(100);
storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- activateStorage(storage);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
+ final Collection preInactiveness = new HashSet<>(networkStorage.getAll());
sut.setActive(false);
+ final Collection postInactiveness = networkStorage.getAll();
// Assert
- assertThat(networkStorage.getAll()).isEmpty();
+ assertThat(preInactiveness).isNotEmpty();
+ assertThat(postInactiveness).isEmpty();
}
@Test
- void shouldShowStorageContentsWhenActive(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ void shouldNoLongerShowOnNetworkWhenRemoved(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage,
+ @InjectNetwork final Network network
+ ) {
// Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
- storage.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ final Storage storage1 = new LimitedStorageImpl(100);
+ storage1.insert(A, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, storage1);
+ initializeAndActivate();
- // Act
- activateStorage(storage);
+ // Act & assert
+ final Storage storage2 = new LimitedStorageImpl(100);
+ storage2.insert(B, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(2, storage2);
+ sut.onStorageChanged(2);
- // Assert
assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
new ResourceAmount(A, 50),
new ResourceAmount(B, 50)
);
- }
-
- @Test
- void shouldNotInsertWhenFull(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- final Storage storage = new LimitedStorageImpl(100);
- storage.insert(A, 95, Action.EXECUTE, EmptyActor.INSTANCE);
- activateStorage(storage);
-
- // Act
- final long inserted1 = networkStorage.insert(A, 7, Action.EXECUTE, EmptyActor.INSTANCE);
- final Collection stored1 = networkStorage.getAll();
- final long inserted2 = networkStorage.insert(A, 7, Action.EXECUTE, EmptyActor.INSTANCE);
- final Collection stored2 = networkStorage.getAll();
-
- // Assert
- assertThat(inserted1).isEqualTo(5);
- assertThat(stored1).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 100)
- );
-
- assertThat(inserted2).isZero();
- assertThat(stored2).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 100)
- );
- }
-
- @Test
- void shouldNotInsertWhenFullWhenStorageVoidsExcessButIsNotInAllowlistMode(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final LimitedStorageImpl storage = new LimitedStorageImpl(100);
- storage.insert(A, 95, Action.EXECUTE, EmptyActor.INSTANCE);
- activateStorage(storage);
- sut.setVoidExcess(true);
+ network.removeContainer(() -> sut);
+ assertThat(networkStorage.getAll()).isEmpty();
- // Act
- final long inserted = networkStorage.insert(A, 7, Action.EXECUTE, EmptyActor.INSTANCE);
+ final Storage storage3 = new LimitedStorageImpl(100);
+ storage3.insert(C, 50, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(3, storage3);
+ sut.onStorageChanged(3);
- // Assert
- assertThat(inserted).isEqualTo(5);
- assertThat(storage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 100)
- );
+ assertThat(networkStorage.getAll()).isEmpty();
}
@Test
- void shouldNotInsertWhenStorageVoidsExcessAndInAllowlistModeWithoutConfiguredFilter(
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
+ void shouldTrackChanges(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
// Arrange
- final LimitedStorageImpl storage = new LimitedStorageImpl(100);
- activateStorage(storage);
-
- sut.setVoidExcess(true);
- sut.setFilterMode(FilterMode.ALLOW);
+ final Storage storage = new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
- final long inserted = networkStorage.insert(A, 7, Action.EXECUTE, EmptyActor.INSTANCE);
+ final long inserted = networkStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE);
// Assert
- assertThat(inserted).isZero();
- assertThat(storage.getAll()).isEmpty();
+ assertThat(inserted).isEqualTo(10);
+ assertThat(networkStorage.findTrackedResourceByActorType(A, FakeActor.class)).isNotEmpty();
}
@Test
- void shouldInsertWhenFullWhenStorageVoidsExcessAndIsInAllowlistMode(
+ void shouldNotifyListenerWhenStateChanges(
@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
) {
// Arrange
- final LimitedStorageImpl storage = new LimitedStorageImpl(100);
- storage.insert(A, 95, Action.EXECUTE, EmptyActor.INSTANCE);
- activateStorage(storage);
-
- sut.setVoidExcess(true);
- sut.setFilterMode(FilterMode.ALLOW);
- sut.setFilters(Set.of(A));
-
- // Act
- final long inserted1 = networkStorage.insert(A, 3, Action.EXECUTE, EmptyActor.INSTANCE);
- final long inserted2 = networkStorage.insert(A, 7, Action.EXECUTE, EmptyActor.INSTANCE);
- final long insertedOther = networkStorage.insert(B, 1, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- assertThat(inserted1).isEqualTo(3);
- assertThat(inserted2).isEqualTo(7);
- assertThat(insertedOther).isZero();
- assertThat(storage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
- new ResourceAmount(A, 100)
- );
- }
+ final StateTrackedStorage.Listener listener = mock(StateTrackedStorage.Listener.class);
+ sut.setListener(listener);
- @Test
- void shouldTrackChanges(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
- // Arrange
- activateStorage(new TrackedStorageImpl(new LimitedStorageImpl(100), () -> 0L));
+ final Storage storage = new LimitedStorageImpl(100);
+ provider.set(1, storage);
+ initializeAndActivate();
// Act
- final long inserted = networkStorage.insert(A, 10, Action.EXECUTE, FakeActor.INSTANCE);
+ networkStorage.insert(A, 75, Action.EXECUTE, FakeActor.INSTANCE);
// Assert
- assertThat(inserted).isEqualTo(10);
- assertThat(networkStorage.findTrackedResourceByActorType(A, FakeActor.class)).isNotEmpty();
+ verify(listener, times(1)).onStorageStateChanged();
}
- private void activateStorage(final Storage storage) {
- sut.setStorage(storage);
+ private void initializeAndActivate() {
+ sut.setProvider(provider);
sut.setActive(true);
}
-
- @Nested
- class PriorityTest {
- @AddNetworkNode
- StorageNetworkNode otherStorage;
-
- @ParameterizedTest
- @ValueSource(booleans = {true, false})
- void shouldRespectPriority(
- final boolean oneHasPriority,
- @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
- ) {
- // Arrange
- final LimitedStorageImpl storage1 = new LimitedStorageImpl(100);
- sut.setStorage(storage1);
- sut.setActive(true);
-
- final LimitedStorageImpl storage2 = new LimitedStorageImpl(100);
- otherStorage.setStorage(storage2);
- otherStorage.setActive(true);
-
- if (oneHasPriority) {
- sut.setPriority(5);
- otherStorage.setPriority(2);
- } else {
- sut.setPriority(2);
- otherStorage.setPriority(5);
- }
-
- // Act
- networkStorage.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE);
-
- // Assert
- if (oneHasPriority) {
- 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/storagetransfer/StorageTransferNetworkNodeTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
new file mode 100644
index 000000000..8cc1dee94
--- /dev/null
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/node/storagetransfer/StorageTransferNetworkNodeTest.java
@@ -0,0 +1,718 @@
+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;
+
+import java.util.LinkedHashMap;
+import java.util.Set;
+
+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.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 org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+@NetworkTest
+@SetupNetwork
+class StorageTransferNetworkNodeTest {
+ @AddNetworkNode
+ StorageTransferNetworkNode sut;
+ StorageTransferListener listener;
+ ProviderImpl provider;
+
+ @BeforeEach
+ void setUp() {
+ provider = new ProviderImpl();
+ listener = mock(StorageTransferListener.class);
+ sut.setListener(listener);
+ }
+
+ @Test
+ void shouldNotTransferWithoutNetwork(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+
+ // Act
+ sut.setNetwork(null);
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).isEmpty();
+ assertThat(source.getAll()).isNotEmpty();
+ }
+
+ @Test
+ void shouldNotTransferWhenInactive(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+
+ // Act
+ sut.setActive(false);
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).isEmpty();
+ assertThat(source.getAll()).isNotEmpty();
+ }
+
+ @ParameterizedTest
+ @EnumSource(StorageTransferMode.class)
+ void shouldNotTransferWithoutTransferQuotaProvider(
+ final StorageTransferMode mode,
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source = new InMemoryStorageImpl();
+ source.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setMode(mode);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+ assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(B, 5)
+ );
+ }
+
+ @Test
+ void shouldInsert(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source0 = new LimitedStorageImpl(1) {
+ @Override
+ public long extract(final ResourceKey resource,
+ final long amount,
+ final Action action,
+ final Actor actor) {
+ return 0;
+ }
+ };
+ source0.insert(A, 1, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source0);
+
+ final Storage source1 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, source1);
+
+ final Storage source2 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(2, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 10)
+ );
+ assertThat(source0.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 1)
+ );
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(C, 25),
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, never()).onTransferSuccess(anyInt());
+ }
+
+ @Test
+ void shouldInsertAllowlist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source1 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set((sut.getSize() / 2) - 2, source1);
+
+ final Storage source2 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set((sut.getSize() / 2) - 1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A, B));
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5)
+ );
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(C, 35),
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess((sut.getSize() / 2) - 2);
+ }
+
+ @Test
+ void shouldInsertBlocklist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source1 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+ sut.setFilterMode(FilterMode.BLOCK);
+ sut.setFilters(Set.of(A, B));
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(C, 20)
+ );
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 15),
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, never()).onTransferSuccess(anyInt());
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyInsertingBecauseStorageWasAlreadyEmpty() {
+ // Arrange
+ final Storage source = new InMemoryStorageImpl();
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyInsertingAllResources(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(source.getAll()).isEmpty();
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyInsertingAllResourcesAndUsingFilterButInsertedNothing() {
+ // Arrange
+ final Storage source1 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A));
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyInsertingAllResourcesAndUsingFilterButStillInsertedSomething(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source1 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source2.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A));
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotNotifyListenerWhenReadyInsertingAllResourcesAndNetworkIsFull(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new LimitedStorageImpl(15));
+
+ final Storage source1 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source1.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source1.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source2.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 100L);
+
+ // Act
+ sut.doWork();
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 5)
+ );
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+ verify(listener, never()).onTransferSuccess(anyInt());
+ }
+
+ @Test
+ void shouldExtract(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source1 = new LimitedStorageImpl(0);
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl();
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(C, 25),
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source2.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 10)
+ );
+ assertThat(source1.getAll()).isEmpty();
+ verify(listener, never()).onTransferSuccess(anyInt());
+ }
+
+ @Test
+ void shouldExtractAllowlist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source1 = new InMemoryStorageImpl();
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl();
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A, B));
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(C, 35),
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5)
+ );
+ assertThat(source2.getAll()).isEmpty();
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldExtractBlocklist(@InjectNetworkStorageComponent final StorageNetworkComponent networkStorage) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 35, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source1 = new InMemoryStorageImpl();
+ provider.set(0, source1);
+
+ final Storage source2 = new InMemoryStorageImpl();
+ provider.set(1, source2);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+ sut.setFilterMode(FilterMode.BLOCK);
+ sut.setFilters(Set.of(A, B));
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 15),
+ new ResourceAmount(D, 5)
+ );
+ assertThat(source1.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(C, 20)
+ );
+ assertThat(source2.getAll()).isEmpty();
+ verify(listener, never()).onTransferSuccess(anyInt());
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyExtractingBecauseStorageWasAlreadyEmpty() {
+ // Arrange
+ final Storage source = new InMemoryStorageImpl();
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyExtractingAllResources(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source = new InMemoryStorageImpl();
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).isEmpty();
+ assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyExtractingAllResourcesAndUsingFilterButInsertedNothing(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source = new InMemoryStorageImpl();
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A));
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(source.getAll()).isEmpty();
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 5),
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenReadyExtractingAllResourcesAndUsingFilterButStillExtractedSomething(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>())));
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 15L);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A));
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 5),
+ new ResourceAmount(C, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotifyListenerWhenExtractingAllResourcesAndReachingCapacity(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+ networkStorage.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ networkStorage.insert(C, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+
+ final Storage source = new LimitedStorageImpl(10);
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 100L);
+ sut.setMode(StorageTransferMode.EXTRACT_FROM_NETWORK);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(B, 5)
+ );
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(C, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldRespectNormalizer(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source = new InMemoryStorageImpl(new ResourceListImpl(new LinkedHashMap<>()));
+ source.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source.insert(A_ALTERNATIVE, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source.insert(B, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ source.insert(D, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(0, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+ sut.setFilterMode(FilterMode.ALLOW);
+ sut.setFilters(Set.of(A));
+ sut.setNormalizer(resource -> resource == A || resource == A_ALTERNATIVE ? A : resource);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(A, 5),
+ new ResourceAmount(A_ALTERNATIVE, 5)
+ );
+ assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrder(
+ new ResourceAmount(B, 5),
+ new ResourceAmount(D, 5)
+ );
+ verify(listener, times(1)).onTransferSuccess(0);
+ }
+
+ @Test
+ void shouldNotTransferAtIndexHigherThanHalf(
+ @InjectNetworkStorageComponent final StorageNetworkComponent networkStorage
+ ) {
+ // Arrange
+ networkStorage.addSource(new InMemoryStorageImpl());
+
+ final Storage source = new InMemoryStorageImpl();
+ source.insert(A, 5, Action.EXECUTE, EmptyActor.INSTANCE);
+ provider.set(sut.getSize() / 2, source);
+
+ sut.setProvider(provider);
+ sut.setTransferQuotaProvider(storage -> 20L);
+
+ // Act
+ sut.doWork();
+
+ // Assert
+ assertThat(networkStorage.getAll()).isEmpty();
+ assertThat(source.getAll()).usingRecursiveFieldByFieldElementComparator().containsExactly(
+ new ResourceAmount(A, 5)
+ );
+ verify(listener, never()).onTransferSuccess(1);
+ }
+}
diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java
index eb99af6f1..f1f4757ab 100644
--- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java
+++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/storage/StorageNetworkComponentImplTest.java
@@ -17,6 +17,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -38,15 +39,17 @@ class StorageNetworkComponentImplTest {
void setUp() {
sut = new StorageNetworkComponentImpl(new ResourceListImpl());
- storage1 = new StorageNetworkNode(0);
+ storage1 = new StorageNetworkNode(0, 0, 1);
storage1.setNetwork(new NetworkImpl(NetworkTestFixtures.NETWORK_COMPONENT_MAP_FACTORY));
- storage1.setStorage(new LimitedStorageImpl(100));
+ final var storage1S = new LimitedStorageImpl(100);
+ storage1.setProvider(index -> Optional.of(storage1S));
storage1.setActive(true);
storage1Container = () -> storage1;
- storage2 = new StorageNetworkNode(0);
+ storage2 = new StorageNetworkNode(0, 0, 1);
storage2.setNetwork(new NetworkImpl(NetworkTestFixtures.NETWORK_COMPONENT_MAP_FACTORY));
- storage2.setStorage(new LimitedStorageImpl(100));
+ final var storage2S = new LimitedStorageImpl(100);
+ storage2.setProvider(index -> Optional.of(storage2S));
storage2.setActive(true);
storage2Container = () -> storage2;
}
diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java
index c874ae24f..f4c499eae 100644
--- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java
+++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java
@@ -62,7 +62,7 @@ protected boolean updateCustomBlockEntityTag(final BlockPos pos,
private void updateBlockEntityTag(final BlockPos pos,
final Level level,
final ItemStack stack) {
- if (level.getBlockEntity(pos) instanceof ItemTransferableStorageBlockEntity blockEntity) {
+ if (level.getBlockEntity(pos) instanceof StorageBlockEntity blockEntity) {
helper.transferToBlockEntity(stack, blockEntity);
} else {
LOGGER.warn("Storage could not be set, block entity does not exist yet at {}", pos);
diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/ItemTransferableStorageBlockEntity.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageBlockEntity.java
similarity index 79%
rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/ItemTransferableStorageBlockEntity.java
rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageBlockEntity.java
index ffa22ac93..be88e8a16 100644
--- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/ItemTransferableStorageBlockEntity.java
+++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageBlockEntity.java
@@ -10,9 +10,9 @@
* The "storage block" is an example of such an item.
*/
@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.3")
-public interface ItemTransferableStorageBlockEntity {
+public interface StorageBlockEntity {
@Nullable
UUID getStorageId();
- void modifyStorageIdAfterAlreadyInitialized(UUID id);
+ void setStorageId(UUID storageId);
}
diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java
index b66fd0588..9d33a3bfa 100644
--- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java
+++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java
@@ -3,6 +3,7 @@
import com.refinedmods.refinedstorage2.api.storage.Storage;
import java.util.Optional;
+import java.util.function.Predicate;
import net.minecraft.world.item.ItemStack;
import org.apiguardian.api.API;
@@ -12,4 +13,8 @@ public interface StorageContainerItem {
Optional resolve(StorageRepository storageRepository, ItemStack stack);
Optional getInfo(StorageRepository storageRepository, ItemStack stack);
+
+ static Predicate stackValidator() {
+ return stack -> stack.getItem() instanceof StorageContainerItem;
+ }
}
diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java
index b2577334b..c2428eac2 100644
--- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java
+++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java
@@ -40,9 +40,9 @@ void appendToTooltip(ItemStack stack,
LongFunction amountFormatter,
boolean hasCapacity);
- void transferToBlockEntity(ItemStack stack, ItemTransferableStorageBlockEntity blockEntity);
+ void transferToBlockEntity(ItemStack stack, StorageBlockEntity blockEntity);
- void transferFromBlockEntity(ItemStack stack, ItemTransferableStorageBlockEntity blockEntity);
+ void transferFromBlockEntity(ItemStack stack, StorageBlockEntity blockEntity);
void registerDiskModel(Item item, ResourceLocation model);
diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java
index e1ddbbf85..af53007ed 100644
--- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java
+++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java
@@ -17,4 +17,6 @@ public interface StorageType {
CompoundTag toTag(Storage storage);
boolean isAllowed(ResourceKey resource);
+
+ long getDiskInterfaceTransferQuota(boolean stackUpgrade);
}
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_disk_interface.json
new file mode 100644
index 000000000..96ab91ebf
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/black"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_disk_interface.json
new file mode 100644
index 000000000..f587c6a20
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/blue"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_disk_interface.json
new file mode 100644
index 000000000..b5ac4702d
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/brown"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_disk_interface.json
new file mode 100644
index 000000000..b0099c895
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/cyan"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/disk_interface.json
new file mode 100644
index 000000000..2755db47a
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/light_blue"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_disk_interface.json
new file mode 100644
index 000000000..7a051d882
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/gray"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_disk_interface.json
new file mode 100644
index 000000000..1adce57bc
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/green"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_disk_interface.json
new file mode 100644
index 000000000..8a4c6ed50
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/light_gray"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_disk_interface.json
new file mode 100644
index 000000000..de167f2db
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/lime"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_disk_interface.json
new file mode 100644
index 000000000..517a38631
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/magenta"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_disk_interface.json
new file mode 100644
index 000000000..c1e249d23
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/orange"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_disk_interface.json
new file mode 100644
index 000000000..5a4930113
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/pink"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_disk_interface.json
new file mode 100644
index 000000000..5615980b9
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/purple"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_disk_interface.json
new file mode 100644
index 000000000..93d056560
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/red"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_disk_interface.json
new file mode 100644
index 000000000..4c4a2eaf8
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/white"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_disk_interface.json
new file mode 100644
index 000000000..3e12c26dc
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_disk_interface.json
@@ -0,0 +1,7 @@
+{
+ "variants": {
+ "": {
+ "model": "refinedstorage2:block/disk_interface/yellow"
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_black.json
new file mode 100644
index 000000000..5997a55f2
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_black.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/black",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_blue.json
new file mode 100644
index 000000000..492f404c9
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_blue.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/blue",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_brown.json
new file mode 100644
index 000000000..7812329fc
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_brown.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/brown",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_cyan.json
new file mode 100644
index 000000000..a5f7b6075
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_cyan.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/cyan",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_gray.json
new file mode 100644
index 000000000..99b86705d
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_gray.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/gray",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_green.json
new file mode 100644
index 000000000..8226df1fe
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_green.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/green",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_light_blue.json
new file mode 100644
index 000000000..dfbe37916
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_light_blue.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/light_blue",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_light_gray.json
new file mode 100644
index 000000000..80c05ac2b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_light_gray.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/light_gray",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_lime.json
new file mode 100644
index 000000000..f072cb384
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_lime.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/lime",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_magenta.json
new file mode 100644
index 000000000..d00996234
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_magenta.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/magenta",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_orange.json
new file mode 100644
index 000000000..b16aa07f1
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_orange.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/orange",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_pink.json
new file mode 100644
index 000000000..d160c7088
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_pink.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/pink",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_purple.json
new file mode 100644
index 000000000..d1dafa174
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_purple.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/purple",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_red.json
new file mode 100644
index 000000000..3d7900695
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_red.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/red",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_white.json
new file mode 100644
index 000000000..88bc33d05
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_white.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/white",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_yellow.json
new file mode 100644
index 000000000..9da598c1b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/base_yellow.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/emissive_north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/yellow",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/black.json
new file mode 100644
index 000000000..10c745d24
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/black.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:black_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/blue.json
new file mode 100644
index 000000000..f01f48431
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/blue.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:blue_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/brown.json
new file mode 100644
index 000000000..b089a425b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/brown.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:brown_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/cyan.json
new file mode 100644
index 000000000..bfa13bcbe
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/cyan.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:cyan_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/gray.json
new file mode 100644
index 000000000..4595afd28
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/gray.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:gray_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/green.json
new file mode 100644
index 000000000..9571d8ad7
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/green.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:green_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/inactive.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/inactive.json
new file mode 100644
index 000000000..39389d14b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/inactive.json
@@ -0,0 +1,13 @@
+{
+ "parent": "refinedstorage2:block/north_cutout",
+ "textures": {
+ "cutout": "refinedstorage2:block/disk_interface/cutouts/inactive",
+ "down": "refinedstorage2:block/bottom",
+ "east": "refinedstorage2:block/disk_interface/right",
+ "north": "refinedstorage2:block/disk_interface/front",
+ "particle": "refinedstorage2:block/disk_interface/right",
+ "south": "refinedstorage2:block/disk_interface/back",
+ "up": "refinedstorage2:block/disk_interface/top",
+ "west": "refinedstorage2:block/disk_interface/left"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/light_blue.json
new file mode 100644
index 000000000..685ef04f2
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/light_blue.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/light_gray.json
new file mode 100644
index 000000000..bb6bc83f1
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/light_gray.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:light_gray_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/lime.json
new file mode 100644
index 000000000..d2bea5f74
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/lime.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:lime_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/magenta.json
new file mode 100644
index 000000000..c9a7acb6c
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/magenta.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:magenta_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/orange.json
new file mode 100644
index 000000000..d77cb23ee
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/orange.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:orange_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/pink.json
new file mode 100644
index 000000000..4fce17282
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/pink.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:pink_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/purple.json
new file mode 100644
index 000000000..980a06800
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/purple.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:purple_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/red.json
new file mode 100644
index 000000000..636e74d81
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/red.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:red_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/white.json
new file mode 100644
index 000000000..58e6fd775
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/white.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:white_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/yellow.json
new file mode 100644
index 000000000..9f2b4eec6
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/disk_interface/yellow.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:yellow_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_disk_interface.json
new file mode 100644
index 000000000..10c745d24
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:black_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_disk_interface.json
new file mode 100644
index 000000000..f01f48431
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:blue_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_disk_interface.json
new file mode 100644
index 000000000..b089a425b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:brown_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_disk_interface.json
new file mode 100644
index 000000000..bfa13bcbe
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:cyan_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/disk_interface.json
new file mode 100644
index 000000000..685ef04f2
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_disk_interface.json
new file mode 100644
index 000000000..4595afd28
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:gray_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_disk_interface.json
new file mode 100644
index 000000000..9571d8ad7
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:green_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_disk_interface.json
new file mode 100644
index 000000000..bb6bc83f1
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:light_gray_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_disk_interface.json
new file mode 100644
index 000000000..d2bea5f74
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:lime_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_disk_interface.json
new file mode 100644
index 000000000..c9a7acb6c
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:magenta_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_disk_interface.json
new file mode 100644
index 000000000..d77cb23ee
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:orange_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_disk_interface.json
new file mode 100644
index 000000000..4fce17282
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:pink_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_disk_interface.json
new file mode 100644
index 000000000..980a06800
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:purple_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_disk_interface.json
new file mode 100644
index 000000000..636e74d81
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:red_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_disk_interface.json
new file mode 100644
index 000000000..58e6fd775
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:white_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_disk_interface.json
new file mode 100644
index 000000000..9f2b4eec6
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_disk_interface.json
@@ -0,0 +1,3 @@
+{
+ "loader": "refinedstorage2:yellow_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_disk_interface.json
new file mode 100644
index 000000000..2257e11c5
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/black_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/black_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_disk_interface.json
new file mode 100644
index 000000000..41ca613dd
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/blue_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/blue_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_disk_interface.json
new file mode 100644
index 000000000..e0ae1f4fc
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/brown_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/brown_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_disk_interface.json
new file mode 100644
index 000000000..858d22003
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/cyan_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/cyan_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_disk_interface.json
new file mode 100644
index 000000000..e1dd246f9
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/gray_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/gray_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_disk_interface.json
new file mode 100644
index 000000000..cc710d923
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/green_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/green_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_disk_interface.json
new file mode 100644
index 000000000..fb3a61b9a
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/light_blue_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/light_blue_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_disk_interface.json
new file mode 100644
index 000000000..ab7a7dced
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/light_gray_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/light_gray_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_disk_interface.json
new file mode 100644
index 000000000..2764afa20
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/lime_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/lime_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_disk_interface.json
new file mode 100644
index 000000000..119f28827
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/magenta_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/magenta_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_disk_interface.json
new file mode 100644
index 000000000..cf3152b32
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/orange_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/orange_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_disk_interface.json
new file mode 100644
index 000000000..390609317
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/pink_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/pink_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_disk_interface.json
new file mode 100644
index 000000000..9fe40f476
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/purple_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/purple_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_disk_interface.json
new file mode 100644
index 000000000..f79298968
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/red_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/red_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_disk_interface.json
new file mode 100644
index 000000000..d4a3b8de3
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/white_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/white_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_disk_interface.json
new file mode 100644
index 000000000..bc490b195
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_disk_interface.json
@@ -0,0 +1,32 @@
+{
+ "parent": "minecraft:recipes/root",
+ "criteria": {
+ "has_disk_interfaces": {
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ },
+ "trigger": "minecraft:inventory_changed"
+ },
+ "has_the_recipe": {
+ "conditions": {
+ "recipe": "refinedstorage2:coloring/yellow_disk_interface"
+ },
+ "trigger": "minecraft:recipe_unlocked"
+ }
+ },
+ "requirements": [
+ [
+ "has_the_recipe",
+ "has_disk_interfaces"
+ ]
+ ],
+ "rewards": {
+ "recipes": [
+ "refinedstorage2:coloring/yellow_disk_interface"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_disk_interface.json
new file mode 100644
index 000000000..08ff727bd
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:black_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/black_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_disk_interface.json
new file mode 100644
index 000000000..f4a5125a6
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:blue_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/blue_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_disk_interface.json
new file mode 100644
index 000000000..995cbabe6
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:brown_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/brown_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_disk_interface.json
new file mode 100644
index 000000000..21df5a33e
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:cyan_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/cyan_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/disk_interface.json
new file mode 100644
index 000000000..e248ac4d6
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_disk_interface.json
new file mode 100644
index 000000000..6c26b51f7
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:gray_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/gray_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_disk_interface.json
new file mode 100644
index 000000000..c276943c4
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:green_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/green_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_disk_interface.json
new file mode 100644
index 000000000..86fb8c088
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:light_gray_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/light_gray_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_disk_interface.json
new file mode 100644
index 000000000..b14c6fd0c
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:lime_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/lime_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_disk_interface.json
new file mode 100644
index 000000000..3f382a679
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:magenta_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/magenta_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_disk_interface.json
new file mode 100644
index 000000000..31d93f3a6
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:orange_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/orange_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_disk_interface.json
new file mode 100644
index 000000000..fb8d77572
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:pink_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/pink_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_disk_interface.json
new file mode 100644
index 000000000..1a19c8891
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:purple_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/purple_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_disk_interface.json
new file mode 100644
index 000000000..9d3ce96c5
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:red_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/red_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_disk_interface.json
new file mode 100644
index 000000000..1cdec3118
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:white_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/white_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_disk_interface.json
new file mode 100644
index 000000000..37d73407a
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_disk_interface.json
@@ -0,0 +1,21 @@
+{
+ "type": "minecraft:block",
+ "pools": [
+ {
+ "bonus_rolls": 0.0,
+ "conditions": [
+ {
+ "condition": "minecraft:survives_explosion"
+ }
+ ],
+ "entries": [
+ {
+ "type": "minecraft:item",
+ "name": "refinedstorage2:yellow_disk_interface"
+ }
+ ],
+ "rolls": 1.0
+ }
+ ],
+ "random_sequence": "refinedstorage2:blocks/yellow_disk_interface"
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_disk_interface.json
new file mode 100644
index 000000000..8899166f8
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:black_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:black_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_disk_interface.json
new file mode 100644
index 000000000..8fcd8ee90
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:blue_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:blue_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_disk_interface.json
new file mode 100644
index 000000000..2137c39b4
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:brown_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:brown_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_disk_interface.json
new file mode 100644
index 000000000..addc70460
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:cyan_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:cyan_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_disk_interface.json
new file mode 100644
index 000000000..8deecdabf
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:gray_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:gray_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_disk_interface.json
new file mode 100644
index 000000000..9b74acbb7
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:green_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:green_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_disk_interface.json
new file mode 100644
index 000000000..89ea9102b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:light_blue_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_disk_interface.json
new file mode 100644
index 000000000..326986dc8
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:light_gray_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:light_gray_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_disk_interface.json
new file mode 100644
index 000000000..9c5e02f19
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:lime_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:lime_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_disk_interface.json
new file mode 100644
index 000000000..ecc5b7197
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:magenta_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:magenta_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_disk_interface.json
new file mode 100644
index 000000000..b9a234195
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:orange_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:orange_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_disk_interface.json
new file mode 100644
index 000000000..7f35efabf
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:pink_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:pink_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_disk_interface.json
new file mode 100644
index 000000000..871acd659
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:purple_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:purple_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_disk_interface.json
new file mode 100644
index 000000000..db3119371
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:red_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:red_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_disk_interface.json
new file mode 100644
index 000000000..1e8012e2f
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:white_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:white_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_disk_interface.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_disk_interface.json
new file mode 100644
index 000000000..a65a2a5e1
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_disk_interface.json
@@ -0,0 +1,15 @@
+{
+ "type": "minecraft:crafting_shapeless",
+ "category": "misc",
+ "ingredients": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ },
+ {
+ "item": "minecraft:yellow_dye"
+ }
+ ],
+ "result": {
+ "item": "refinedstorage2:yellow_disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/disk_interfaces.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/disk_interfaces.json
new file mode 100644
index 000000000..571b84d29
--- /dev/null
+++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/disk_interfaces.json
@@ -0,0 +1,20 @@
+{
+ "values": [
+ "refinedstorage2:white_disk_interface",
+ "refinedstorage2:orange_disk_interface",
+ "refinedstorage2:magenta_disk_interface",
+ "refinedstorage2:disk_interface",
+ "refinedstorage2:yellow_disk_interface",
+ "refinedstorage2:lime_disk_interface",
+ "refinedstorage2:pink_disk_interface",
+ "refinedstorage2:gray_disk_interface",
+ "refinedstorage2:light_gray_disk_interface",
+ "refinedstorage2:cyan_disk_interface",
+ "refinedstorage2:purple_disk_interface",
+ "refinedstorage2:blue_disk_interface",
+ "refinedstorage2:brown_disk_interface",
+ "refinedstorage2:green_disk_interface",
+ "refinedstorage2:red_disk_interface",
+ "refinedstorage2:black_disk_interface"
+ ]
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java
index ad25bb221..126f06420 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java
@@ -24,6 +24,7 @@
import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType;
import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveScreen;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.DiskInterfaceScreen;
import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageScreen;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridScreen;
import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockScreen;
@@ -75,6 +76,7 @@ protected static void registerScreens(final ScreenRegistration registration) {
registration.register(Menus.INSTANCE.getFallbackSecurityCard(), FallbackSecurityCardScreen::new);
registration.register(Menus.INSTANCE.getSecurityManager(), SecurityManagerScreen::new);
registration.register(Menus.INSTANCE.getRelay(), RelayScreen::new);
+ registration.register(Menus.INSTANCE.getDiskInterface(), DiskInterfaceScreen::new);
}
protected static void registerAlternativeGridHints() {
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java
index 3ecce5d2d..8ea62326c 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java
@@ -71,6 +71,8 @@
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveBlock;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveContainerMenu;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.DiskInterfaceContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity;
@@ -146,6 +148,7 @@
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.DESTRUCTOR;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.DETECTOR;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.DISK_DRIVE;
+import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.DISK_INTERFACE;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.EXPORTER;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.EXTERNAL_STORAGE;
import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.FALLBACK_SECURITY_CARD;
@@ -293,7 +296,8 @@ protected final void registerBlocks(
final RegistryCallback callback,
final BiFunction diskDriveBlockEntityFactory,
final BiFunction portableGridBlockEntityFactory,
- final BiFunction creativePortableGridBlockEntityFactory
+ final BiFunction creativePortableGridBlockEntityFactory,
+ final BiFunction diskInterfaceBlockEntityFactory
) {
Blocks.INSTANCE.setQuartzEnrichedIronBlock(callback.register(QUARTZ_ENRICHED_IRON_BLOCK, SimpleBlock::new));
Blocks.INSTANCE.setDiskDrive(
@@ -338,6 +342,7 @@ protected final void registerBlocks(
)));
Blocks.INSTANCE.getSecurityManager().registerBlocks(callback);
Blocks.INSTANCE.getRelay().registerBlocks(callback);
+ Blocks.INSTANCE.setDiskInterface(diskInterfaceBlockEntityFactory).registerBlocks(callback);
}
protected final void registerItems(final RegistryCallback- callback) {
@@ -358,6 +363,7 @@ protected final void registerItems(final RegistryCallback
- callback) {
Blocks.INSTANCE.getNetworkTransmitter().registerItems(callback, Items.INSTANCE::addNetworkTransmitter);
Blocks.INSTANCE.getSecurityManager().registerItems(callback, Items.INSTANCE::addSecurityManager);
Blocks.INSTANCE.getRelay().registerItems(callback, Items.INSTANCE::addRelay);
+ Blocks.INSTANCE.getDiskInterface().registerItems(callback, Items.INSTANCE::addDiskInterface);
registerStorageItems(callback);
registerUpgrades(callback);
}
@@ -519,6 +525,10 @@ protected final void registerUpgradeMappings() {
PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.WIRELESS_TRANSMITTER)
.add(Items.INSTANCE.getRangeUpgrade(), 4)
.add(Items.INSTANCE.getCreativeRangeUpgrade());
+
+ PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.DISK_INTERFACE)
+ .add(Items.INSTANCE.getSpeedUpgrade(), 4)
+ .add(Items.INSTANCE.getStackUpgrade());
}
protected final void registerBlockEntities(
@@ -528,7 +538,9 @@ protected final void registerBlockEntities(
final BlockEntityTypeFactory.BlockEntitySupplier extends AbstractPortableGridBlockEntity>
portableGridBlockEntitySupplier,
final BlockEntityTypeFactory.BlockEntitySupplier extends AbstractPortableGridBlockEntity>
- creativePortableGridBlockEntitySupplier
+ creativePortableGridBlockEntitySupplier,
+ final BlockEntityTypeFactory.BlockEntitySupplier
+ diskInterfaceBlockEntitySupplier
) {
BlockEntities.INSTANCE.setCable(callback.register(
CABLE,
@@ -657,6 +669,10 @@ protected final void registerBlockEntities(
RELAY,
() -> typeFactory.create(RelayBlockEntity::new, Blocks.INSTANCE.getRelay().toArray())
));
+ BlockEntities.INSTANCE.setDiskInterface(callback.register(
+ DISK_INTERFACE,
+ () -> typeFactory.create(diskInterfaceBlockEntitySupplier, Blocks.INSTANCE.getDiskInterface().toArray())
+ ));
}
protected final void registerMenus(final RegistryCallback> callback,
@@ -756,6 +772,10 @@ protected final void registerMenus(final RegistryCallback> callback,
RELAY,
() -> menuTypeFactory.create(RelayContainerMenu::new)
));
+ Menus.INSTANCE.setDiskInterface(callback.register(
+ DISK_INTERFACE,
+ () -> menuTypeFactory.create(DiskInterfaceContainerMenu::new)
+ ));
}
protected final void registerLootFunctions(final RegistryCallback callback) {
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java
index 1bdb808b2..738a7afd4 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java
@@ -26,6 +26,8 @@ public interface Config {
DiskDriveEntry getDiskDrive();
+ DiskInterfaceEntry getDiskInterface();
+
SimpleEnergyUsageEntry getCable();
StorageBlockEntry getStorageBlock();
@@ -114,6 +116,10 @@ interface DiskDriveEntry extends SimpleEnergyUsageEntry {
long getEnergyUsagePerDisk();
}
+ interface DiskInterfaceEntry extends SimpleEnergyUsageEntry {
+ long getEnergyUsagePerDisk();
+ }
+
interface ControllerEntry {
long getEnergyCapacity();
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java
index ece31fd5d..cb6825030 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java
@@ -20,7 +20,7 @@ protected void init() {
super.init();
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
+ () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
));
addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE)));
addSideButton(new ConstructorDropItemsSideButtonWidget(
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java
index cd94473b5..15e2938c6 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java
@@ -17,6 +17,7 @@
import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType;
import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.AbstractPortableGridBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockBlockEntity;
@@ -83,6 +84,8 @@ public final class BlockEntities {
private Supplier> securityManager;
@Nullable
private Supplier> relay;
+ @Nullable
+ private Supplier> diskInterface;
private BlockEntities() {
}
@@ -274,4 +277,12 @@ public BlockEntityType getRelay() {
public void setRelay(final Supplier> supplier) {
this.relay = supplier;
}
+
+ public BlockEntityType getDiskInterface() {
+ return requireNonNull(diskInterface).get();
+ }
+
+ public void setDiskInterface(final Supplier> supplier) {
+ this.diskInterface = supplier;
+ }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java
index c4814773d..2a70dbc4d 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java
@@ -22,6 +22,8 @@
import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType;
import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveBlock;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.DiskInterfaceBlock;
import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageBlock;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridBlock;
import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlock;
@@ -33,10 +35,13 @@
import java.util.EnumMap;
import java.util.Map;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import javax.annotation.Nullable;
+import net.minecraft.core.BlockPos;
import net.minecraft.world.item.DyeColor;
+import net.minecraft.world.level.block.state.BlockState;
import static java.util.Objects.requireNonNull;
@@ -151,6 +156,8 @@ public final class Blocks {
ContentNames.RELAY,
COLOR
);
+ @Nullable
+ private BlockColorMap diskInterface;
@Nullable
private Supplier quartzEnrichedIronBlock;
@@ -312,4 +319,24 @@ public BlockColorMap getSecurityManager() {
public BlockColorMap getRelay() {
return relay;
}
+
+ public BlockColorMap setDiskInterface(
+ final BiFunction blockEntityFactory
+ ) {
+ this.diskInterface = new BlockColorMap<>(
+ (color, name) -> new DiskInterfaceBlock(
+ color,
+ name,
+ blockEntityFactory
+ ),
+ ContentIds.DISK_INTERFACE,
+ ContentNames.DISK_INTERFACE,
+ COLOR
+ );
+ return diskInterface;
+ }
+
+ public BlockColorMap getDiskInterface() {
+ return requireNonNull(diskInterface);
+ }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java
index 5d61fa250..e8b55f15f 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java
@@ -58,6 +58,7 @@ public final class ContentIds {
public static final ResourceLocation FALLBACK_SECURITY_CARD = createIdentifier("fallback_security_card");
public static final ResourceLocation SECURITY_MANAGER = createIdentifier("security_manager");
public static final ResourceLocation RELAY = createIdentifier("relay");
+ public static final ResourceLocation DISK_INTERFACE = createIdentifier("disk_interface");
private ContentIds() {
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java
index 6ce442caf..811af7e5b 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java
@@ -33,6 +33,7 @@ public final class ContentNames {
public static final MutableComponent FALLBACK_SECURITY_CARD = createTranslation("item", "fallback_security_card");
public static final MutableComponent SECURITY_MANAGER = name("security_manager");
public static final MutableComponent RELAY = name("relay");
+ public static final MutableComponent DISK_INTERFACE = name("disk_interface");
private ContentNames() {
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java
index f79f0546b..97c2159a3 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java
@@ -55,6 +55,7 @@ private static void appendBlocks(final Consumer consumer) {
Items.INSTANCE.getNetworkReceivers().stream().map(Supplier::get).forEach(itemConsumer);
Items.INSTANCE.getSecurityManagers().stream().map(Supplier::get).forEach(itemConsumer);
Items.INSTANCE.getRelays().stream().map(Supplier::get).forEach(itemConsumer);
+ Items.INSTANCE.getDiskInterfaces().stream().map(Supplier::get).forEach(itemConsumer);
}
private static void appendBlockColors(final Consumer consumer, final BlockColorMap, ?> map) {
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java
index cad36d18a..1e0b6c8a1 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java
@@ -10,9 +10,11 @@ public final class DefaultEnergyUsage {
public static final long GRID = 10;
public static final long CRAFTING_GRID = 14;
public static final long DISK_DRIVE = 10;
+ public static final long DISK_DRIVE_PER_DISK = 4;
+ public static final long DISK_INTERFACE = 6;
+ public static final long DISK_INTERFACE_PER_DISK = 4;
public static final long CONSTRUCTOR = 3;
public static final long DESTRUCTOR = 3;
- public static final long DISK_DRIVE_PER_DISK = 4;
public static final long STORAGE_MONITOR = 4;
public static final long NETWORK_RECEIVER = 8;
public static final long NETWORK_TRANSMITTER = 32;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java
index 07036ed8d..ace5950df 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java
@@ -49,6 +49,7 @@ public final class Items {
private final List> allNetworkTransmitters = new ArrayList<>();
private final List> allSecurityManagers = new ArrayList<>();
private final List> allRelays = new ArrayList<>();
+ private final List> allDiskInterfaces = new ArrayList<>();
@Nullable
private Supplier
- quartzEnrichedIron;
@Nullable
@@ -416,6 +417,14 @@ public List> getRelays() {
return Collections.unmodifiableList(allRelays);
}
+ public void addDiskInterface(final Supplier supplier) {
+ allDiskInterfaces.add(supplier);
+ }
+
+ public List> getDiskInterfaces() {
+ return Collections.unmodifiableList(allDiskInterfaces);
+ }
+
public Item getNetworkCard() {
return requireNonNull(networkCard).get();
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java
index 21c477e97..4faa928f5 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java
@@ -16,6 +16,7 @@
import com.refinedmods.refinedstorage2.platform.common.security.SecurityCardContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.security.SecurityManagerContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveContainerMenu;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.DiskInterfaceContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridBlockContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridItemContainerMenu;
@@ -83,6 +84,8 @@ public final class Menus {
private Supplier> securityManager;
@Nullable
private Supplier> relay;
+ @Nullable
+ private Supplier> diskInterface;
private Menus() {
}
@@ -280,4 +283,12 @@ public MenuType getRelay() {
public void setRelay(final Supplier> relay) {
this.relay = relay;
}
+
+ public MenuType getDiskInterface() {
+ return requireNonNull(diskInterface).get();
+ }
+
+ public void setDiskInterface(final Supplier> diskInterface) {
+ this.diskInterface = diskInterface;
+ }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java
index 068fdd0de..4c8dd0fd6 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java
@@ -25,6 +25,7 @@ public final class Tags {
public static final TagKey
- NETWORK_TRANSMITTERS = createTag("network_transmitters");
public static final TagKey
- SECURITY_MANAGERS = createTag("security_managers");
public static final TagKey
- RELAYS = createTag("relays");
+ public static final TagKey
- DISK_INTERFACES = createTag("disk_interfaces");
private Tags() {
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java
index b58ac5c46..3b049ecac 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java
@@ -17,7 +17,7 @@ protected void init() {
super.init();
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.GENERIC
+ () -> FuzzyModeSideButtonWidget.Type.GENERIC
));
addSideButton(new DetectorModeSideButtonWidget(getMenu().getProperty(DetectorPropertyTypes.MODE)));
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java
index 16bd5ea65..d3edd6243 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java
@@ -18,7 +18,7 @@ protected void init() {
super.init();
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
+ () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
));
addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE)));
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java
index 8a15592c9..238f39cbb 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java
@@ -1,9 +1,8 @@
package com.refinedmods.refinedstorage2.platform.common.grid;
import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants;
-import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider;
-import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType;
@@ -11,24 +10,12 @@
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.DyeColor;
-import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
-import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.block.state.StateDefinition;
-import net.minecraft.world.level.block.state.properties.BooleanProperty;
public abstract class AbstractGridBlock & BlockItemProvider, I extends BlockItem>
- extends AbstractDirectionalBlock
- implements EntityBlock, ColorableBlock {
- public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
-
- private final MutableComponent name;
- private final DyeColor color;
-
+ extends AbstractActiveColoredDirectionalBlock implements EntityBlock {
protected AbstractGridBlock(final MutableComponent name, final DyeColor color) {
- super(BlockConstants.PROPERTIES);
- this.name = name;
- this.color = color;
+ super(BlockConstants.PROPERTIES, color, name);
}
@Override
@@ -36,27 +23,6 @@ protected DirectionType getDirectionType() {
return BiDirectionType.INSTANCE;
}
- @Override
- protected BlockState getDefaultState() {
- return super.getDefaultState().setValue(ACTIVE, false);
- }
-
- @Override
- protected void createBlockStateDefinition(final StateDefinition.Builder builder) {
- super.createBlockStateDefinition(builder);
- builder.add(ACTIVE);
- }
-
- @Override
- public MutableComponent getName() {
- return name;
- }
-
- @Override
- public DyeColor getColor() {
- return color;
- }
-
@Override
public boolean canAlwaysConnect() {
return true;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java
index fcba67225..f9519a55d 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java
@@ -29,7 +29,7 @@ protected void init() {
addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE)));
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
+ () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
));
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java
index 442e12938..d7244864f 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java
@@ -25,7 +25,7 @@ protected void init() {
));
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.EXTRACTING_SOURCE
+ () -> FuzzyModeSideButtonWidget.Type.EXTRACTING_SOURCE
));
}
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardInventory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardInventory.java
index 60349cac6..c623642b3 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardInventory.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardInventory.java
@@ -1,19 +1,18 @@
package com.refinedmods.refinedstorage2.platform.common.networking;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
+
import java.util.Optional;
import net.minecraft.core.GlobalPos;
-import net.minecraft.world.SimpleContainer;
import net.minecraft.world.item.ItemStack;
-class NetworkCardInventory extends SimpleContainer {
+class NetworkCardInventory extends FilteredContainer {
NetworkCardInventory() {
- super(1);
- }
-
- @Override
- public boolean canPlaceItem(final int slot, final ItemStack stack) {
- return stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack);
+ super(
+ 1,
+ stack -> stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack)
+ );
}
ItemStack getNetworkCard() {
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayBlock.java
index b54b36db8..80debd7ba 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayBlock.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayBlock.java
@@ -4,11 +4,10 @@
import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants;
import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker;
-import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.BaseBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider;
-import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DefaultDirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker;
@@ -17,45 +16,28 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
+import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.block.state.StateDefinition;
-import net.minecraft.world.level.block.state.properties.BooleanProperty;
-public class RelayBlock extends AbstractDirectionalBlock
- implements EntityBlock, ColorableBlock, BlockItemProvider {
- public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
+public class RelayBlock extends AbstractActiveColoredDirectionalBlock
+ implements EntityBlock, BlockItemProvider {
+ private static final Component HELP = createTranslation("item", "relay.help");
private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>(
BlockEntities.INSTANCE::getRelay,
ACTIVE
);
- private final MutableComponent name;
- private final DyeColor color;
-
public RelayBlock(final DyeColor color, final MutableComponent name) {
- super(BlockConstants.PROPERTIES);
- this.name = name;
- this.color = color;
- }
-
- @Override
- protected BlockState getDefaultState() {
- return super.getDefaultState().setValue(ACTIVE, false);
- }
-
- @Override
- protected void createBlockStateDefinition(final StateDefinition.Builder builder) {
- super.createBlockStateDefinition(builder);
- builder.add(ACTIVE);
+ super(BlockConstants.PROPERTIES, color, name);
}
@Nullable
@@ -79,21 +61,11 @@ protected DirectionType getDirectionType() {
@Override
public BaseBlockItem createBlockItem() {
- return new BaseBlockItem(this);
+ return new BaseBlockItem(this, HELP);
}
@Override
public BlockColorMap getBlockColorMap() {
return Blocks.INSTANCE.getRelay();
}
-
- @Override
- public MutableComponent getName() {
- return name;
- }
-
- @Override
- public DyeColor getColor() {
- return color;
- }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayScreen.java
index 0192726f9..9b369e8a1 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/RelayScreen.java
@@ -94,7 +94,7 @@ private void addStorageButtons(final boolean visible) {
fuzzyModeButton = new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.STORAGE
+ () -> FuzzyModeSideButtonWidget.Type.STORAGE
);
fuzzyModeButton.visible = visible;
addSideButton(fuzzyModeButton);
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlock.java
index a49fb40f3..270034672 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlock.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlock.java
@@ -4,11 +4,10 @@
import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants;
import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker;
-import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.BaseBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider;
-import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock;
import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.direction.HorizontalDirection;
@@ -21,43 +20,23 @@
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.block.state.StateDefinition;
-import net.minecraft.world.level.block.state.properties.BooleanProperty;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
-public class SecurityManagerBlock extends AbstractDirectionalBlock
- implements ColorableBlock, BlockItemProvider, EntityBlock {
- public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
-
+public class SecurityManagerBlock
+ extends AbstractActiveColoredDirectionalBlock
+ implements BlockItemProvider, EntityBlock {
private static final MutableComponent HELP = createTranslation("block", "security_manager.help");
private static final AbstractBlockEntityTicker TICKER =
new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getSecurityManager, ACTIVE);
- private final DyeColor color;
- private final MutableComponent name;
-
public SecurityManagerBlock(final DyeColor color, final MutableComponent name) {
- super(BlockConstants.PROPERTIES);
- this.color = color;
- this.name = name;
- }
-
- @Override
- protected BlockState getDefaultState() {
- return super.getDefaultState().setValue(ACTIVE, false);
- }
-
- @Override
- protected void createBlockStateDefinition(final StateDefinition.Builder builder) {
- super.createBlockStateDefinition(builder);
- builder.add(ACTIVE);
+ super(BlockConstants.PROPERTIES, color, name);
}
@Override
@@ -70,16 +49,6 @@ public BlockColorMap getBlockColorMap() {
return Blocks.INSTANCE.getSecurityManager();
}
- @Override
- public DyeColor getColor() {
- return color;
- }
-
- @Override
- public MutableComponent getName() {
- return name;
- }
-
@Override
public BaseBlockItem createBlockItem() {
return new NetworkNodeBlockItem(this, HELP);
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlockEntity.java
index cceb99850..a4c9b5a1e 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerBlockEntity.java
@@ -9,7 +9,7 @@
import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
import com.refinedmods.refinedstorage2.platform.common.content.ContentNames;
import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops;
-import com.refinedmods.refinedstorage2.platform.common.support.SimpleFilteredContainer;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.NetworkNodeMenuProvider;
import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.util.ContainerUtil;
@@ -23,7 +23,6 @@
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
@@ -38,11 +37,11 @@ public class SecurityManagerBlockEntity
private static final String TAG_SECURITY_CARDS = "sc";
private static final String TAG_FALLBACK_SECURITY_CARD = "fsc";
- private final SimpleContainer securityCards = new SimpleFilteredContainer(
+ private final FilteredContainer securityCards = new FilteredContainer(
CARD_AMOUNT,
SecurityManagerBlockEntity::isValidSecurityCard
);
- private final SimpleContainer fallbackSecurityCard = new SimpleFilteredContainer(
+ private final FilteredContainer fallbackSecurityCard = new FilteredContainer(
1,
SecurityManagerBlockEntity::isValidFallbackSecurityCard
);
@@ -124,11 +123,11 @@ public NonNullList getDrops() {
return drops;
}
- SimpleContainer getSecurityCards() {
+ FilteredContainer getSecurityCards() {
return securityCards;
}
- SimpleContainer getFallbackSecurityCard() {
+ FilteredContainer getFallbackSecurityCard() {
return fallbackSecurityCard;
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerContainerMenu.java
index 78ece2d4e..6dc7a36c4 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerContainerMenu.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/security/SecurityManagerContainerMenu.java
@@ -2,8 +2,8 @@
import com.refinedmods.refinedstorage2.platform.common.content.Menus;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode;
-import com.refinedmods.refinedstorage2.platform.common.support.SimpleFilteredContainer;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ServerProperty;
@@ -11,7 +11,6 @@
import javax.annotation.Nullable;
-import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.Slot;
@@ -25,8 +24,8 @@ public SecurityManagerContainerMenu(final int syncId, final Inventory playerInve
super(Menus.INSTANCE.getSecurityManager(), syncId);
addSlots(
playerInventory,
- new SimpleFilteredContainer(CARD_AMOUNT, SecurityManagerBlockEntity::isValidSecurityCard),
- new SimpleFilteredContainer(1, SecurityManagerBlockEntity::isValidFallbackSecurityCard)
+ new FilteredContainer(CARD_AMOUNT, SecurityManagerBlockEntity::isValidSecurityCard),
+ new FilteredContainer(1, SecurityManagerBlockEntity::isValidFallbackSecurityCard)
);
registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE));
}
@@ -44,8 +43,8 @@ public SecurityManagerContainerMenu(final int syncId, final Inventory playerInve
}
private void addSlots(final Inventory playerInventory,
- final Container securityCards,
- final Container fallbackSecurityCard) {
+ final FilteredContainer securityCards,
+ final FilteredContainer fallbackSecurityCard) {
for (int i = 0; i < CARD_AMOUNT; ++i) {
final int column = i % 9;
final int x = 8 + (column * 18);
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractDiskContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractDiskContainerBlockEntity.java
new file mode 100644
index 000000000..5f39ab293
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractDiskContainerBlockEntity.java
@@ -0,0 +1,215 @@
+package com.refinedmods.refinedstorage2.platform.common.storage;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractStorageContainerNetworkNode;
+import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
+import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops;
+import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.NetworkNodeMenuProvider;
+import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl;
+import com.refinedmods.refinedstorage2.platform.common.util.ContainerUtil;
+
+import java.util.Set;
+import java.util.function.UnaryOperator;
+import javax.annotation.Nullable;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.NonNullList;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.nbt.Tag;
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.network.protocol.Packet;
+import net.minecraft.network.protocol.game.ClientGamePacketListener;
+import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
+import net.minecraft.server.level.ServerPlayer;
+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.BlockEntityType;
+import net.minecraft.world.level.block.state.BlockState;
+
+public abstract class AbstractDiskContainerBlockEntity
+ extends AbstractRedstoneModeNetworkNodeContainerBlockEntity
+ implements BlockEntityWithDrops, NetworkNodeMenuProvider {
+ private static final String TAG_DISK_INVENTORY = "inv";
+ private static final String TAG_DISKS = "disks";
+
+ protected final FilterWithFuzzyMode filter;
+ protected final DiskInventory diskInventory;
+ @Nullable
+ protected Disk[] disks;
+
+ private final DiskStateChangeListener diskStateListener = new DiskStateChangeListener(this);
+
+ protected AbstractDiskContainerBlockEntity(final BlockEntityType> type,
+ final BlockPos pos,
+ final BlockState state,
+ final T node) {
+ super(type, pos, state, node);
+ this.diskInventory = new DiskInventory((inventory, slot) -> onDiskChanged(slot), mainNode.getSize());
+ this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters(
+ ResourceContainerImpl.createForFilter(),
+ this::setChanged,
+ this::setFilters
+ );
+ this.mainNode.setListener(diskStateListener);
+ setNormalizer(filter.createNormalizer());
+ // It's important to sync here as the initial update packet might have failed as the network
+ // could possibly be not initialized yet.
+ this.initializationCallback = diskStateListener::immediateUpdate;
+ }
+
+ protected abstract void setFilters(Set filters);
+
+ protected abstract void setNormalizer(UnaryOperator normalizer);
+
+ @Nullable
+ public static Item getDisk(final CompoundTag tag, final int slot) {
+ if (!tag.contains(TAG_DISK_INVENTORY)) {
+ return null;
+ }
+ final CompoundTag diskInventoryTag = tag.getCompound(TAG_DISK_INVENTORY);
+ if (!ContainerUtil.hasItemInSlot(diskInventoryTag, slot)) {
+ return null;
+ }
+ final ItemStack diskStack = ContainerUtil.getItemInSlot(diskInventoryTag, slot);
+ return diskStack.isEmpty() ? null : diskStack.getItem();
+ }
+
+ void updateDiskStateIfNecessaryInLevel() {
+ diskStateListener.updateIfNecessary();
+ }
+
+ @Override
+ public void setLevel(final Level level) {
+ super.setLevel(level);
+ if (!level.isClientSide()) {
+ initialize(level);
+ }
+ }
+
+ /**
+ * When loading a disk drive in a normal flow it is: #load(CompoundTag) -> #setLevel(Level).
+ * Network initialization happens in #setLevel(Level).
+ * Loading data before network initialization ensures that all nbt is present (and thus disks are available).
+ * However, when we place a block entity with nbt, the flow is different:
+ * #setLevel(Level) -> #load(CompoundTag) -> #setChanged().
+ * #setLevel(Level) is called first (before #load(CompoundTag)) and initialization will happen BEFORE
+ * we load the tag!
+ * That's why we need to override #setChanged() here, to ensure that the network and disks are still initialized
+ * correctly in that case.
+ */
+ @Override
+ public void setChanged() {
+ super.setChanged();
+ if (level != null && !level.isClientSide()) {
+ initialize(level);
+ }
+ }
+
+ private void initialize(final Level level) {
+ diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level));
+ mainNode.setProvider(diskInventory);
+ }
+
+ @Override
+ public void activenessChanged(final boolean newActive) {
+ super.activenessChanged(newActive);
+ diskStateListener.immediateUpdate();
+ }
+
+ @Override
+ public void load(final CompoundTag tag) {
+ fromClientTag(tag);
+ if (tag.contains(TAG_DISK_INVENTORY)) {
+ ContainerUtil.read(tag.getCompound(TAG_DISK_INVENTORY), diskInventory);
+ }
+ super.load(tag);
+ }
+
+ @Override
+ public void readConfiguration(final CompoundTag tag) {
+ super.readConfiguration(tag);
+ filter.load(tag);
+ }
+
+ @Override
+ public void saveAdditional(final CompoundTag tag) {
+ super.saveAdditional(tag);
+ tag.put(TAG_DISK_INVENTORY, ContainerUtil.write(diskInventory));
+ }
+
+ @Override
+ public void writeConfiguration(final CompoundTag tag) {
+ super.writeConfiguration(tag);
+ filter.save(tag);
+ }
+
+ public FilteredContainer getDiskInventory() {
+ return diskInventory;
+ }
+
+ private void onDiskChanged(final int slot) {
+ // Level will not yet be present
+ final boolean isJustPlacedIntoLevelOrLoading = level == null || level.isClientSide();
+ // Level will be present, but network not yet
+ final boolean isPlacedThroughDismantlingMode = mainNode.getNetwork() == null;
+ if (isJustPlacedIntoLevelOrLoading || isPlacedThroughDismantlingMode) {
+ return;
+ }
+ mainNode.onStorageChanged(slot);
+ diskStateListener.immediateUpdate();
+ setChanged();
+ }
+
+ private void fromClientTag(final CompoundTag tag) {
+ if (!tag.contains(TAG_DISKS)) {
+ return;
+ }
+ disks = diskInventory.fromSyncTag(tag.getList(TAG_DISKS, Tag.TAG_COMPOUND));
+ onClientDriveStateUpdated();
+ }
+
+ protected void onClientDriveStateUpdated() {
+ diskStateListener.immediateUpdate();
+ }
+
+ @Override
+ public Packet getUpdatePacket() {
+ return ClientboundBlockEntityDataPacket.create(this);
+ }
+
+ @Override
+ public CompoundTag getUpdateTag() {
+ final CompoundTag tag = new CompoundTag();
+ // This null check is important. #getUpdateTag() can be called before the node's network is initialized!
+ if (mainNode.getNetwork() == null) {
+ return tag;
+ }
+ tag.put(TAG_DISKS, diskInventory.toSyncTag(mainNode::getState));
+ return tag;
+ }
+
+ @Override
+ public NonNullList getDrops() {
+ final NonNullList drops = NonNullList.create();
+ for (int i = 0; i < diskInventory.getContainerSize(); ++i) {
+ drops.add(diskInventory.getItem(i));
+ }
+ return drops;
+ }
+
+ @Override
+ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) {
+ filter.getFilterContainer().writeToUpdatePacket(buf);
+ }
+
+ @Override
+ protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState,
+ final BlockState newBlockState) {
+ return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState);
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java
index ee88a303e..5c8d5c29c 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java
@@ -44,7 +44,7 @@ protected void init() {
addSideButton(filterModeSideButtonWidget);
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.STORAGE
+ () -> FuzzyModeSideButtonWidget.Type.STORAGE
));
addSideButton(new AccessModeSideButtonWidget(getMenu().getProperty(StoragePropertyTypes.ACCESS_MODE)));
addSideButton(new PrioritySideButtonWidget(
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskContainerBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskContainerBlockEntityTicker.java
new file mode 100644
index 000000000..bd72bbf22
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskContainerBlockEntityTicker.java
@@ -0,0 +1,38 @@
+package com.refinedmods.refinedstorage2.platform.common.storage;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractStorageContainerNetworkNode;
+import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker;
+
+import java.util.function.Supplier;
+import javax.annotation.Nullable;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.entity.BlockEntityType;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.properties.BooleanProperty;
+
+public class DiskContainerBlockEntityTicker
+ >
+ extends NetworkNodeBlockEntityTicker {
+
+ public DiskContainerBlockEntityTicker(
+ final Supplier> allowedTypeSupplier
+ ) {
+ super(allowedTypeSupplier);
+ }
+
+ public DiskContainerBlockEntityTicker(final Supplier> allowedTypeSupplier,
+ @Nullable final BooleanProperty activenessProperty) {
+ super(allowedTypeSupplier, activenessProperty);
+ }
+
+ @Override
+ public void tick(final Level level,
+ final BlockPos pos,
+ final BlockState state,
+ final B blockEntity) {
+ super.tick(level, pos, state, blockEntity);
+ blockEntity.updateDiskStateIfNecessaryInLevel();
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskInventory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskInventory.java
index 5db389b00..3345e5bad 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskInventory.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/DiskInventory.java
@@ -1,10 +1,11 @@
package com.refinedmods.refinedstorage2.platform.common.storage;
-import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageProvider;
+import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractStorageContainerNetworkNode;
import com.refinedmods.refinedstorage2.api.storage.Storage;
import com.refinedmods.refinedstorage2.api.storage.StorageState;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItem;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
import java.util.Optional;
import java.util.function.IntFunction;
@@ -13,10 +14,9 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
-import net.minecraft.world.SimpleContainer;
import net.minecraft.world.item.ItemStack;
-public class DiskInventory extends SimpleContainer implements MultiStorageProvider {
+public class DiskInventory extends FilteredContainer implements AbstractStorageContainerNetworkNode.Provider {
private static final String TAG_DISK_STATE = "s";
private static final String TAG_DISK_ITEM_ID = "i";
@@ -25,7 +25,7 @@ public class DiskInventory extends SimpleContainer implements MultiStorageProvid
private StorageRepository storageRepository;
public DiskInventory(final DiskListener listener, final int diskCount) {
- super(diskCount);
+ super(diskCount, StorageContainerItem.stackValidator());
this.listener = listener;
}
@@ -33,11 +33,6 @@ public void setStorageRepository(@Nullable final StorageRepository storageReposi
this.storageRepository = storageRepository;
}
- @Override
- public boolean canPlaceItem(final int slot, final ItemStack stack) {
- return stack.getItem() instanceof StorageContainerItem;
- }
-
@Override
public ItemStack removeItem(final int slot, final int amount) {
// Forge InvWrapper calls this instead of setItem.
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java
index ddfff6b69..ad384439b 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java
@@ -117,6 +117,11 @@ public boolean isAllowed(final ResourceKey resource) {
return resource instanceof FluidResource;
}
+ @Override
+ public long getDiskInterfaceTransferQuota(final boolean stackUpgrade) {
+ return stackUpgrade ? Platform.INSTANCE.getBucketAmount() * 16 : Platform.INSTANCE.getBucketAmount();
+ }
+
public enum Variant {
SIXTY_FOUR_B("64b", 64L),
TWO_HUNDRED_FIFTY_SIX_B("256b", 256L),
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java
index 8f9d78c15..7f8893887 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java
@@ -116,6 +116,11 @@ public boolean isAllowed(final ResourceKey resource) {
return resource instanceof ItemResource;
}
+ @Override
+ public long getDiskInterfaceTransferQuota(final boolean stackUpgrade) {
+ return stackUpgrade ? 64 : 1;
+ }
+
public enum Variant {
ONE_K("1k", 1024L),
FOUR_K("4k", 1024 * 4L),
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java
index 84c88cc6b..ee061f0e6 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java
@@ -2,7 +2,7 @@
import com.refinedmods.refinedstorage2.api.storage.Storage;
import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
-import com.refinedmods.refinedstorage2.platform.api.storage.ItemTransferableStorageBlockEntity;
+import com.refinedmods.refinedstorage2.platform.api.storage.StorageBlockEntity;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItemHelper;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageInfo;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository;
@@ -127,15 +127,15 @@ public void appendToTooltip(final ItemStack stack,
}
@Override
- public void transferToBlockEntity(final ItemStack stack, final ItemTransferableStorageBlockEntity blockEntity) {
+ public void transferToBlockEntity(final ItemStack stack, final StorageBlockEntity blockEntity) {
getId(stack).ifPresent(id -> {
- blockEntity.modifyStorageIdAfterAlreadyInitialized(id);
+ blockEntity.setStorageId(id);
LOGGER.debug("Transferred storage {} to block entity {}", id, blockEntity);
});
}
@Override
- public void transferFromBlockEntity(final ItemStack stack, final ItemTransferableStorageBlockEntity blockEntity) {
+ public void transferFromBlockEntity(final ItemStack stack, final StorageBlockEntity blockEntity) {
final UUID storageId = blockEntity.getStorageId();
if (storageId != null) {
LOGGER.debug("Transferred storage {} from block entity {} to stack", storageId, blockEntity);
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java
index ca814bdb5..d46b02d2d 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java
@@ -1,212 +1,64 @@
package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive;
-import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode;
-import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
+import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
import com.refinedmods.refinedstorage2.platform.common.Platform;
import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
import com.refinedmods.refinedstorage2.platform.common.content.ContentNames;
-import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
-import com.refinedmods.refinedstorage2.platform.common.storage.DiskInventory;
-import com.refinedmods.refinedstorage2.platform.common.storage.DiskStateChangeListener;
+import com.refinedmods.refinedstorage2.platform.common.storage.AbstractDiskContainerBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainerImpl;
-import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
-import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops;
-import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode;
-import com.refinedmods.refinedstorage2.platform.common.support.containermenu.NetworkNodeMenuProvider;
-import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity;
-import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl;
-import com.refinedmods.refinedstorage2.platform.common.util.ContainerUtil;
-import javax.annotation.Nullable;
+import java.util.Set;
+import java.util.function.UnaryOperator;
import net.minecraft.core.BlockPos;
-import net.minecraft.core.NonNullList;
import net.minecraft.nbt.CompoundTag;
-import net.minecraft.nbt.Tag;
-import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
-import net.minecraft.network.protocol.Packet;
-import net.minecraft.network.protocol.game.ClientGamePacketListener;
-import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
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.state.BlockState;
-public abstract class AbstractDiskDriveBlockEntity
- extends AbstractRedstoneModeNetworkNodeContainerBlockEntity
- implements BlockEntityWithDrops, NetworkNodeMenuProvider {
- public static final int AMOUNT_OF_DISKS = 8;
+public abstract class AbstractDiskDriveBlockEntity extends AbstractDiskContainerBlockEntity {
+ static final int AMOUNT_OF_DISKS = 8;
- private static final String TAG_DISK_INVENTORY = "inv";
- private static final String TAG_DISKS = "disks";
-
- @Nullable
- protected Disk[] disks;
-
- private final DiskInventory diskInventory;
- private final FilterWithFuzzyMode filter;
private final StorageConfigurationContainerImpl configContainer;
- private final DiskStateChangeListener diskStateListener = new DiskStateChangeListener(this);
protected AbstractDiskDriveBlockEntity(final BlockPos pos, final BlockState state) {
- super(BlockEntities.INSTANCE.getDiskDrive(), pos, state, new MultiStorageNetworkNode(
+ super(BlockEntities.INSTANCE.getDiskDrive(), pos, state, new StorageNetworkNode(
Platform.INSTANCE.getConfig().getDiskDrive().getEnergyUsage(),
Platform.INSTANCE.getConfig().getDiskDrive().getEnergyUsagePerDisk(),
AMOUNT_OF_DISKS
));
- this.diskInventory = new DiskInventory((inventory, slot) -> onDiskChanged(slot), mainNode.getSize());
- this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters(
- ResourceContainerImpl.createForFilter(),
- this::setChanged,
- mainNode::setFilters
- );
this.configContainer = new StorageConfigurationContainerImpl(
- mainNode,
+ mainNode.getStorageConfiguration(),
filter,
this::setChanged,
this::getRedstoneMode,
this::setRedstoneMode
);
- this.mainNode.setListener(diskStateListener);
- this.mainNode.setNormalizer(filter.createNormalizer());
- // It's important to sync here as the initial update packet might have failed as the network
- // could possibly be not initialized yet.
- this.initializationCallback = diskStateListener::immediateUpdate;
- }
-
- @Nullable
- public static Item getDisk(final CompoundTag tag, final int slot) {
- if (!tag.contains(TAG_DISK_INVENTORY)) {
- return null;
- }
- final CompoundTag diskInventoryTag = tag.getCompound(TAG_DISK_INVENTORY);
- if (!ContainerUtil.hasItemInSlot(diskInventoryTag, slot)) {
- return null;
- }
- final ItemStack diskStack = ContainerUtil.getItemInSlot(diskInventoryTag, slot);
- return diskStack.isEmpty() ? null : diskStack.getItem();
- }
-
- void updateDiskStateIfNecessaryInLevel() {
- diskStateListener.updateIfNecessary();
}
@Override
- public void setLevel(final Level level) {
- super.setLevel(level);
- if (!level.isClientSide()) {
- initialize(level);
- }
+ protected void setFilters(final Set filters) {
+ mainNode.getStorageConfiguration().setFilters(filters);
}
- /**
- * When loading a disk drive in a normal flow it is: #load(CompoundTag) -> #setLevel(Level).
- * Network initialization happens in #setLevel(Level).
- * Loading data before network initialization ensures that all nbt is present (and thus disks are available).
- * However, when we place a block entity with nbt, the flow is different:
- * #setLevel(Level) -> #load(CompoundTag) -> #setChanged().
- * #setLevel(Level) is called first (before #load(CompoundTag)) and initialization will happen BEFORE
- * we load the tag!
- * That's why we need to override #setChanged() here, to ensure that the network and disks are still initialized
- * correctly in that case.
- */
@Override
- public void setChanged() {
- super.setChanged();
- if (level != null && !level.isClientSide()) {
- initialize(level);
- }
- }
-
- private void initialize(final Level level) {
- diskInventory.setStorageRepository(PlatformApi.INSTANCE.getStorageRepository(level));
- mainNode.setProvider(diskInventory);
- }
-
- @Override
- public void activenessChanged(final boolean newActive) {
- super.activenessChanged(newActive);
- diskStateListener.immediateUpdate();
- }
-
- @Override
- public void load(final CompoundTag tag) {
- fromClientTag(tag);
- if (tag.contains(TAG_DISK_INVENTORY)) {
- ContainerUtil.read(tag.getCompound(TAG_DISK_INVENTORY), diskInventory);
- }
- super.load(tag);
+ protected void setNormalizer(final UnaryOperator normalizer) {
+ mainNode.getStorageConfiguration().setNormalizer(normalizer);
}
@Override
public void readConfiguration(final CompoundTag tag) {
super.readConfiguration(tag);
configContainer.load(tag);
- filter.load(tag);
- }
-
- @Override
- public void saveAdditional(final CompoundTag tag) {
- super.saveAdditional(tag);
- tag.put(TAG_DISK_INVENTORY, ContainerUtil.write(diskInventory));
}
@Override
public void writeConfiguration(final CompoundTag tag) {
super.writeConfiguration(tag);
configContainer.save(tag);
- filter.save(tag);
- }
-
- public SimpleContainer getDiskInventory() {
- return diskInventory;
- }
-
- private void onDiskChanged(final int slot) {
- // Level will not yet be present
- final boolean isJustPlacedIntoLevelOrLoading = level == null || level.isClientSide();
- // Level will be present, but network not yet
- final boolean isPlacedThroughDismantlingMode = mainNode.getNetwork() == null;
- if (isJustPlacedIntoLevelOrLoading || isPlacedThroughDismantlingMode) {
- return;
- }
- mainNode.onStorageChanged(slot);
- diskStateListener.immediateUpdate();
- setChanged();
- }
-
- private void fromClientTag(final CompoundTag tag) {
- if (!tag.contains(TAG_DISKS)) {
- return;
- }
- disks = diskInventory.fromSyncTag(tag.getList(TAG_DISKS, Tag.TAG_COMPOUND));
- onClientDriveStateUpdated();
- }
-
- protected void onClientDriveStateUpdated() {
- diskStateListener.immediateUpdate();
- }
-
- @Override
- public Packet getUpdatePacket() {
- return ClientboundBlockEntityDataPacket.create(this);
- }
-
- @Override
- public CompoundTag getUpdateTag() {
- final CompoundTag tag = new CompoundTag();
- // This null check is important. #getUpdateTag() can be called before the node's network is initialized!
- if (mainNode.getNetwork() == null) {
- return tag;
- }
- tag.put(TAG_DISKS, diskInventory.toSyncTag(mainNode::getState));
- return tag;
}
@Override
@@ -225,24 +77,4 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory inv, f
new EmptyStorageDiskInfoAccessor()
);
}
-
- @Override
- public NonNullList getDrops() {
- final NonNullList drops = NonNullList.create();
- for (int i = 0; i < diskInventory.getContainerSize(); ++i) {
- drops.add(diskInventory.getItem(i));
- }
- return drops;
- }
-
- @Override
- public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) {
- filter.getFilterContainer().writeToUpdatePacket(buf);
- }
-
- @Override
- protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState,
- final BlockState newBlockState) {
- return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState);
- }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java
index 114e8f100..620ccc29d 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java
@@ -44,23 +44,12 @@ public void render(final T entity,
if (direction == null) {
return;
}
- render(entity, poseStack, vertexConsumers, direction);
- }
-
- private void render(final T entity,
- final PoseStack poseStack,
- final MultiBufferSource vertexConsumers,
- final BiDirection direction) {
final Disk[] disks = getDisks(entity);
- poseStack.pushPose();
- poseStack.translate(0.5F, 0.5F, 0.5F);
- poseStack.mulPose(direction.getQuaternion());
- poseStack.translate(-0.5F, -0.5F, -0.5F);
- final VertexConsumer vertexConsumer = vertexConsumers.getBuffer(renderType);
if (disks != null) {
- renderDiskLeds(poseStack, disks, vertexConsumer);
+ rotate(poseStack, direction);
+ renderDiskLeds(poseStack, disks, vertexConsumers.getBuffer(renderType));
+ postRotate(poseStack);
}
- poseStack.popPose();
}
private void renderDiskLeds(final PoseStack poseStack,
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java
index fa5752604..2a52594ac 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java
@@ -1,6 +1,9 @@
package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants;
+import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
+import com.refinedmods.refinedstorage2.platform.common.storage.DiskContainerBlockEntityTicker;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
@@ -23,7 +26,8 @@
public class DiskDriveBlock extends AbstractDirectionalBlock implements EntityBlock {
private static final Component HELP = createTranslation("item", "disk_drive.help");
- private static final DiskDriveBlockEntityTicker TICKER = new DiskDriveBlockEntityTicker();
+ private static final DiskContainerBlockEntityTicker TICKER =
+ new DiskContainerBlockEntityTicker<>(BlockEntities.INSTANCE::getDiskDrive);
private final BiFunction blockEntityFactory;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java
deleted file mode 100644
index 9b77b4538..000000000
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive;
-
-import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode;
-import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
-import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker;
-
-import net.minecraft.core.BlockPos;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.state.BlockState;
-
-class DiskDriveBlockEntityTicker
- extends NetworkNodeBlockEntityTicker {
-
- DiskDriveBlockEntityTicker() {
- super(BlockEntities.INSTANCE::getDiskDrive);
- }
-
- @Override
- public void tick(final Level level,
- final BlockPos pos,
- final BlockState state,
- final AbstractDiskDriveBlockEntity blockEntity) {
- super.tick(level, pos, state, blockEntity);
- blockEntity.updateDiskStateIfNecessaryInLevel();
- }
-}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java
index 1e9faa0b7..de2ae7155 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java
@@ -8,6 +8,7 @@
import com.refinedmods.refinedstorage2.platform.common.storage.AbstractStorageContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.StorageAccessor;
import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainer;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlotType;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot;
@@ -19,7 +20,6 @@
import java.util.stream.Stream;
import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.Slot;
@@ -45,7 +45,10 @@ public DiskDriveContainerMenu(final int syncId, final Inventory playerInventory,
));
addSlots(
playerInventory.player,
- new SimpleContainer(AbstractDiskDriveBlockEntity.AMOUNT_OF_DISKS),
+ new FilteredContainer(
+ AbstractDiskDriveBlockEntity.AMOUNT_OF_DISKS,
+ StorageContainerItem.stackValidator()
+ ),
ResourceContainerImpl.createForFilter()
);
initializeResourceSlots(buf);
@@ -53,23 +56,23 @@ public DiskDriveContainerMenu(final int syncId, final Inventory playerInventory,
DiskDriveContainerMenu(final int syncId,
final Player player,
- final SimpleContainer diskInventory,
- final ResourceContainer resourceContainer,
+ final FilteredContainer diskInventory,
+ final ResourceContainer filterContainer,
final StorageConfigurationContainer configContainer,
final StorageDiskInfoAccessor storageInfoAccessor) {
super(Menus.INSTANCE.getDiskDrive(), syncId, player, configContainer);
this.storageInfoAccessor = storageInfoAccessor;
- addSlots(player, diskInventory, resourceContainer);
+ addSlots(player, diskInventory, filterContainer);
}
private void addSlots(final Player player,
- final SimpleContainer diskInventory,
- final ResourceContainer resourceContainer) {
+ final FilteredContainer diskInventory,
+ final ResourceContainer filterContainer) {
for (int i = 0; i < diskInventory.getContainerSize(); ++i) {
diskSlots.add(addSlot(createDiskSlot(diskInventory, i)));
}
- for (int i = 0; i < resourceContainer.size(); ++i) {
- addSlot(createFilterSlot(resourceContainer, i));
+ for (int i = 0; i < filterContainer.size(); ++i) {
+ addSlot(createFilterSlot(filterContainer, i));
}
addPlayerInventory(player.getInventory(), 8, 141);
@@ -77,10 +80,10 @@ private void addSlots(final Player player,
transferManager.addFilterTransfer(player.getInventory());
}
- private Slot createFilterSlot(final ResourceContainer resourceContainer, final int i) {
+ private Slot createFilterSlot(final ResourceContainer filterContainer, final int i) {
final int x = FILTER_SLOT_X + (18 * i);
return new ResourceSlot(
- resourceContainer,
+ filterContainer,
i,
createTranslation("gui", "storage.filter_help"),
x,
@@ -89,10 +92,10 @@ private Slot createFilterSlot(final ResourceContainer resourceContainer, final i
);
}
- private Slot createDiskSlot(final SimpleContainer diskInventory, final int i) {
+ private Slot createDiskSlot(final FilteredContainer diskInventory, final int i) {
final int x = DISK_SLOT_X + ((i % 2) * 18);
final int y = DISK_SLOT_Y + Math.floorDiv(i, 2) * 18;
- return new ValidatedSlot(diskInventory, i, x, y, stack -> stack.getItem() instanceof StorageContainerItem);
+ return ValidatedSlot.forStorageContainer(diskInventory, i, x, y);
}
@Override
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java
new file mode 100644
index 000000000..f95788cd5
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntity.java
@@ -0,0 +1,220 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferListener;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferMode;
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
+import com.refinedmods.refinedstorage2.api.resource.ResourceKey;
+import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
+import com.refinedmods.refinedstorage2.platform.api.storage.SerializableStorage;
+import com.refinedmods.refinedstorage2.platform.common.Platform;
+import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
+import com.refinedmods.refinedstorage2.platform.common.content.ContentNames;
+import com.refinedmods.refinedstorage2.platform.common.content.Items;
+import com.refinedmods.refinedstorage2.platform.common.storage.AbstractDiskContainerBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings;
+import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer;
+import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.function.UnaryOperator;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.NonNullList;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.nbt.Tag;
+import net.minecraft.network.chat.Component;
+import net.minecraft.world.entity.player.Inventory;
+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.block.state.BlockState;
+
+// TODO: upgradeable + level interacting class hierarchy? Disk Interface is copying stuff now... :(
+public abstract class AbstractDiskInterfaceBlockEntity
+ extends AbstractDiskContainerBlockEntity
+ implements StorageTransferListener {
+ public static final int AMOUNT_OF_DISKS = 6;
+
+ private static final String TAG_UPGRADES = "u";
+ private static final String TAG_FILTER_MODE = "fim";
+ private static final String TAG_TRANSFER_MODE = "tm";
+
+ private final UpgradeContainer upgradeContainer;
+ private int workTickRate = 9;
+ private int workTicks;
+
+ protected AbstractDiskInterfaceBlockEntity(final BlockPos pos, final BlockState state) {
+ super(BlockEntities.INSTANCE.getDiskInterface(), pos, state, new StorageTransferNetworkNode(
+ Platform.INSTANCE.getConfig().getDiskInterface().getEnergyUsage(),
+ Platform.INSTANCE.getConfig().getDiskInterface().getEnergyUsagePerDisk(),
+ AMOUNT_OF_DISKS
+ ));
+ this.upgradeContainer = new UpgradeContainer(
+ UpgradeDestinations.DISK_INTERFACE,
+ PlatformApi.INSTANCE.getUpgradeRegistry(),
+ this::upgradeContainerChanged
+ );
+ this.mainNode.setListener(this);
+ this.mainNode.setTransferQuotaProvider(storage -> {
+ if (storage instanceof SerializableStorage serializableStorage) {
+ return serializableStorage.getType().getDiskInterfaceTransferQuota(
+ upgradeContainer.has(Items.INSTANCE.getStackUpgrade())
+ );
+ }
+ return 1;
+ });
+ }
+
+ private void upgradeContainerChanged() {
+ configureAccordingToUpgrades();
+ setChanged();
+ }
+
+ private void configureAccordingToUpgrades() {
+ final int amountOfSpeedUpgrades = upgradeContainer.getAmount(Items.INSTANCE.getSpeedUpgrade());
+ this.workTickRate = 9 - (amountOfSpeedUpgrades * 2);
+ final long baseEnergyUsage = Platform.INSTANCE.getConfig().getDiskInterface().getEnergyUsage();
+ mainNode.setEnergyUsage(baseEnergyUsage + upgradeContainer.getEnergyUsage());
+ }
+
+ @Override
+ public final void doWork() {
+ if (workTicks++ % workTickRate == 0) {
+ super.doWork();
+ }
+ }
+
+ @Override
+ protected void setFilters(final Set filters) {
+ mainNode.setFilters(filters);
+ }
+
+ @Override
+ protected void setNormalizer(final UnaryOperator normalizer) {
+ mainNode.setNormalizer(normalizer);
+ }
+
+ @Override
+ public void load(final CompoundTag tag) {
+ if (tag.contains(TAG_UPGRADES)) {
+ upgradeContainer.fromTag(tag.getList(TAG_UPGRADES, Tag.TAG_COMPOUND));
+ }
+ configureAccordingToUpgrades();
+ super.load(tag);
+ }
+
+ @Override
+ public void saveAdditional(final CompoundTag tag) {
+ super.saveAdditional(tag);
+ tag.put(TAG_UPGRADES, upgradeContainer.createTag());
+ tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(mainNode.getFilterMode()));
+ }
+
+ @Override
+ public void readConfiguration(final CompoundTag tag) {
+ super.readConfiguration(tag);
+ if (tag.contains(TAG_TRANSFER_MODE)) {
+ mainNode.setMode(TransferModeSettings.getTransferMode(tag.getInt(TAG_TRANSFER_MODE)));
+ }
+ if (tag.contains(TAG_FILTER_MODE)) {
+ mainNode.setFilterMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE)));
+ }
+ }
+
+ @Override
+ public void writeConfiguration(final CompoundTag tag) {
+ super.writeConfiguration(tag);
+ tag.putInt(TAG_TRANSFER_MODE, TransferModeSettings.getTransferMode(mainNode.getMode()));
+ }
+
+ @Override
+ public List
- getUpgradeItems() {
+ final List
- upgradeItems = new ArrayList<>();
+ for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) {
+ final ItemStack itemStack = upgradeContainer.getItem(i);
+ if (itemStack.isEmpty()) {
+ continue;
+ }
+ upgradeItems.add(itemStack.getItem());
+ }
+ return upgradeItems;
+ }
+
+ @Override
+ public boolean addUpgradeItem(final Item upgradeItem) {
+ return upgradeContainer.addItem(new ItemStack(upgradeItem)).isEmpty();
+ }
+
+ @Override
+ public Component getDisplayName() {
+ return ContentNames.DISK_INTERFACE;
+ }
+
+ @Override
+ public AbstractContainerMenu createMenu(final int syncId, final Inventory inv, final Player player) {
+ return new DiskInterfaceContainerMenu(
+ syncId,
+ player,
+ this,
+ diskInventory,
+ filter.getFilterContainer(),
+ upgradeContainer
+ );
+ }
+
+ @Override
+ public NonNullList getDrops() {
+ final NonNullList drops = super.getDrops();
+ for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) {
+ drops.add(upgradeContainer.getItem(i));
+ }
+ return drops;
+ }
+
+ boolean isFuzzyMode() {
+ return filter.isFuzzyMode();
+ }
+
+ void setFuzzyMode(final boolean fuzzyMode) {
+ filter.setFuzzyMode(fuzzyMode);
+ setChanged();
+ }
+
+ FilterMode getFilterMode() {
+ return mainNode.getFilterMode();
+ }
+
+ void setFilterMode(final FilterMode mode) {
+ mainNode.setFilterMode(mode);
+ setChanged();
+ }
+
+ public StorageTransferMode getTransferMode() {
+ return mainNode.getMode();
+ }
+
+ public void setTransferMode(final StorageTransferMode mode) {
+ mainNode.setMode(mode);
+ setChanged();
+ }
+
+ @Override
+ public void onTransferSuccess(final int index) {
+ final ItemStack diskStack = diskInventory.getItem(index);
+ if (diskStack.isEmpty()) {
+ return;
+ }
+ for (int newIndex = AMOUNT_OF_DISKS / 2; newIndex < AMOUNT_OF_DISKS; ++newIndex) {
+ if (!diskInventory.getItem(newIndex).isEmpty()) {
+ continue;
+ }
+ diskInventory.setItem(index, ItemStack.EMPTY);
+ diskInventory.setItem(newIndex, diskStack);
+ return;
+ }
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java
new file mode 100644
index 000000000..6dd7acc9b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/AbstractDiskInterfaceBlockEntityRenderer.java
@@ -0,0 +1,65 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
+import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
+import com.refinedmods.refinedstorage2.platform.common.support.render.AbstractDiskLedBlockEntityRenderer;
+
+import javax.annotation.Nullable;
+
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.mojang.blaze3d.vertex.VertexConsumer;
+import net.minecraft.client.renderer.MultiBufferSource;
+import net.minecraft.client.renderer.RenderType;
+import net.minecraft.core.Direction;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.state.BlockState;
+
+public abstract class AbstractDiskInterfaceBlockEntityRenderer
+ extends AbstractDiskLedBlockEntityRenderer {
+ private final RenderType renderType;
+
+ protected AbstractDiskInterfaceBlockEntityRenderer(final RenderType renderType) {
+ this.renderType = renderType;
+ }
+
+ @Nullable
+ protected abstract Disk[] getDisks(T blockEntity);
+
+ @Override
+ public void render(final T entity,
+ final float tickDelta,
+ final PoseStack poseStack,
+ final MultiBufferSource vertexConsumers,
+ final int light,
+ final int overlay) {
+ final Level level = entity.getLevel();
+ if (level == null) {
+ return;
+ }
+ final BlockState blockState = level.getBlockState(entity.getBlockPos());
+ if (!(blockState.getBlock() instanceof DiskInterfaceBlock diskInterfaceBlock)) {
+ return;
+ }
+ final BiDirection direction = diskInterfaceBlock.getDirection(blockState);
+ if (direction == null) {
+ return;
+ }
+ final Disk[] disks = getDisks(entity);
+ if (disks != null) {
+ rotate(poseStack, direction);
+ renderDiskLeds(poseStack, disks, vertexConsumers.getBuffer(renderType));
+ postRotate(poseStack);
+ }
+ }
+
+ private void renderDiskLeds(final PoseStack poseStack,
+ final Disk[] disks,
+ final VertexConsumer vertexConsumer) {
+ for (int i = 0; i < 6; ++i) {
+ final int x = i < 3 ? 0 : 1;
+ final int y = i % 3;
+ final Disk disk = disks[i];
+ renderLed(poseStack, vertexConsumer, 10 - (x * 7), 8 - (y * 3), -1, disk, Direction.SOUTH);
+ }
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceBlock.java
new file mode 100644
index 000000000..c1035995b
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceBlock.java
@@ -0,0 +1,83 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferNetworkNode;
+import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap;
+import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants;
+import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
+import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
+import com.refinedmods.refinedstorage2.platform.common.storage.DiskContainerBlockEntityTicker;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
+import com.refinedmods.refinedstorage2.platform.common.support.BaseBlockItem;
+import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider;
+import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockItem;
+import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
+import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType;
+import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType;
+
+import java.util.function.BiFunction;
+import javax.annotation.Nullable;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.MutableComponent;
+import net.minecraft.world.item.DyeColor;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.EntityBlock;
+import net.minecraft.world.level.block.entity.BlockEntity;
+import net.minecraft.world.level.block.entity.BlockEntityTicker;
+import net.minecraft.world.level.block.entity.BlockEntityType;
+import net.minecraft.world.level.block.state.BlockState;
+
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
+
+public class DiskInterfaceBlock
+ extends AbstractActiveColoredDirectionalBlock
+ implements EntityBlock, BlockItemProvider {
+ private static final Component HELP = createTranslation("item", "disk_interface.help");
+ private static final DiskContainerBlockEntityTicker
+ TICKER = new DiskContainerBlockEntityTicker<>(BlockEntities.INSTANCE::getDiskInterface, ACTIVE);
+
+ private final BiFunction blockEntityFactory;
+
+ public DiskInterfaceBlock(final DyeColor color,
+ final MutableComponent name,
+ final BiFunction
+ blockEntityFactory) {
+ super(BlockConstants.PROPERTIES, color, name);
+ this.blockEntityFactory = blockEntityFactory;
+ }
+
+ @Override
+ protected DirectionType getDirectionType() {
+ return BiDirectionType.INSTANCE;
+ }
+
+ @Nullable
+ @Override
+ public BlockEntityTicker getTicker(final Level level,
+ final BlockState blockState,
+ final BlockEntityType type) {
+ return TICKER.get(level, type);
+ }
+
+ @Nullable
+ @Override
+ public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) {
+ return blockEntityFactory.apply(blockPos, blockState);
+ }
+
+ @Override
+ public BlockColorMap getBlockColorMap() {
+ return Blocks.INSTANCE.getDiskInterface();
+ }
+
+ @Override
+ public BaseBlockItem createBlockItem() {
+ return new NetworkNodeBlockItem(this, HELP);
+ }
+
+ @Override
+ public boolean canAlwaysConnect() {
+ return true;
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceContainerMenu.java
new file mode 100644
index 000000000..6ebe012eb
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceContainerMenu.java
@@ -0,0 +1,127 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferMode;
+import com.refinedmods.refinedstorage2.api.resource.filter.FilterMode;
+import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
+import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItem;
+import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer;
+import com.refinedmods.refinedstorage2.platform.common.content.Menus;
+import com.refinedmods.refinedstorage2.platform.common.storage.DiskInventory;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
+import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlotType;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ServerProperty;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot;
+import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl;
+import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer;
+import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations;
+import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeSlot;
+
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.world.entity.player.Inventory;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.inventory.Slot;
+
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
+
+public class DiskInterfaceContainerMenu extends AbstractResourceContainerMenu {
+ private static final int DISK_SLOT_X1 = 44;
+ private static final int DISK_SLOT_X2 = 116;
+ private static final int DISK_SLOT_Y = 57;
+
+ private static final int FILTER_SLOT_X = 8;
+ private static final int FILTER_SLOT_Y = 20;
+
+ DiskInterfaceContainerMenu(final int syncId,
+ final Player player,
+ final AbstractDiskInterfaceBlockEntity blockEntity,
+ final DiskInventory diskInventory,
+ final ResourceContainer filterContainer,
+ final UpgradeContainer upgradeContainer) {
+ super(Menus.INSTANCE.getDiskInterface(), syncId, player);
+ addSlots(player, diskInventory, filterContainer, upgradeContainer);
+ registerProperty(new ServerProperty<>(
+ PropertyTypes.REDSTONE_MODE,
+ blockEntity::getRedstoneMode,
+ blockEntity::setRedstoneMode
+ ));
+ registerProperty(new ServerProperty<>(
+ PropertyTypes.FUZZY_MODE,
+ blockEntity::isFuzzyMode,
+ blockEntity::setFuzzyMode
+ ));
+ registerProperty(new ServerProperty<>(
+ PropertyTypes.FILTER_MODE,
+ blockEntity::getFilterMode,
+ blockEntity::setFilterMode
+ ));
+ registerProperty(new ServerProperty<>(
+ DiskInterfacePropertyTypes.TRANSFER_MODE,
+ blockEntity::getTransferMode,
+ blockEntity::setTransferMode
+ ));
+ }
+
+ public DiskInterfaceContainerMenu(final int syncId, final Inventory playerInventory, final FriendlyByteBuf buf) {
+ super(Menus.INSTANCE.getDiskInterface(), syncId);
+ addSlots(
+ playerInventory.player,
+ new FilteredContainer(
+ AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS,
+ StorageContainerItem.stackValidator()
+ ),
+ ResourceContainerImpl.createForFilter(),
+ new UpgradeContainer(UpgradeDestinations.DISK_INTERFACE, PlatformApi.INSTANCE.getUpgradeRegistry())
+ );
+ initializeResourceSlots(buf);
+ registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE));
+ registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false));
+ registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK));
+ registerProperty(new ClientProperty<>(
+ DiskInterfacePropertyTypes.TRANSFER_MODE,
+ StorageTransferMode.INSERT_INTO_NETWORK
+ ));
+ }
+
+ private void addSlots(final Player player,
+ final FilteredContainer diskInventory,
+ final ResourceContainer filterContainer,
+ final UpgradeContainer upgradeContainer) {
+ for (int i = 0; i < diskInventory.getContainerSize(); ++i) {
+ addSlot(createDiskSlot(diskInventory, i));
+ }
+ for (int i = 0; i < filterContainer.size(); ++i) {
+ addSlot(createFilterSlot(filterContainer, i));
+ }
+ for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) {
+ addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18)));
+ }
+ addPlayerInventory(player.getInventory(), 8, 129);
+
+ transferManager.addBiTransfer(player.getInventory(), upgradeContainer);
+ transferManager.addBiTransfer(player.getInventory(), diskInventory);
+ transferManager.addFilterTransfer(player.getInventory());
+ }
+
+ private Slot createFilterSlot(final ResourceContainer filterContainer, final int i) {
+ final int x = FILTER_SLOT_X + (18 * i);
+ return new ResourceSlot(
+ filterContainer,
+ i,
+ createTranslation("gui", "disk_interface.filter_help"),
+ x,
+ FILTER_SLOT_Y,
+ ResourceSlotType.FILTER
+ );
+ }
+
+ private Slot createDiskSlot(final FilteredContainer diskInventory, final int i) {
+ final int x = i < 3 ? DISK_SLOT_X1 : DISK_SLOT_X2;
+ final int y = DISK_SLOT_Y + ((i % 3) * 18);
+ return ValidatedSlot.forStorageContainer(diskInventory, i, x, y);
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfacePropertyTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfacePropertyTypes.java
new file mode 100644
index 000000000..471c88709
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfacePropertyTypes.java
@@ -0,0 +1,17 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferMode;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType;
+
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier;
+
+class DiskInterfacePropertyTypes {
+ public static final PropertyType TRANSFER_MODE = new PropertyType<>(
+ createIdentifier("transfer_mode"),
+ TransferModeSettings::getTransferMode,
+ TransferModeSettings::getTransferMode
+ );
+
+ private DiskInterfacePropertyTypes() {
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceScreen.java
new file mode 100644
index 000000000..9c1e0d7ad
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/DiskInterfaceScreen.java
@@ -0,0 +1,66 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferMode;
+import com.refinedmods.refinedstorage2.platform.common.storage.FilterModeSideButtonWidget;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes;
+import com.refinedmods.refinedstorage2.platform.common.support.widget.FuzzyModeSideButtonWidget;
+import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget;
+
+import net.minecraft.client.gui.GuiGraphics;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.MutableComponent;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.entity.player.Inventory;
+
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier;
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
+
+public class DiskInterfaceScreen extends AbstractBaseScreen {
+ private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/disk_interface.png");
+
+ private static final MutableComponent IN_TEXT = createTranslation("gui", "disk_interface.in");
+ private static final MutableComponent OUT_TEXT = createTranslation("gui", "disk_interface.out");
+
+ public DiskInterfaceScreen(final DiskInterfaceContainerMenu menu,
+ final Inventory playerInventory,
+ final Component text) {
+ super(menu, playerInventory, text);
+ this.inventoryLabelY = 117;
+ this.imageWidth = 211;
+ this.imageHeight = 211;
+ }
+
+ @Override
+ protected void init() {
+ super.init();
+ addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE)));
+ addSideButton(new TransferModeSideButtonWidget(
+ getMenu().getProperty(DiskInterfacePropertyTypes.TRANSFER_MODE)
+ ));
+ addSideButton(new FilterModeSideButtonWidget(
+ getMenu().getProperty(PropertyTypes.FILTER_MODE),
+ createTranslation("gui", "disk_interface.filter_mode.allow.help"),
+ createTranslation("gui", "disk_interface.filter_mode.block.help")
+ ));
+ addSideButton(new FuzzyModeSideButtonWidget(
+ getMenu().getProperty(PropertyTypes.FUZZY_MODE),
+ () -> getMenu().getProperty(DiskInterfacePropertyTypes.TRANSFER_MODE).getValue()
+ == StorageTransferMode.EXTRACT_FROM_NETWORK
+ ? FuzzyModeSideButtonWidget.Type.EXTRACTING_STORAGE_NETWORK
+ : FuzzyModeSideButtonWidget.Type.EXTRACTING_SOURCE
+ ));
+ }
+
+ @Override
+ protected void renderLabels(final GuiGraphics graphics, final int x, final int y) {
+ super.renderLabels(graphics, x, y);
+ graphics.drawString(font, IN_TEXT, 43, 45, 4210752, false);
+ graphics.drawString(font, OUT_TEXT, 115, 45, 4210752, false);
+ }
+
+ @Override
+ protected ResourceLocation getTexture() {
+ return TEXTURE;
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/TransferModeSettings.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/TransferModeSettings.java
new file mode 100644
index 000000000..c142d7b1d
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/TransferModeSettings.java
@@ -0,0 +1,26 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferMode;
+
+class TransferModeSettings {
+ private static final int INSERT_INTO_NETWORK = 0;
+ private static final int EXTRACT_FROM_NETWORK = 1;
+
+ private TransferModeSettings() {
+ }
+
+ static StorageTransferMode getTransferMode(final int transferMode) {
+ return switch (transferMode) {
+ case INSERT_INTO_NETWORK -> StorageTransferMode.INSERT_INTO_NETWORK;
+ case EXTRACT_FROM_NETWORK -> StorageTransferMode.EXTRACT_FROM_NETWORK;
+ default -> StorageTransferMode.INSERT_INTO_NETWORK;
+ };
+ }
+
+ static int getTransferMode(final StorageTransferMode transferMode) {
+ return switch (transferMode) {
+ case INSERT_INTO_NETWORK -> INSERT_INTO_NETWORK;
+ case EXTRACT_FROM_NETWORK -> EXTRACT_FROM_NETWORK;
+ };
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/TransferModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/TransferModeSideButtonWidget.java
new file mode 100644
index 000000000..bc44cc2bb
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/TransferModeSideButtonWidget.java
@@ -0,0 +1,74 @@
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.network.impl.node.storagetransfer.StorageTransferMode;
+import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty;
+import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget;
+
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.MutableComponent;
+
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
+
+class TransferModeSideButtonWidget extends AbstractSideButtonWidget {
+ private static final MutableComponent TITLE = createTranslation("gui", "disk_interface.transfer_mode");
+ private static final MutableComponent SUBTEXT_INSERT_INTO_NETWORK =
+ createTranslation("gui", "disk_interface.transfer_mode.insert_into_network");
+ private static final MutableComponent SUBTEXT_EXTRACT_FROM_NETWORK =
+ createTranslation("gui", "disk_interface.transfer_mode.extract_from_network");
+ private static final Component HELP_INSERT_INTO_NETWORK =
+ createTranslation("gui", "disk_interface.transfer_mode.insert_into_network.help");
+ private static final Component HELP_EXTRACT_FROM_NETWORK =
+ createTranslation("gui", "disk_interface.transfer_mode.extract_from_network.help");
+
+ private final ClientProperty property;
+
+ TransferModeSideButtonWidget(final ClientProperty property) {
+ super(createPressAction(property));
+ this.property = property;
+ }
+
+ private static OnPress createPressAction(final ClientProperty property) {
+ return btn -> property.setValue(toggle(property.getValue()));
+ }
+
+ private static StorageTransferMode toggle(final StorageTransferMode accessMode) {
+ return switch (accessMode) {
+ case INSERT_INTO_NETWORK -> StorageTransferMode.EXTRACT_FROM_NETWORK;
+ case EXTRACT_FROM_NETWORK -> StorageTransferMode.INSERT_INTO_NETWORK;
+ };
+ }
+
+ @Override
+ protected int getXTexture() {
+ return switch (property.getValue()) {
+ case INSERT_INTO_NETWORK -> 16;
+ case EXTRACT_FROM_NETWORK -> 0;
+ };
+ }
+
+ @Override
+ protected int getYTexture() {
+ return 160;
+ }
+
+ @Override
+ protected MutableComponent getTitle() {
+ return TITLE;
+ }
+
+ @Override
+ protected MutableComponent getSubText() {
+ return switch (property.getValue()) {
+ case INSERT_INTO_NETWORK -> SUBTEXT_INSERT_INTO_NETWORK;
+ case EXTRACT_FROM_NETWORK -> SUBTEXT_EXTRACT_FROM_NETWORK;
+ };
+ }
+
+ @Override
+ protected Component getHelpText() {
+ return switch (property.getValue()) {
+ case INSERT_INTO_NETWORK -> HELP_INSERT_INTO_NETWORK;
+ case EXTRACT_FROM_NETWORK -> HELP_EXTRACT_FROM_NETWORK;
+ };
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/package-info.java
new file mode 100644
index 000000000..32a4bfd5a
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskinterface/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage2.platform.common.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java
index db7fb2008..f7f0019d8 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java
@@ -41,8 +41,8 @@ public class ExternalStorageBlock extends AbstractDirectionalCableBlock
private static final Map SHAPE_CACHE = new HashMap<>();
private static final AbstractBlockEntityTicker TICKER =
new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getExternalStorage);
-
private static final Logger LOGGER = LoggerFactory.getLogger(ExternalStorageBlock.class);
+
private final DyeColor color;
private final MutableComponent name;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java
index f29fcb6fd..af9c4f13d 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java
@@ -50,12 +50,12 @@ public ExternalStorageBlockEntity(final BlockPos pos, final BlockState state) {
this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters(
ResourceContainerImpl.createForFilter(),
this::setChanged,
- mainNode::setFilters
+ mainNode.getStorageConfiguration()::setFilters
);
- mainNode.setNormalizer(filter.createNormalizer());
+ mainNode.getStorageConfiguration().setNormalizer(filter.createNormalizer());
mainNode.setTrackingRepository(trackedStorageRepository);
this.configContainer = new StorageConfigurationContainerImpl(
- mainNode,
+ mainNode.getStorageConfiguration(),
filter,
this::setChanged,
this::getRedstoneMode,
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java
index 814003ce2..9229f1a42 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/portablegrid/AbstractPortableGridContainerMenu.java
@@ -5,6 +5,7 @@
import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItem;
import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.storage.DiskInventory;
+import com.refinedmods.refinedstorage2.platform.common.support.FilteredContainer;
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot;
import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyContainerMenu;
import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyInfo;
@@ -12,14 +13,13 @@
import javax.annotation.Nullable;
import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.world.SimpleContainer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.inventory.Slot;
public abstract class AbstractPortableGridContainerMenu extends AbstractGridContainerMenu
implements EnergyContainerMenu {
- private final SimpleContainer diskInventory;
+ private final FilteredContainer diskInventory;
private final EnergyInfo energyInfo;
@Nullable
@@ -32,7 +32,7 @@ public abstract class AbstractPortableGridContainerMenu extends AbstractGridCont
final FriendlyByteBuf buf
) {
super(menuType, syncId, playerInventory, buf);
- this.diskInventory = new SimpleContainer(1);
+ this.diskInventory = new FilteredContainer(1, StorageContainerItem.stackValidator());
this.energyInfo = EnergyInfo.forClient(playerInventory.player, buf.readLong(), buf.readLong());
}
@@ -67,13 +67,7 @@ protected boolean canTransferSlot(final Slot slot) {
@Override
public void onScreenReady(final int playerInventoryY) {
super.onScreenReady(playerInventoryY);
- diskSlot = new ValidatedSlot(
- diskInventory,
- 0,
- -19,
- 8,
- stack -> stack.getItem() instanceof StorageContainerItem
- );
+ diskSlot = ValidatedSlot.forStorageContainer(diskInventory, 0, -19, 8);
addSlot(diskSlot);
transferManager.addBiTransfer(playerInventory, diskInventory);
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java
index c0d533097..3570421c0 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java
@@ -1,9 +1,10 @@
package com.refinedmods.refinedstorage2.platform.common.storage.storageblock;
+import com.refinedmods.refinedstorage2.api.network.impl.node.AbstractStorageContainerNetworkNode;
import com.refinedmods.refinedstorage2.api.network.impl.node.storage.StorageNetworkNode;
import com.refinedmods.refinedstorage2.api.storage.Storage;
import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
-import com.refinedmods.refinedstorage2.platform.api.storage.ItemTransferableStorageBlockEntity;
+import com.refinedmods.refinedstorage2.platform.api.storage.StorageBlockEntity;
import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository;
import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer;
import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory;
@@ -13,7 +14,7 @@
import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl;
-import java.util.Objects;
+import java.util.Optional;
import java.util.UUID;
import javax.annotation.Nullable;
@@ -29,7 +30,7 @@
abstract class AbstractStorageBlockBlockEntity
extends AbstractRedstoneModeNetworkNodeContainerBlockEntity
- implements NetworkNodeMenuProvider, ItemTransferableStorageBlockEntity {
+ implements NetworkNodeMenuProvider, StorageBlockEntity, AbstractStorageContainerNetworkNode.Provider {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractStorageBlockBlockEntity.class);
private static final String TAG_STORAGE_ID = "sid";
@@ -49,16 +50,16 @@ protected AbstractStorageBlockBlockEntity(final BlockEntityType> type,
this.filter = FilterWithFuzzyMode.createAndListenForUniqueFilters(
ResourceContainerImpl.createForFilter(resourceFactory),
this::setChanged,
- mainNode::setFilters
+ mainNode.getStorageConfiguration()::setFilters
);
this.configContainer = new StorageConfigurationContainerImpl(
- mainNode,
+ mainNode.getStorageConfiguration(),
filter,
this::setChanged,
this::getRedstoneMode,
this::setRedstoneMode
);
- mainNode.setNormalizer(filter.createNormalizer());
+ mainNode.getStorageConfiguration().setNormalizer(filter.createNormalizer());
}
protected abstract Storage createStorage(Runnable listener);
@@ -69,7 +70,6 @@ public void setLevel(final Level level) {
if (level.isClientSide()) {
return;
}
- final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level);
if (storageId == null) {
// We are a new block entity, or:
// - We are placed through NBT
@@ -78,42 +78,17 @@ public void setLevel(final Level level) {
// (#setLevel(Level) -> #modifyStorageAfterAlreadyInitialized(UUID)).
// In both cases listed above we need to clean up the storage we create here.
storageId = UUID.randomUUID();
+ final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level);
final Storage storage = createStorage(storageRepository::markAsChanged);
storageRepository.set(storageId, storage);
- mainNode.setStorage(storage);
- } else {
- // The existing block entity got loaded in the level (#load(CompoundTag) -> #setLevel(Level)).
- storageRepository.get(storageId).ifPresentOrElse(
- mainNode::setStorage,
- () -> LOGGER.warn("Storage {} could not be resolved", storageId)
- );
}
- }
-
- @Override
- public void modifyStorageIdAfterAlreadyInitialized(final UUID actualStorageId) {
- LOGGER.debug(
- "Storage {} got placed through NBT, replacing with actual storage {}",
- storageId,
- actualStorageId
- );
- cleanupUnneededInitialStorageAndReinitialize(actualStorageId);
- this.storageId = actualStorageId;
+ mainNode.setProvider(this);
}
@Override
public void load(final CompoundTag tag) {
if (tag.contains(TAG_STORAGE_ID)) {
- final UUID actualStorageId = tag.getUUID(TAG_STORAGE_ID);
- if (isPlacedThroughNbtPlacement(actualStorageId)) {
- LOGGER.debug(
- "Storage {} got placed through nbt, replacing with actual storage {}",
- storageId,
- actualStorageId
- );
- cleanupUnneededInitialStorageAndReinitialize(actualStorageId);
- }
- storageId = actualStorageId;
+ setStorageId(tag.getUUID(TAG_STORAGE_ID));
}
super.load(tag);
}
@@ -125,27 +100,6 @@ public void readConfiguration(final CompoundTag tag) {
filter.load(tag);
}
- private void cleanupUnneededInitialStorageAndReinitialize(final UUID actualStorageId) {
- // We got placed through NBT (#setLevel(Level) -> #load(CompoundTag)), or,
- // we got placed with an existing storage ID (#setLevel(Level) -> modifyStorageAfterAlreadyInitialized(UUID)).
- // Clean up the storage created earlier in #setLevel(Level).
- final StorageRepository storageRepository = PlatformApi.INSTANCE
- .getStorageRepository(Objects.requireNonNull(level));
- storageRepository.removeIfEmpty(Objects.requireNonNull(storageId)).ifPresentOrElse(
- storage -> LOGGER.debug("Unneeded storage {} successfully removed", storageId),
- () -> LOGGER.warn("Unneeded storage {} could not be removed", storageId)
- );
- storageRepository.get(actualStorageId).ifPresentOrElse(
- mainNode::setStorage,
- () -> LOGGER.warn("Actual storage ID {} could not be resolved!", actualStorageId)
- );
- }
-
- private boolean isPlacedThroughNbtPlacement(final UUID otherStorageId) {
- // When placed through nbt, the level is already set and a default new storage was created.
- return level != null && storageId != null && !storageId.equals(otherStorageId);
- }
-
@Override
public void saveAdditional(final CompoundTag tag) {
super.saveAdditional(tag);
@@ -161,6 +115,28 @@ public void writeConfiguration(final CompoundTag tag) {
filter.save(tag);
}
+ @Override
+ public void setStorageId(final UUID storageId) {
+ tryRemoveCurrentStorage(storageId);
+ this.storageId = storageId;
+ mainNode.onStorageChanged(0);
+ }
+
+ private void tryRemoveCurrentStorage(final UUID newStorageId) {
+ if (level == null || storageId == null || storageId.equals(newStorageId)) {
+ return;
+ }
+ // We got placed through NBT (#setLevel(Level) -> #load(CompoundTag)), or,
+ // we got placed with an existing storage ID (#setLevel(Level) -> #setStorageId(UUID)).
+ // Clean up the storage created earlier in #setLevel(Level).
+ LOGGER.info("Updating storage ID from {} to {}. Removing old storage", storageId, newStorageId);
+ final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level);
+ storageRepository.removeIfEmpty(storageId).ifPresentOrElse(
+ storage -> LOGGER.info("Storage {} successfully removed", storageId),
+ () -> LOGGER.warn("Storage {} could not be removed", storageId)
+ );
+ }
+
@Override
@Nullable
public UUID getStorageId() {
@@ -177,4 +153,13 @@ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByte
buf.writeLong(mainNode.getCapacity());
filter.getFilterContainer().writeToUpdatePacket(buf);
}
+
+ @Override
+ public Optional resolve(final int index) {
+ if (level == null || storageId == null) {
+ return Optional.empty();
+ }
+ final StorageRepository storageRepository = PlatformApi.INSTANCE.getStorageRepository(level);
+ return storageRepository.get(storageId);
+ }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java
index 412d4d87a..6b34e6fa1 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java
@@ -28,7 +28,7 @@ public FluidStorageBlockBlockEntity(final BlockPos pos,
BlockEntities.INSTANCE.getFluidStorageBlock(variant),
pos,
state,
- new StorageNetworkNode(getEnergyUsage(variant)),
+ new StorageNetworkNode(getEnergyUsage(variant), 0, 1),
PlatformApi.INSTANCE.getFluidResourceFactory()
);
this.variant = variant;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java
index 397d572ba..0efc11d89 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java
@@ -28,7 +28,7 @@ public ItemStorageBlockBlockEntity(final BlockPos pos,
BlockEntities.INSTANCE.getItemStorageBlock(variant),
pos,
state,
- new StorageNetworkNode(getEnergyUsage(variant)),
+ new StorageNetworkNode(getEnergyUsage(variant), 0, 1),
PlatformApi.INSTANCE.getItemResourceFactory()
);
this.variant = variant;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java
index 126792210..6f064375d 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java
@@ -1,7 +1,7 @@
package com.refinedmods.refinedstorage2.platform.common.storage.storageblock;
import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
-import com.refinedmods.refinedstorage2.platform.api.storage.ItemTransferableStorageBlockEntity;
+import com.refinedmods.refinedstorage2.platform.api.storage.StorageBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.content.LootFunctions;
import net.minecraft.world.item.ItemStack;
@@ -20,7 +20,7 @@ public LootItemFunctionType getType() {
@Override
public ItemStack apply(final ItemStack stack, final LootContext lootContext) {
final BlockEntity blockEntity = lootContext.getParam(LootContextParams.BLOCK_ENTITY);
- if (blockEntity instanceof ItemTransferableStorageBlockEntity transferable) {
+ if (blockEntity instanceof StorageBlockEntity transferable) {
PlatformApi.INSTANCE.getStorageContainerItemHelper().transferFromBlockEntity(stack, transferable);
}
return stack;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java
index 4b55dcce1..bc81c6f5e 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java
@@ -18,7 +18,6 @@ public StorageMonitorScreen(final StorageMonitorContainerMenu menu,
final Inventory playerInventory,
final Component text) {
super(menu, playerInventory, text);
-
this.inventoryLabelY = 43;
this.imageWidth = 211;
this.imageHeight = 137;
@@ -30,7 +29,7 @@ protected void init() {
addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE)));
addSideButton(new FuzzyModeSideButtonWidget(
getMenu().getProperty(PropertyTypes.FUZZY_MODE),
- FuzzyModeSideButtonWidget.Type.GENERIC
+ () -> FuzzyModeSideButtonWidget.Type.GENERIC
));
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractActiveColoredDirectionalBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractActiveColoredDirectionalBlock.java
new file mode 100644
index 000000000..7499f91ab
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractActiveColoredDirectionalBlock.java
@@ -0,0 +1,49 @@
+package com.refinedmods.refinedstorage2.platform.common.support;
+
+import net.minecraft.network.chat.MutableComponent;
+import net.minecraft.util.StringRepresentable;
+import net.minecraft.world.item.BlockItem;
+import net.minecraft.world.item.DyeColor;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.StateDefinition;
+import net.minecraft.world.level.block.state.properties.BooleanProperty;
+
+public abstract class AbstractActiveColoredDirectionalBlock & StringRepresentable,
+ B extends Block & BlockItemProvider, I extends BlockItem>
+ extends AbstractDirectionalBlock
+ implements ColorableBlock {
+ public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
+
+ private final DyeColor color;
+ private final MutableComponent name;
+
+ protected AbstractActiveColoredDirectionalBlock(final Properties properties,
+ final DyeColor color,
+ final MutableComponent name) {
+ super(properties);
+ this.color = color;
+ this.name = name;
+ }
+
+ @Override
+ protected BlockState getDefaultState() {
+ return super.getDefaultState().setValue(ACTIVE, false);
+ }
+
+ @Override
+ protected void createBlockStateDefinition(final StateDefinition.Builder builder) {
+ super.createBlockStateDefinition(builder);
+ builder.add(ACTIVE);
+ }
+
+ @Override
+ public DyeColor getColor() {
+ return color;
+ }
+
+ @Override
+ public MutableComponent getName() {
+ return name;
+ }
+}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleFilteredContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilteredContainer.java
similarity index 73%
rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleFilteredContainer.java
rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilteredContainer.java
index 13a83635f..bddb7bb35 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleFilteredContainer.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilteredContainer.java
@@ -5,10 +5,10 @@
import net.minecraft.world.SimpleContainer;
import net.minecraft.world.item.ItemStack;
-public final class SimpleFilteredContainer extends SimpleContainer {
+public class FilteredContainer extends SimpleContainer {
private final Predicate filter;
- public SimpleFilteredContainer(final int size, final Predicate filter) {
+ public FilteredContainer(final int size, final Predicate filter) {
super(size);
this.filter = filter;
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java
index 0b4d78684..0b12a637f 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java
@@ -1,5 +1,7 @@
package com.refinedmods.refinedstorage2.platform.common.support.containermenu;
+import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItem;
+
import java.util.function.Predicate;
import net.minecraft.world.Container;
@@ -22,4 +24,11 @@ public ValidatedSlot(final Container container,
public boolean mayPlace(final ItemStack stack) {
return predicate.test(stack);
}
+
+ public static Slot forStorageContainer(final Container container,
+ final int index,
+ final int x,
+ final int y) {
+ return new ValidatedSlot(container, index, x, y, stack -> stack.getItem() instanceof StorageContainerItem);
+ }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java
index 27f36f9ed..e98174976 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java
@@ -32,7 +32,7 @@ public abstract class AbstractUpgradeableNetworkNodeContainerBlockEntity 0xDA4B40;
};
}
+
+ protected static void rotate(final PoseStack poseStack, final BiDirection direction) {
+ poseStack.pushPose();
+ poseStack.translate(0.5F, 0.5F, 0.5F);
+ poseStack.mulPose(direction.getQuaternion());
+ poseStack.translate(-0.5F, -0.5F, -0.5F);
+ }
+
+ protected static void postRotate(final PoseStack poseStack) {
+ poseStack.popPose();
+ }
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java
index 8c6846f57..c919fad87 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java
@@ -2,6 +2,8 @@
import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty;
+import java.util.function.Supplier;
+
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
@@ -13,14 +15,12 @@ public class FuzzyModeSideButtonWidget extends AbstractSideButtonWidget {
private static final MutableComponent SUBTEXT_OFF = createTranslation("gui", "fuzzy_mode.off");
private final ClientProperty property;
- private final Component helpOn;
- private final Component helpOff;
+ private final Supplier typeSupplier;
- public FuzzyModeSideButtonWidget(final ClientProperty property, final Type type) {
+ public FuzzyModeSideButtonWidget(final ClientProperty property, final Supplier typeSupplier) {
super(createPressAction(property));
this.property = property;
- this.helpOn = createTranslation("gui", "fuzzy_mode.on." + type.getHelpTranslationKey());
- this.helpOff = createTranslation("gui", "fuzzy_mode.off." + type.getHelpTranslationKey());
+ this.typeSupplier = typeSupplier;
}
private static OnPress createPressAction(final ClientProperty property) {
@@ -49,7 +49,8 @@ protected MutableComponent getSubText() {
@Override
protected Component getHelpText() {
- return Boolean.TRUE.equals(property.getValue()) ? helpOn : helpOff;
+ final Type type = typeSupplier.get();
+ return Boolean.TRUE.equals(property.getValue()) ? type.helpOnText : type.helpOffText;
}
public enum Type {
@@ -58,7 +59,15 @@ public enum Type {
EXTRACTING_STORAGE_NETWORK,
EXTRACTING_SOURCE;
- String getHelpTranslationKey() {
+ private final MutableComponent helpOnText;
+ private final MutableComponent helpOffText;
+
+ Type() {
+ this.helpOnText = createTranslation("gui", "fuzzy_mode.on." + getHelpTranslationKey());
+ this.helpOffText = createTranslation("gui", "fuzzy_mode.off." + getHelpTranslationKey());
+ }
+
+ private String getHelpTranslationKey() {
return name().toLowerCase() + "_help";
}
}
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java
index 8111e68ee..cf0a051d1 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java
@@ -32,12 +32,16 @@ private static SchedulingModeType toggle(final SchedulingModeType modeSettings)
@Override
protected int getXTexture() {
- return -16;
+ return switch (property.getValue()) {
+ case DEFAULT -> 0;
+ case ROUND_ROBIN -> 16;
+ case RANDOM -> 32;
+ };
}
@Override
protected int getYTexture() {
- return -16;
+ return 144;
}
@Override
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java
index 2897fc7a8..644af5af3 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java
@@ -16,7 +16,8 @@ public enum UpgradeDestinations implements UpgradeDestination {
DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().get(0).get())),
CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())),
WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER,
- () -> new ItemStack(Items.INSTANCE.getWirelessTransmitters().get(0).get()));
+ () -> new ItemStack(Items.INSTANCE.getWirelessTransmitters().get(0).get())),
+ DISK_INTERFACE(ContentNames.DISK_INTERFACE, () -> new ItemStack(Items.INSTANCE.getDiskInterfaces().get(0).get()));
private final Component name;
private final Supplier stackFactory;
diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java
index c3fb469b9..a9ccf755a 100644
--- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java
+++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java
@@ -4,11 +4,10 @@
import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants;
import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker;
-import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.BaseBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider;
-import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock;
import com.refinedmods.refinedstorage2.platform.common.support.NetworkNodeBlockItem;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DefaultDirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType;
@@ -23,25 +22,20 @@
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.block.state.StateDefinition;
-import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation;
-public class WirelessTransmitterBlock extends AbstractDirectionalBlock
- implements ColorableBlock, BlockItemProvider,
- EntityBlock {
- public static final BooleanProperty ACTIVE = BooleanProperty.create("active");
-
+public class WirelessTransmitterBlock
+ extends AbstractActiveColoredDirectionalBlock
+ implements BlockItemProvider, EntityBlock {
private static final AbstractBlockEntityTicker TICKER =
new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getWirelessTransmitter, ACTIVE);
private static final Component HELP = createTranslation("item", "wireless_transmitter.help");
@@ -53,24 +47,8 @@ public class WirelessTransmitterBlock extends AbstractDirectionalBlock builder) {
- super.createBlockStateDefinition(builder);
- builder.add(ACTIVE);
+ super(BlockConstants.PROPERTIES, color, name);
}
@Override
@@ -117,16 +95,6 @@ public BlockEntityTicker getTicker(final Level level,
return TICKER.get(level, type);
}
- @Override
- public DyeColor getColor() {
- return color;
- }
-
- @Override
- public MutableComponent getName() {
- return name;
- }
-
@Override
public BaseBlockItem createBlockItem() {
return new NetworkNodeBlockItem(this, HELP);
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json
index 5b2a9c5cd..4f45cee84 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/de_de.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Konsole",
"block.refinedstorage2.crafting_grid": "Herstellungskonsole",
"block.refinedstorage2.controller": "Kontrollblock",
- "block.refinedstorage2.controller.rei_fully_charged": "Vollständig geladener Kontrollblock",
"block.refinedstorage2.creative_controller": "Kreativer Kontrollblock",
"block.refinedstorage2.1k_storage_block": "1k Speicherblock",
"block.refinedstorage2.4k_storage_block": "4k Speicherblock",
@@ -34,8 +33,8 @@
"block.refinedstorage2.creative_portable_grid": "Mobile Kreative Konsole",
"block.refinedstorage2.security_manager": "Sicherheits-Manager",
"block.refinedstorage2.security_manager.help": "Während aktivem Betrieb ist das Netzwerk geschützt und es werden alle Zugriffe blockiert. Füge Sicherheits-Karten hinzu, um spezifische Zugriffe für Spieler zuzulassen.",
- "block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.relay": "Relais",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "Falls dieses Gerät inaktiv ist, kann das Speichernetzwerk dieses Gerät nicht als Energiequelle nutzen.",
"gui.refinedstorage2.disk_drive.disks": "Speicherplatten",
"gui.refinedstorage2.storage.redstone_mode_help": "Falls dieses Gerät inaktiv ist, ist der enthaltene Speicher nicht mehr über das Speichernetzwerk zugänglich.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Synchronisierungsmodus",
"gui.refinedstorage2.grid.synchronizer.off": "Aus",
"gui.refinedstorage2.grid.synchronizer.off.help": "Suchfeldtext nicht synchronisieren.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Synchronisieren Sie das Suchfeld Text mit dem JEI Filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI beidseitig",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Synchronisieren Sie das Suchfeld Text mit dem JEI Filter und den JEI Filter mit dem Suchfeld Text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Synchronisieren Sie das Suchfeld Text mit dem REI Filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI beidseitig",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Synchronisieren Sie das Suchfeld Text mit dem REI Filter und den REI Filter mit dem Suchfeld Text.",
"gui.refinedstorage2.grid.resource_type": "Ressourcentyp",
"gui.refinedstorage2.grid.resource_type.all": "Alle",
"gui.refinedstorage2.grid.resource_type.help": "Spezifische Ressourcentypen filtern.",
@@ -151,20 +142,31 @@
"gui.refinedstorage2.security_manager.redstone_mode_help": "Wenn dieses Gerät inaktiv ist, wird das Netzwerk nicht geschützt.",
"gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot für eine Standard-Sicherheitskarte.",
"gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Fügen Sie diesem Slot eine Standard-Sicherheitskarte hinzu, um Berechtigungen für jeden Spieler ohne Sicherheitskarte festzulegen. Standardmäßig werden alle Aktionen verweigert.",
- "gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.",
- "gui.refinedstorage2.relay.pass_through": "Pass-through",
- "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.",
- "gui.refinedstorage2.relay.pass_energy": "Pass energy",
- "gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.",
- "gui.refinedstorage2.relay.pass_storage": "Pass storage",
- "gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.",
- "gui.refinedstorage2.relay.pass_security": "Pass security",
- "gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
- "gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
- "gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.relay.filter_help": "Ressourcen, die vom Eingabenetzwerk dem Ausgabenetz ausgesetzt werden sollen, wenn das Relais nicht im Durchlaufmodus ist.",
+ "gui.refinedstorage2.relay.pass_through": "Durchlaufen",
+ "gui.refinedstorage2.relay.pass_through.help": "Ob dieses Gerät das gesamte Eingangsnetzsignal so durchlaufen soll, wie es ist. Schalten Sie dies aus, um Komponenten selektiv dem Ausgangsnetz anzuzeigen.",
+ "gui.refinedstorage2.relay.pass_energy": "Energie weitergeben",
+ "gui.refinedstorage2.relay.pass_energy.help": "Gibt an, ob dieses Gerät den Energiepuffer vom Eingangsnetz an das Ausgangsnetz übergeben soll.",
+ "gui.refinedstorage2.relay.pass_storage": "Speicher weitergeben",
+ "gui.refinedstorage2.relay.pass_storage.help": "Gibt an, ob dieses Gerät den Speicher aus dem Eingangsnetzwerk an das Ausgangsnetz übergeben soll.",
+ "gui.refinedstorage2.relay.pass_security": "Sicherheit weitergeben",
+ "gui.refinedstorage2.relay.pass_security.help": "Gibt an, ob dieses Gerät die Sicherheitseinstellungen vom Eingangsnetzwerk an das Ausgangsnetz übergeben soll.",
+ "gui.refinedstorage2.relay.filter_mode.allow.help": "Stellen Sie nur Ressourcen aus dem Eingabenetzwerk dem Ausgabenetzwerk aus, die in den Filtern konfiguriert sind.",
+ "gui.refinedstorage2.relay.filter_mode.block.help": "Stellen Sie keine Ressourcen aus dem Eingabenetzwerk dem Ausgabenetzwerk aus, die in den Filtern konfiguriert sind.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Stellt das Speichernetzwerk mit Energie zur Verfügung. Mehrere sind in einem einzigen Speichernetzwerk erlaubt.",
"item.refinedstorage2.creative_controller.help": "Stellt dem Speichernetzwerk eine unendliche Energiequelle zur Verfügung.",
"item.refinedstorage2.disk_drive.help": "Akzeptiert Speicherplatten, um dem Speichernetz Speicherplatz zur Verfügung zu stellen.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Ermöglicht die Interaktion mit dem Speichernetzwerk.",
"item.refinedstorage2.crafting_grid.help": "Ermöglicht die Interaktion mit dem Speichernetzwerk, mit Herstellungsfähigkeiten.",
"item.refinedstorage2.importer.help": "Importiert Ressourcen von einer externen Quelle in das Speichernetzwerk.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Sendet ein Redstone Signal, wenn das Speichernetzwerk eine Ressource enthält, die gleich über oder unter einer bestimmten Menge ist.",
"item.refinedstorage2.constructor.help": "Platziert Blöcke aus dem Speichernetzwerk in der Welt.",
"item.refinedstorage2.destructor.help": "Zerstört Blöcke aus der Welt und setzt sie in das Speichernetzwerk.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quarz angereichertes Eisen",
"item.refinedstorage2.processor_binding": "Prozessor Rohmaterial",
"item.refinedstorage2.silicon": "Silikon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Werkbank in der Konsole zum Inventar leeren",
"key.refinedstorage2.open_wireless_grid": "Drahtlose Konsole öffnen",
"refinedstorage2.subtitle.wrench": "Schraubenschlüssel benutzt",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Einfügen",
"permission.refinedstorage2.insert.description": "Gibt an, ob der Spieler Ressourcen in ein Netzwerk einfügen kann.",
"permission.refinedstorage2.extract": "Extrahieren",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Gibt an, ob der Player Netzwerkgeräte hinzufügen oder entfernen kann.",
"permission.refinedstorage2.security": "Sicherheit",
"permission.refinedstorage2.security.description": "Ob der Spieler die Sicherheitsoptionen für ein Netzwerk verwalten kann.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Flüssiges Scrollen",
"text.autoconfig.refinedstorage2.option.screenSize": "Bildschirmgröße",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Laufwerk",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energieverbrauch",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energieverbrauch pro Festplatte",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Speicherblock",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1k Energieverbrauch",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4k Energieverbrauch",
@@ -380,14 +403,16 @@
"text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "Energieverbrauch",
"text.autoconfig.refinedstorage2.option.securityManager": "Sicherheits-Manager",
"text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "Energieverbrauch",
- "text.autoconfig.refinedstorage2.option.relay": "Relay",
- "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage",
- "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)",
+ "text.autoconfig.refinedstorage2.option.relay": "Relais",
+ "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Eingabenetzwerk Energienutzung",
+ "text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Ausgangsnetzwerk Energieverbrauch (wenn nicht im Durchlauf-Modus)",
"advancements.refinedstorage2.root.description": "Nutzen Sie einen oder mehrere Kontrollblöcke in einem Speichernetzwerk, um das Netzwerk mit Energie zu versorgen",
"advancements.refinedstorage2.connecting": "Verbinden",
"advancements.refinedstorage2.connecting.description": "Benutze Kabel um Geräte miteinander zu verbinden, oder platziere Geräte nebeneinander",
"advancements.refinedstorage2.drives": "Festplatten",
"advancements.refinedstorage2.drives.description": "Erstellen Sie ein Laufwerk, um Ihre Speicherplatten einsetzen zu können",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Items speichern",
"advancements.refinedstorage2.storing_items.description": "Erstelle eine Speicherplatte und stecke sie in dein Laufwerk",
"advancements.refinedstorage2.viewing_your_storage": "Ihren Speicher anzeigen",
@@ -422,6 +447,6 @@
"advancements.refinedstorage2.portable_storage.description": "Erstelle eine mobile Konsole um auf den Inhalt von Speicherplatten zuzugreifen, ohne ein Speichernetzwerk zu benötigen",
"advancements.refinedstorage2.security": "Sicherheit",
"advancements.refinedstorage2.security.description": "Sichern Sie Ihr Speichernetzwerk mit einem Security-Manager und einer Sicherheitskarte",
- "advancements.refinedstorage2.conditional_connecting": "Conditional connecting",
- "advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay"
+ "advancements.refinedstorage2.conditional_connecting": "Bedingte Verbindung",
+ "advancements.refinedstorage2.conditional_connecting.description": "Schalten Sie ganze Abschnitte eines Speichernetzwerks ein oder aus und erstellen Sie neue Zweige Ihres Netzwerks mit einem Relais"
}
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json
index b2de31453..79efad7d4 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json
@@ -34,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
"gui.refinedstorage2.disk_drive.disks": "Disks",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -153,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -165,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -282,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -307,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -377,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json
index e14428c33..6debab5f3 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/es_es.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Rejilla",
"block.refinedstorage2.crafting_grid": "Rejilla de Fabricación",
"block.refinedstorage2.controller": "Controlador",
- "block.refinedstorage2.controller.rei_fully_charged": "Controlador completamente cargado",
"block.refinedstorage2.creative_controller": "Controlador Creativo",
"block.refinedstorage2.1k_storage_block": "Bloque de almacenamiento de 1K",
"block.refinedstorage2.4k_storage_block": "Bloque de almacenamiento de 4K",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Gestor de seguridad",
"block.refinedstorage2.security_manager.help": "Cuando este dispositivo está activo, protegerá la red por defecto y bloqueará todas las operaciones. Empieza a añadir tarjetas de seguridad para permitir o denegar operaciones específicas para un jugador.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "Cuando este dispositivo está inactivo, la red de almacenamiento no podrá utilizar este dispositivo como fuente de energía.",
"gui.refinedstorage2.disk_drive.disks": "Discos",
"gui.refinedstorage2.storage.redstone_mode_help": "Cuando este dispositivo está inactivo, ya no se podrá acceder al almacenamiento contenido desde la red de almacenamiento.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Modo de sincronización",
"gui.refinedstorage2.grid.synchronizer.off": "Apagado",
"gui.refinedstorage2.grid.synchronizer.off.help": "No sincronizar el texto del cuadro de búsqueda.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sincroniza el texto del cuadro de búsqueda al filtro JEI.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI en dos direcciones",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sincronice el texto del cuadro de búsqueda al filtro JEI, y el filtro JEI al texto del cuadro de búsqueda.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sincroniza el texto del cuadro de búsqueda al filtro REI.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI en dos direcciones",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sincronice el texto del cuadro de búsqueda al filtro REI, y el filtro REI al texto del cuadro de búsqueda.",
"gui.refinedstorage2.grid.resource_type": "Tipo de Recurso",
"gui.refinedstorage2.grid.resource_type.all": "Todo",
"gui.refinedstorage2.grid.resource_type.help": "Filtrar tipos de recurso específicos.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Hierro enriquecido con cuarzo",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicio",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Llave Inglesa usada",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insertar",
"permission.refinedstorage2.insert.description": "Si el jugador puede insertar recursos en una red.",
"permission.refinedstorage2.extract": "Extraer",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Seguridad",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Desplazamiento suave",
"text.autoconfig.refinedstorage2.option.screenSize": "Tamaño de pantalla",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disco Duro",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Uso de energía",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Uso de energía por disco",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Bloque de almacenamiento",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K de consumo de energía",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K de consumo de energía",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Dispositivos y unidades",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json
index 002bd3922..a97ad1eec 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/fr_fr.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Grille",
"block.refinedstorage2.crafting_grid": "Grille d’Artisanat",
"block.refinedstorage2.controller": "Contrôleur",
- "block.refinedstorage2.controller.rei_fully_charged": "Contrôleur entièrement chargé",
"block.refinedstorage2.creative_controller": "Contrôleur créatif",
"block.refinedstorage2.1k_storage_block": "Bloc de Stockage 1K",
"block.refinedstorage2.4k_storage_block": "Bloc de Stockage 4k",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Poste de sécurité",
"block.refinedstorage2.security_manager.help": "Lorsque ce périphérique est actif, il protège le réseau par défaut et bloque toutes les opérations. Commencez à ajouter des Cartes de Sécurité pour permettre ou refuser des opérations spécifiques pour un joueur.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "Lorsque ce périphérique est inactif, le réseau de stockage ne peut pas utiliser ce périphérique comme source d'énergie.",
"gui.refinedstorage2.disk_drive.disks": "Disques",
"gui.refinedstorage2.storage.redstone_mode_help": "Lorsque ce périphérique est inactif, le stockage contenu ne sera plus accessible depuis le réseau de stockage.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Mode de synchronisation",
"gui.refinedstorage2.grid.synchronizer.off": "Éteint",
"gui.refinedstorage2.grid.synchronizer.off.help": "Ne pas synchroniser la recherche.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Synchroniser la recherche avec le filtre de JEI.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI bidirectionnel",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Synchroniser la recherche avec le filtre de JEI et le filtre de JEI avec la recherche.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Synchroniser la recherche avec le filtre de REI.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI bidirectionnel",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Synchroniser la recherche avec le filtre de REI et le filtre de REI avec la recherche.",
"gui.refinedstorage2.grid.resource_type": "Type de ressource",
"gui.refinedstorage2.grid.resource_type.all": "Toutes",
"gui.refinedstorage2.grid.resource_type.help": "Filtrer un type de ressources spécifique.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Alimente le réseau de stockage en énergie. Plusieurs sont autorisés dans un seul réseau de stockage. ",
"item.refinedstorage2.creative_controller.help": "Alimente le réseau de stockage avec une source d'énergie infinie. ",
"item.refinedstorage2.disk_drive.help": "Accepte des disques de stockage pour fournir de l'espace de stockage au réseau.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Permet d'interagir avec le réseau de stockage.",
"item.refinedstorage2.crafting_grid.help": "Permet d'interagir avec le réseau de stockage, avec les capacités d'artisanat.",
"item.refinedstorage2.importer.help": "Importe des ressources depuis une source externe vers le réseau de stockage.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Émet un signal de redstone si le réseau de stockage contient une ressource en quantité égale, supérieure ou inférieure à un seuil donné.",
"item.refinedstorage2.constructor.help": "Place des blocs du réseau de stockage dans le monde.",
"item.refinedstorage2.destructor.help": "Détruit les blocs du monde et les met dans le réseau de stockage.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Fer enrichi en quartz",
"item.refinedstorage2.processor_binding": "Liant pour processeur",
"item.refinedstorage2.silicon": "Silicone",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Vider la matrice d'artisanat dans l'inventaire",
"key.refinedstorage2.open_wireless_grid": "Ouvrir la grille sans fil",
"refinedstorage2.subtitle.wrench": "Clé utilisée",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insérer",
"permission.refinedstorage2.insert.description": "Si le joueur peut insérer des ressources dans le réseau.",
"permission.refinedstorage2.extract": "Extraire",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Si le joueur peut ajouter ou enlever des périphériques au réseau.",
"permission.refinedstorage2.security": "Sécurité",
"permission.refinedstorage2.security.description": "Si le joueur peut gérer les options de sécurité du réseau.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Utiliser un câble pour connecter pour connecter des périphériques ensembles, ou placer les périphériques l'un contre l'autre",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json
index 6e06c5772..79efad7d4 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/hu_hu.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Grid",
"block.refinedstorage2.crafting_grid": "Crafting Grid",
"block.refinedstorage2.controller": "Controller",
- "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller",
"block.refinedstorage2.creative_controller": "Creative Controller",
"block.refinedstorage2.1k_storage_block": "1K Storage Block",
"block.refinedstorage2.4k_storage_block": "4K Storage Block",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
"gui.refinedstorage2.disk_drive.disks": "Disks",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Synchronization mode",
"gui.refinedstorage2.grid.synchronizer.off": "Off",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Resource type",
"gui.refinedstorage2.grid.resource_type.all": "All",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json
index 56c888902..97d548df5 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/id_id.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Kisi",
"block.refinedstorage2.crafting_grid": "Kisi Kerajinan",
"block.refinedstorage2.controller": "Pengendali",
- "block.refinedstorage2.controller.rei_fully_charged": "Pengendali terisi penuh",
"block.refinedstorage2.creative_controller": "Pengendali Kreatif",
"block.refinedstorage2.1k_storage_block": "Balok Penyimpanan 1K",
"block.refinedstorage2.4k_storage_block": "Balok Penyimpanan 4K",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "Ketika peranagkat ini nonaktif, jaringan penyimpanan tidak dapat menggunakan perangkat ini sebagai sumber energi.",
"gui.refinedstorage2.disk_drive.disks": "Cakram",
"gui.refinedstorage2.storage.redstone_mode_help": "Ketika perangkat ini nonaktif, penyimpanan tidak akan dapat diakses dari dalam jaringan penyimpanan.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Mode sinkronisasi",
"gui.refinedstorage2.grid.synchronizer.off": "Nonaktif",
"gui.refinedstorage2.grid.synchronizer.off.help": "Jangan sinkronkan teks kotak pencarian.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sinkronkan teks kotak pencarian ke filter JEI.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI dua arah",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sinkronkan teks kotak pencarian ke filter JEI, dan filter JEI ke teks kotak pencarian.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sinkronkan teks kotak pencarian ke filter REI.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI dua arah",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Jenis sumber daya",
"gui.refinedstorage2.grid.resource_type.all": "Semua",
"gui.refinedstorage2.grid.resource_type.help": "Filter jenis sumber daya tertentu.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Menyediakan energi ke jaringan penyimpanan. dapat digunakan beberapa kali dalam satu jaringan penyimpanan.",
"item.refinedstorage2.creative_controller.help": "Menyediakan energi tidak terbatas ke jaringan penyimpanan.",
"item.refinedstorage2.disk_drive.help": "Menerima cakram penyimpanan untuk menyediakan ruang penyimpanan kedalam jaringan penyimpanan.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Memungkinkan untuk mengakses jaringan penyimpanan.",
"item.refinedstorage2.crafting_grid.help": "Memungkinkan untuk mengakses jaringan penyimpanan, dengan kemampuan untuk merakit.",
"item.refinedstorage2.importer.help": "Import sumber daya dari sumber eksternal kedalam jaringan penyimpanan.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Pancarkan sinyal redstone jika jaringan penyimpanan berisi sumber daya sama dengan, diatas atau dibawah jumlah yang ditentukan.",
"item.refinedstorage2.constructor.help": "Tempatkan balok dari jaringan penyimpanan ke dunia.",
"item.refinedstorage2.destructor.help": "Memecahkan balok dari dunia dan memasukkannya kedalam jaringan penyimpanan.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Besi yang Diperkaya Kuarsa",
"item.refinedstorage2.processor_binding": "Pengikat Prosesor",
"item.refinedstorage2.silicon": "Silikon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Singkirkan matriks Kisi Kerajinan ke inventaris",
"key.refinedstorage2.open_wireless_grid": "Buka Kisi Nirkabel",
"refinedstorage2.subtitle.wrench": "Kunci inggris digunakan",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Lemari Cakram",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Pemakaian daya",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Pemakaian daya per cakram",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Balok Penyimpanan",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "Pemakaian daya 1K",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "Pemakaian daya 4K",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Gunakan Kabel untuk menghubungkan perangkat satu sama lain, atau letakkan perangkat melawan satu sama lain",
"advancements.refinedstorage2.drives": "Cakram",
"advancements.refinedstorage2.drives.description": "Rakit Lemari Cakram untuk menyimpan cakram penyimpanan anda",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Menyimpan Barang",
"advancements.refinedstorage2.storing_items.description": "Rakit Cakram Penyimpanan dan letakkan kedalam Lemari Cakram anda",
"advancements.refinedstorage2.viewing_your_storage": "Melihat penyimpanan anda",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json
index 6e06c5772..79efad7d4 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/it_it.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Grid",
"block.refinedstorage2.crafting_grid": "Crafting Grid",
"block.refinedstorage2.controller": "Controller",
- "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller",
"block.refinedstorage2.creative_controller": "Creative Controller",
"block.refinedstorage2.1k_storage_block": "1K Storage Block",
"block.refinedstorage2.4k_storage_block": "4K Storage Block",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
"gui.refinedstorage2.disk_drive.disks": "Disks",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Synchronization mode",
"gui.refinedstorage2.grid.synchronizer.off": "Off",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Resource type",
"gui.refinedstorage2.grid.resource_type.all": "All",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json
index 6e06c5772..a65ee59d3 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ja_jp.json
@@ -1,139 +1,130 @@
{
"mod.refinedstorage2": "Refined Storage 2",
- "block.refinedstorage2.cable": "Cable",
- "block.refinedstorage2.quartz_enriched_iron_block": "Block of Quartz Enriched Iron",
- "block.refinedstorage2.disk_drive": "Disk Drive",
- "block.refinedstorage2.machine_casing": "Machine Casing",
- "block.refinedstorage2.grid": "Grid",
- "block.refinedstorage2.crafting_grid": "Crafting Grid",
- "block.refinedstorage2.controller": "Controller",
- "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller",
- "block.refinedstorage2.creative_controller": "Creative Controller",
- "block.refinedstorage2.1k_storage_block": "1K Storage Block",
- "block.refinedstorage2.4k_storage_block": "4K Storage Block",
- "block.refinedstorage2.16k_storage_block": "16K Storage Block",
- "block.refinedstorage2.64k_storage_block": "64K Storage Block",
- "block.refinedstorage2.creative_storage_block": "Creative Storage Block",
- "block.refinedstorage2.64b_fluid_storage_block": "64B Fluid Storage Block",
- "block.refinedstorage2.256b_fluid_storage_block": "256B Fluid Storage Block",
- "block.refinedstorage2.1024b_fluid_storage_block": "1024B Fluid Storage Block",
- "block.refinedstorage2.4096b_fluid_storage_block": "4096B Fluid Storage Block",
- "block.refinedstorage2.creative_fluid_storage_block": "Creative Fluid Storage Block",
- "block.refinedstorage2.importer": "Importer",
- "block.refinedstorage2.exporter": "Exporter",
- "block.refinedstorage2.interface": "Interface",
- "block.refinedstorage2.external_storage": "External Storage",
- "block.refinedstorage2.detector": "Detector",
- "block.refinedstorage2.constructor": "Constructor",
- "block.refinedstorage2.destructor": "Destructor",
- "block.refinedstorage2.wireless_transmitter": "Wireless Transmitter",
- "block.refinedstorage2.storage_monitor": "Storage Monitor",
- "block.refinedstorage2.network_receiver": "Network Receiver",
- "block.refinedstorage2.network_transmitter": "Network Transmitter",
- "block.refinedstorage2.portable_grid": "Portable Grid",
- "block.refinedstorage2.creative_portable_grid": "Creative Portable Grid",
- "block.refinedstorage2.security_manager": "Security Manager",
+ "block.refinedstorage2.cable": "ケーブル",
+ "block.refinedstorage2.quartz_enriched_iron_block": "クォーツ濃縮鉄ブロック",
+ "block.refinedstorage2.disk_drive": "ディスクドライブ",
+ "block.refinedstorage2.machine_casing": "マシンケーシング",
+ "block.refinedstorage2.grid": "グリッド",
+ "block.refinedstorage2.crafting_grid": "クラフトグリッド",
+ "block.refinedstorage2.controller": "コントローラー",
+ "block.refinedstorage2.creative_controller": "クリエイティブコントローラー",
+ "block.refinedstorage2.1k_storage_block": "1Kストレージブロック",
+ "block.refinedstorage2.4k_storage_block": "4Kストレージブロック",
+ "block.refinedstorage2.16k_storage_block": "16Kストレージブロック",
+ "block.refinedstorage2.64k_storage_block": "64Kストレージブロック",
+ "block.refinedstorage2.creative_storage_block": "クリエイティブストレージブロック",
+ "block.refinedstorage2.64b_fluid_storage_block": "64B流体ストレージブロック",
+ "block.refinedstorage2.256b_fluid_storage_block": "256B流体ストレージブロック",
+ "block.refinedstorage2.1024b_fluid_storage_block": "1024B流体ストレージブロック",
+ "block.refinedstorage2.4096b_fluid_storage_block": "4096B流体ストレージブロック",
+ "block.refinedstorage2.creative_fluid_storage_block": "クリエイティブ流体ストレージブロック",
+ "block.refinedstorage2.importer": "インポーター",
+ "block.refinedstorage2.exporter": "エクスポーター",
+ "block.refinedstorage2.interface": "インターフェース",
+ "block.refinedstorage2.external_storage": "外部ストレージ",
+ "block.refinedstorage2.detector": "ディテクター",
+ "block.refinedstorage2.constructor": "コンストラクター",
+ "block.refinedstorage2.destructor": "ディストラクター",
+ "block.refinedstorage2.wireless_transmitter": "ワイヤレス送信機",
+ "block.refinedstorage2.storage_monitor": "ストレージモニター",
+ "block.refinedstorage2.network_receiver": "ネットワーク受信機",
+ "block.refinedstorage2.network_transmitter": "ネットワーク送信機",
+ "block.refinedstorage2.portable_grid": "携帯グリッド",
+ "block.refinedstorage2.creative_portable_grid": "クリエイティブ携帯グリッド",
+ "block.refinedstorage2.security_manager": "セキュリティマネージャー",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
- "block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.relay": "リレー",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
- "gui.refinedstorage2.disk_drive.disks": "Disks",
+ "gui.refinedstorage2.disk_drive.disks": "ディスク",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
"gui.refinedstorage2.storage.filter_help": "The resources that may or may not be allowed in this storage, depending if the device is in allowlist or blocklist mode.",
"gui.refinedstorage2.storage.filter_mode.empty_warning": "Without any configured filters, no resources will be accepted in this storage.",
"gui.refinedstorage2.storage.filter_mode.allow.help": "Only allow resources into this storage that are configured in the filters.",
"gui.refinedstorage2.storage.filter_mode.block.help": "Disallow resources into this storage that are configured in the filters.",
- "gui.refinedstorage2.grid.sorting.direction": "Sorting direction",
- "gui.refinedstorage2.grid.sorting.direction.ascending": "Ascending",
- "gui.refinedstorage2.grid.sorting.direction.descending": "Descending",
- "gui.refinedstorage2.grid.sorting.type": "Sorting type",
- "gui.refinedstorage2.grid.sorting.type.quantity": "Quantity",
- "gui.refinedstorage2.grid.sorting.type.name": "Name",
+ "gui.refinedstorage2.grid.sorting.direction": "並び順",
+ "gui.refinedstorage2.grid.sorting.direction.ascending": "昇順",
+ "gui.refinedstorage2.grid.sorting.direction.descending": "降順",
+ "gui.refinedstorage2.grid.sorting.type": "並べ替え",
+ "gui.refinedstorage2.grid.sorting.type.quantity": "量",
+ "gui.refinedstorage2.grid.sorting.type.name": "名前",
"gui.refinedstorage2.grid.sorting.type.id": "ID",
- "gui.refinedstorage2.grid.sorting.type.last_modified": "Last modified",
- "gui.refinedstorage2.grid.auto_selected": "Auto-selected",
+ "gui.refinedstorage2.grid.sorting.type.last_modified": "最終変更時間",
+ "gui.refinedstorage2.grid.auto_selected": "自動選択",
"gui.refinedstorage2.grid.auto_selected.help": "Whether to auto-select the search box when opening the Grid.",
- "gui.refinedstorage2.grid.synchronizer": "Synchronization mode",
- "gui.refinedstorage2.grid.synchronizer.off": "Off",
+ "gui.refinedstorage2.grid.synchronizer": "同期モード",
+ "gui.refinedstorage2.grid.synchronizer.off": "オフ",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
- "gui.refinedstorage2.grid.resource_type": "Resource type",
- "gui.refinedstorage2.grid.resource_type.all": "All",
+ "gui.refinedstorage2.grid.resource_type": "リソースの種類",
+ "gui.refinedstorage2.grid.resource_type.all": "すべて",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
- "gui.refinedstorage2.crafting_grid.move.network": "Move items to network",
- "gui.refinedstorage2.crafting_grid.move.inventory": "Move items to inventory",
- "gui.refinedstorage2.screen_size": "Screen size",
- "gui.refinedstorage2.screen_size.stretch": "Stretch",
- "gui.refinedstorage2.screen_size.small": "Small",
- "gui.refinedstorage2.screen_size.medium": "Medium",
- "gui.refinedstorage2.screen_size.large": "Large",
- "gui.refinedstorage2.screen_size.extra_large": "Extra large",
- "gui.refinedstorage2.detector.mode": "Mode",
- "gui.refinedstorage2.detector.mode.under": "Emit redstone signal when under the amount",
- "gui.refinedstorage2.detector.mode.equal": "Emit redstone signal when on the amount",
- "gui.refinedstorage2.detector.mode.above": "Emit redstone signal when above the amount",
+ "gui.refinedstorage2.crafting_grid.move.network": "アイテムをネットワークに移動",
+ "gui.refinedstorage2.crafting_grid.move.inventory": "アイテムをインベントリに移動",
+ "gui.refinedstorage2.screen_size": "画面サイズ",
+ "gui.refinedstorage2.screen_size.stretch": "連動",
+ "gui.refinedstorage2.screen_size.small": "小",
+ "gui.refinedstorage2.screen_size.medium": "中",
+ "gui.refinedstorage2.screen_size.large": "大",
+ "gui.refinedstorage2.screen_size.extra_large": "特大",
+ "gui.refinedstorage2.detector.mode": "モード",
+ "gui.refinedstorage2.detector.mode.under": "指定数を下回るとレッドストーン信号を出力",
+ "gui.refinedstorage2.detector.mode.equal": "指定数と同量でレッドストーン信号を出力",
+ "gui.refinedstorage2.detector.mode.above": "指定数を上回るとレッドストーン信号を出力",
"gui.refinedstorage2.detector.filter_help": "The resource that should be detected in the storage network.",
- "gui.refinedstorage2.destructor.pickup_items": "Pickup items instead of breaking",
+ "gui.refinedstorage2.destructor.pickup_items": "ブロックを破壊せずにアイテムを拾う",
"gui.refinedstorage2.destructor.filter_help": "The blocks that may or may not be destroyed, depending if the device is in allowlist or blocklist mode.",
"gui.refinedstorage2.destructor.filter_mode.allow.help": "Only allow blocks into the storage network that are configured in the filters.",
"gui.refinedstorage2.destructor.filter_mode.block.help": "Disallow blocks into the storage network that are configured in the filters.",
- "gui.refinedstorage2.constructor.drop_items": "Drop items instead of placing blocks",
+ "gui.refinedstorage2.constructor.drop_items": "ブロックを設置せずにアイテム化させる",
"gui.refinedstorage2.constructor.filter_help": "The resources that should be placed from the storage network.",
"gui.refinedstorage2.interface.filter_help": "The resources that should be exported from the storage network.",
"gui.refinedstorage2.exporter.filter_help": "The resources that should be exported from the storage network.",
"gui.refinedstorage2.importer.filter_help": "The resources that may be imported from the target inventory.",
"gui.refinedstorage2.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.",
"gui.refinedstorage2.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.",
- "gui.refinedstorage2.wireless_transmitter.distance": "%d block(s)",
+ "gui.refinedstorage2.wireless_transmitter.distance": "%dブロック",
"gui.refinedstorage2.storage_monitor.filter_help": "The resource to display.",
- "gui.refinedstorage2.redstone_mode": "Redstone mode",
- "gui.refinedstorage2.redstone_mode.ignore": "Ignore",
+ "gui.refinedstorage2.redstone_mode": "レッドストーン",
+ "gui.refinedstorage2.redstone_mode.ignore": "無視",
"gui.refinedstorage2.redstone_mode.ignore.help": "This device will always be active, regardless of redstone signal.",
- "gui.refinedstorage2.redstone_mode.high": "High",
+ "gui.refinedstorage2.redstone_mode.high": "高",
"gui.refinedstorage2.redstone_mode.high.help": "This device will only be active with a redstone signal.",
- "gui.refinedstorage2.redstone_mode.low": "Low",
+ "gui.refinedstorage2.redstone_mode.low": "低",
"gui.refinedstorage2.redstone_mode.low.help": "This device will only be active without a redstone signal.",
- "gui.refinedstorage2.scheduling_mode": "Scheduling mode",
- "gui.refinedstorage2.scheduling_mode.default": "Default",
+ "gui.refinedstorage2.scheduling_mode": "スケジュールモード",
+ "gui.refinedstorage2.scheduling_mode.default": "デフォルト",
"gui.refinedstorage2.scheduling_mode.default.help": "Use the first available filter.",
- "gui.refinedstorage2.scheduling_mode.round_robin": "Round robin",
+ "gui.refinedstorage2.scheduling_mode.round_robin": "ラウンドロビン",
"gui.refinedstorage2.scheduling_mode.round_robin.help": "Use each filter in turn.",
- "gui.refinedstorage2.scheduling_mode.random": "Random",
+ "gui.refinedstorage2.scheduling_mode.random": "ランダム",
"gui.refinedstorage2.scheduling_mode.random.help": "Use a random filter.",
- "gui.refinedstorage2.priority": "Priority",
+ "gui.refinedstorage2.priority": "優先度",
"gui.refinedstorage2.priority.storage_help": "The order in which the storage network will insert or extract resources, highest-first.",
- "gui.refinedstorage2.amount": "Amount",
- "gui.refinedstorage2.amount.reset": "Reset",
- "gui.refinedstorage2.amount.set": "Set",
- "gui.refinedstorage2.filter_mode": "Filter mode",
- "gui.refinedstorage2.filter_mode.allow": "Allowlist",
- "gui.refinedstorage2.filter_mode.block": "Blocklist",
- "gui.refinedstorage2.fuzzy_mode": "Fuzzy mode",
- "gui.refinedstorage2.fuzzy_mode.on": "On",
+ "gui.refinedstorage2.amount": "量",
+ "gui.refinedstorage2.amount.reset": "リセット",
+ "gui.refinedstorage2.amount.set": "設定",
+ "gui.refinedstorage2.filter_mode": "フィルターモード",
+ "gui.refinedstorage2.filter_mode.allow": "ホワイトリスト",
+ "gui.refinedstorage2.filter_mode.block": "ブラックリスト",
+ "gui.refinedstorage2.fuzzy_mode": "曖昧モード",
+ "gui.refinedstorage2.fuzzy_mode.on": "オン",
"gui.refinedstorage2.fuzzy_mode.on.storage_help": "Match the filters for the allowlist or blocklist exactly.",
"gui.refinedstorage2.fuzzy_mode.on.generic_help": "Match the filter exactly.",
"gui.refinedstorage2.fuzzy_mode.on.extracting_storage_network_help": "Match the filters when extracting from the storage network exactly.",
"gui.refinedstorage2.fuzzy_mode.on.extracting_source_help": "Match the filters when extracting from the source exactly.",
- "gui.refinedstorage2.fuzzy_mode.off": "Off",
+ "gui.refinedstorage2.fuzzy_mode.off": "オフ",
"gui.refinedstorage2.fuzzy_mode.off.storage_help": "Match the filters for the allowlist or blocklist without comparing NBT tags.",
"gui.refinedstorage2.fuzzy_mode.off.generic_help": "Match the filter without comparing NBT tags.",
"gui.refinedstorage2.fuzzy_mode.off.extracting_storage_network_help": "Match the filters when extracting from the storage network without comparing NBT tags.",
"gui.refinedstorage2.fuzzy_mode.off.extracting_source_help": "Match the filters when extracting from the source without comparing NBT tags.",
- "gui.refinedstorage2.access_mode": "Access mode",
- "gui.refinedstorage2.access_mode.insert_extract": "Insert and extract",
+ "gui.refinedstorage2.access_mode": "アクセスモード",
+ "gui.refinedstorage2.access_mode.insert_extract": "搬入・搬出",
"gui.refinedstorage2.access_mode.insert_extract.help": "The storage network will be able to insert or extract from this storage.",
- "gui.refinedstorage2.access_mode.insert": "Insert only",
+ "gui.refinedstorage2.access_mode.insert": "搬入のみ",
"gui.refinedstorage2.access_mode.insert.help": "The storage network will only be able to insert into this storage. Contained resources will still be visible in a Grid.",
- "gui.refinedstorage2.access_mode.extract": "Extract only",
+ "gui.refinedstorage2.access_mode.extract": "搬出のみ",
"gui.refinedstorage2.access_mode.extract.help": "The storage network will only be able to extract from this storage.",
- "gui.refinedstorage2.void_excess": "Void excess resources",
+ "gui.refinedstorage2.void_excess": "余分なリソースを破棄",
"gui.refinedstorage2.void_excess.help": "When void excess mode is turned on and the storage is full, it will keep accepting resources but void them.",
"gui.refinedstorage2.void_excess.allowlist_warning": "Void excess will only work when the storage is in allowlist mode.",
"gui.refinedstorage2.upgrade_slot": "Empty upgrade slot",
@@ -144,27 +135,38 @@
"gui.refinedstorage2.regulator_upgrade.filter_help": "The resource that should be regulated in the target.",
"gui.refinedstorage2.network_transmitter.status.inactive": "Inactive",
"gui.refinedstorage2.network_transmitter.status.missing_network_card": "Missing Network Card",
- "gui.refinedstorage2.network_transmitter.status.transmitting": "%d block(s)",
- "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "Unreachable",
- "gui.refinedstorage2.security_card.permission.reset": "Reset",
- "gui.refinedstorage2.security_card.permission.modified": "Modified",
+ "gui.refinedstorage2.network_transmitter.status.transmitting": "%dブロック",
+ "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "アクセス不可",
+ "gui.refinedstorage2.security_card.permission.reset": "リセット",
+ "gui.refinedstorage2.security_card.permission.modified": "変更済み",
"gui.refinedstorage2.security_manager.redstone_mode_help": "When this device is inactive, the network will not be protected.",
"gui.refinedstorage2.security_manager.fallback_security_card_slot_hint": "Slot for a Fallback Security Card.",
"gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.",
"gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.",
- "gui.refinedstorage2.relay.pass_through": "Pass-through",
+ "gui.refinedstorage2.relay.pass_through": "通過",
"gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.",
- "gui.refinedstorage2.relay.pass_energy": "Pass energy",
+ "gui.refinedstorage2.relay.pass_energy": "エネルギーを通過",
"gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.",
- "gui.refinedstorage2.relay.pass_storage": "Pass storage",
+ "gui.refinedstorage2.relay.pass_storage": "ストレージを通過",
"gui.refinedstorage2.relay.pass_storage.help": "Whether this device should pass the storage from the input network to the output network.",
- "gui.refinedstorage2.relay.pass_security": "Pass security",
+ "gui.refinedstorage2.relay.pass_security": "セキュリティを通過",
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,26 +176,27 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
- "item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
- "item.refinedstorage2.processor_binding": "Processor Binding",
- "item.refinedstorage2.silicon": "Silicon",
- "item.refinedstorage2.raw_basic_processor": "Raw Basic Processor",
- "item.refinedstorage2.raw_improved_processor": "Raw Improved Processor",
- "item.refinedstorage2.raw_advanced_processor": "Raw Advanced Processor",
- "item.refinedstorage2.basic_processor": "Basic Processor",
- "item.refinedstorage2.improved_processor": "Improved Processor",
- "item.refinedstorage2.advanced_processor": "Advanced Processor",
- "item.refinedstorage2.1k_storage_part": "1K Storage Part",
- "item.refinedstorage2.4k_storage_part": "4K Storage Part",
- "item.refinedstorage2.16k_storage_part": "16K Storage Part",
- "item.refinedstorage2.64k_storage_part": "64K Storage Part",
- "item.refinedstorage2.1k_storage_disk": "1K Storage Disk",
- "item.refinedstorage2.4k_storage_disk": "4K Storage Disk",
- "item.refinedstorage2.16k_storage_disk": "16K Storage Disk",
- "item.refinedstorage2.64k_storage_disk": "64K Storage Disk",
- "item.refinedstorage2.creative_storage_disk": "Creative Storage Disk",
- "item.refinedstorage2.64b_fluid_storage_part": "64B Fluid Storage Part",
- "item.refinedstorage2.256b_fluid_storage_part": "256B Fluid Storage Part",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
+ "item.refinedstorage2.quartz_enriched_iron": "クォーツ濃縮鉄",
+ "item.refinedstorage2.processor_binding": "プロセッサ接合材",
+ "item.refinedstorage2.silicon": "シリコン",
+ "item.refinedstorage2.raw_basic_processor": "生の基本プロセッサ",
+ "item.refinedstorage2.raw_improved_processor": "生の改良プロセッサ",
+ "item.refinedstorage2.raw_advanced_processor": "生の発展プロセッサ",
+ "item.refinedstorage2.basic_processor": "基本プロセッサ",
+ "item.refinedstorage2.improved_processor": "改良プロセッサ",
+ "item.refinedstorage2.advanced_processor": "発展プロセッサ",
+ "item.refinedstorage2.1k_storage_part": "1Kストレージパーツ",
+ "item.refinedstorage2.4k_storage_part": "4Kストレージパーツ",
+ "item.refinedstorage2.16k_storage_part": "16Kストレージパーツ",
+ "item.refinedstorage2.64k_storage_part": "64Kストレージパーツ",
+ "item.refinedstorage2.1k_storage_disk": "1Kストレージディスク",
+ "item.refinedstorage2.4k_storage_disk": "4Kストレージディスク",
+ "item.refinedstorage2.16k_storage_disk": "16Kストレージディスク",
+ "item.refinedstorage2.64k_storage_disk": "64Kストレージディスク",
+ "item.refinedstorage2.creative_storage_disk": "クリエイティブストレージディスク",
+ "item.refinedstorage2.64b_fluid_storage_part": "64B流体ストレージパーツ",
+ "item.refinedstorage2.256b_fluid_storage_part": "256B流体ストレージパーツ",
"item.refinedstorage2.1024b_fluid_storage_part": "1024B Fluid Storage Part",
"item.refinedstorage2.4096b_fluid_storage_part": "4096B Fluid Storage Part",
"item.refinedstorage2.64b_fluid_storage_disk": "64B Fluid Storage Disk",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json
index 6e06c5772..79efad7d4 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ko_kr.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Grid",
"block.refinedstorage2.crafting_grid": "Crafting Grid",
"block.refinedstorage2.controller": "Controller",
- "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller",
"block.refinedstorage2.creative_controller": "Creative Controller",
"block.refinedstorage2.1k_storage_block": "1K Storage Block",
"block.refinedstorage2.4k_storage_block": "4K Storage Block",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
"gui.refinedstorage2.disk_drive.disks": "Disks",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Synchronization mode",
"gui.refinedstorage2.grid.synchronizer.off": "Off",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Resource type",
"gui.refinedstorage2.grid.resource_type.all": "All",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json
index c6470a816..3d6f7d4c9 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pl_pl.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Terminal",
"block.refinedstorage2.crafting_grid": "Terminal rzemieślniczy",
"block.refinedstorage2.controller": "Kontroler",
- "block.refinedstorage2.controller.rei_fully_charged": "Kontroler w pełni naładowany",
"block.refinedstorage2.creative_controller": "Kontroler kreatywny",
"block.refinedstorage2.1k_storage_block": "Blok pamięci 1k",
"block.refinedstorage2.4k_storage_block": "Blok pamięci 4k",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "Gdy to urządzenie jest nieaktywne, sieć magazynowa nie będzie w stanie używać tego urządzenia jako źródła energii.",
"gui.refinedstorage2.disk_drive.disks": "Dyski",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Tryb synchronizacji",
"gui.refinedstorage2.grid.synchronizer.off": "Wyłączone",
"gui.refinedstorage2.grid.synchronizer.off.help": "Nie synchronizuj tekstu pola wyszukiwania.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Synchronizuj pole wyszukiwania z filtrem JEI.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "Dwukierunkowe JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Synchronizuj pole wyszukiwania z filtrem JEI i filtr JEI do pola wyszukiwania.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Synchronizuj pole wyszukiwania z filtrem REI.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "Dwukierunkowe REI",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Typ zasobu",
"gui.refinedstorage2.grid.resource_type.all": "Wszystko",
"gui.refinedstorage2.grid.resource_type.help": "Filtruj określone typy zasobów.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Zapewnia sieć magazynowania w energie. Sieć może mieć ich kilka.",
"item.refinedstorage2.creative_controller.help": "Zapewnia sieć magazynowania w nieskończoną energię.",
"item.refinedstorage2.disk_drive.help": "Akceptuje dyski do zapewnienia przestrzeni dyskowej dla sieci magazynowania.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Umożliwia interakcję z siecią magazynowania.",
"item.refinedstorage2.crafting_grid.help": "Umożliwia interakcję z siecią magazynowania, z możliwością tworzenia.",
"item.refinedstorage2.importer.help": "Importuj zasoby ze źródła zewnętrznego do sieci magazynowej.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json
index 84900c0f4..600fd643e 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/pt_br.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Grade",
"block.refinedstorage2.crafting_grid": "Grade de Criação",
"block.refinedstorage2.controller": "Controlador",
- "block.refinedstorage2.controller.rei_fully_charged": "Controlador com carga completa",
"block.refinedstorage2.creative_controller": "Controlador Criativo",
"block.refinedstorage2.1k_storage_block": "Bloco de armazenamento 1k",
"block.refinedstorage2.4k_storage_block": "Bloco de armazenamento 4K",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "Quando este dispositivo estiver inativo, a rede de armazenamento não poderá usar este dispositivo como fonte de energia.",
"gui.refinedstorage2.disk_drive.disks": "Discos",
"gui.refinedstorage2.storage.redstone_mode_help": "Quando este dispositivo estiver inativo, o armazenamento contido não estará mais acessível a partir da rede de armazenamento.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Synchronization mode",
"gui.refinedstorage2.grid.synchronizer.off": "Off",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Resource type",
"gui.refinedstorage2.grid.resource_type.all": "All",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json
index ed1c6a6dd..d8ae6323b 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/ru_ru.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Терминал",
"block.refinedstorage2.crafting_grid": "Терминал создания",
"block.refinedstorage2.controller": "Контроллер",
- "block.refinedstorage2.controller.rei_fully_charged": "Полностью заряженный контроллер",
"block.refinedstorage2.creative_controller": "Творческий контроллер",
"block.refinedstorage2.1k_storage_block": "Блок хранения 1k",
"block.refinedstorage2.4k_storage_block": "Блок хранения 4k",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Диспетчер безопасности",
"block.refinedstorage2.security_manager.help": "Когда это устройство активно, оно по умолчанию защищает сеть и блокирует все операции. Начните добавлять карты безопасности, чтобы разрешить или запретить определённые операции для игрока.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
"gui.refinedstorage2.disk_drive.disks": "Диски",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Режим синхронизации",
"gui.refinedstorage2.grid.synchronizer.off": "Выкл.",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Resource type",
"gui.refinedstorage2.grid.resource_type.all": "All",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
@@ -153,7 +144,7 @@
"gui.refinedstorage2.security_manager.no_fallback_security_card_consequence": "Add a Fallback Security Card to this slot to set permissions for every player without a Security Card. By default, all actions are denied.",
"gui.refinedstorage2.relay.filter_help": "Resources which should be exposed from the input network to the output network if the Relay isn't in pass-through mode.",
"gui.refinedstorage2.relay.pass_through": "Pass-through",
- "gui.refinedstorage2.relay.pass_through.help": "Whether this device should pass-through the entire input network signal as-is. Turn this off to selectively expose components to the output network.",
+ "gui.refinedstorage2.relay.pass_through.help": "Должно ли это устройство передавать весь сигнал входящей сети как есть. Выключите это, чтобы выборочно дать доступ к компонентам в выходной сети.",
"gui.refinedstorage2.relay.pass_energy": "Pass energy",
"gui.refinedstorage2.relay.pass_energy.help": "Whether this device should pass the energy buffer from the input network to the output network.",
"gui.refinedstorage2.relay.pass_storage": "Pass storage",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -214,7 +217,7 @@
"item.refinedstorage2.fortune_upgrade.2": "Fortune II Upgrade",
"item.refinedstorage2.fortune_upgrade.3": "Fortune III Upgrade",
"item.refinedstorage2.regulator_upgrade": "Regulator Upgrade",
- "item.refinedstorage2.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.",
+ "item.refinedstorage2.regulator_upgrade.help": "В экспортировщике экспортируется только в том случае, если количество в целевом месте меньше, чем указано в улучшении. В импортировщике импортируется только в том случае, если количество в целевом месте больше, чем указано в улучшении. Используйте предмет для настройки.",
"item.refinedstorage2.range_upgrade": "Range Upgrade",
"item.refinedstorage2.creative_range_upgrade": "Creative Range Upgrade",
"item.refinedstorage2.wireless_grid": "Wireless Grid",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json
index 3a8d24485..4ca3d891a 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_cn.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "终端",
"block.refinedstorage2.crafting_grid": "合成终端",
"block.refinedstorage2.controller": "控制器",
- "block.refinedstorage2.controller.rei_fully_charged": "充满电的控制器",
"block.refinedstorage2.creative_controller": "创造控制器",
"block.refinedstorage2.1k_storage_block": "1K 存储方块",
"block.refinedstorage2.4k_storage_block": "4K 存储方块",
@@ -34,8 +33,8 @@
"block.refinedstorage2.creative_portable_grid": "创造模式便携式终端",
"block.refinedstorage2.security_manager": "权限管理器",
"block.refinedstorage2.security_manager.help": "当此设备处于激活状态时会默认阻止所有操作来保护网络。添加安全卡以配置特定玩家对于特定操作的权限",
- "block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.relay": "中继器",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "当此设备处于非激活状态时,存储网络将无法将此设备用作能源来源。",
"gui.refinedstorage2.disk_drive.disks": "磁盘",
"gui.refinedstorage2.storage.redstone_mode_help": "当此设备处于非激活状态时,其中的存储空间将无法从存储网络内访问。",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "同步模式",
"gui.refinedstorage2.grid.synchronizer.off": "关闭",
"gui.refinedstorage2.grid.synchronizer.off.help": "不同步搜索框文本。",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "将搜索框文本同步到 JEI 过滤器。",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI 双向",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "将搜索框文本同步到 JEI 过滤器,并将 JEI 过滤器同步到搜索框文本。",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "将搜索框文本同步到 REI 过滤器。",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI 双向",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "将搜索框文本同步到 REI 过滤器,并将 REI 过滤器同步到搜索框文本。",
"gui.refinedstorage2.grid.resource_type": "存储通道",
"gui.refinedstorage2.grid.resource_type.all": "全部",
"gui.refinedstorage2.grid.resource_type.help": "从特定的存储通道中过滤资源。",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "为存储网络提供能量。一个存储网络中允许包含多个。",
"item.refinedstorage2.creative_controller.help": "为存储网络提供无限能源。",
"item.refinedstorage2.disk_drive.help": "接受存储磁盘,为存储网络提供存储空间。",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "允许与存储网络交互。",
"item.refinedstorage2.crafting_grid.help": "允许与存储网络交互,并具有合成能力。",
"item.refinedstorage2.importer.help": "从外部源导入资源到存储网络。",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "如果存储网络包含等于、大于或小于给定数量的资源,则发出红石信号。",
"item.refinedstorage2.constructor.help": "从存储网络中放置方块到世界中。",
"item.refinedstorage2.destructor.help": "从世界中销毁方块并将其放入存储网络。",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "富石英铁",
"item.refinedstorage2.processor_binding": "处理器绑定",
"item.refinedstorage2.silicon": "硅",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "清除合成终端矩阵到库存",
"key.refinedstorage2.open_wireless_grid": "打开无线终端",
"refinedstorage2.subtitle.wrench": "使用扳手",
- "curios.identifier.refinedstorage2": "精致存储 2",
- "trinkets.slot.refinedstorage2.wireless": "精致存储 2",
"permission.refinedstorage2.insert": "存入",
"permission.refinedstorage2.insert.description": "玩家是否可以向存储网络中存入资源",
"permission.refinedstorage2.extract": "取出",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "玩家是否可以在网络中添加或者移除设备",
"permission.refinedstorage2.security": "权限",
"permission.refinedstorage2.security.description": "玩家是否可以管理网络的权限设置",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "精致存储 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "平滑滚动",
"text.autoconfig.refinedstorage2.option.screenSize": "界面大小",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "磁盘驱动器",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "耗能",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "每个磁盘的耗能",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "存储方块",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K 能源",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K 能源",
@@ -380,14 +403,16 @@
"text.autoconfig.refinedstorage2.option.fallbackSecurityCard.energyUsage": "耗能",
"text.autoconfig.refinedstorage2.option.securityManager": "权限管理器",
"text.autoconfig.refinedstorage2.option.securityManager.energyUsage": "耗能",
- "text.autoconfig.refinedstorage2.option.relay": "Relay",
- "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "Input network energy usage",
+ "text.autoconfig.refinedstorage2.option.relay": "中继器",
+ "text.autoconfig.refinedstorage2.option.relay.inputNetworkEnergyUsage": "输入网络耗能",
"text.autoconfig.refinedstorage2.option.relay.outputNetworkEnergyUsage": "Output network energy usage (if not in pass through mode)",
"advancements.refinedstorage2.root.description": "在网络中使用一个或多个控制器为其提供能量",
"advancements.refinedstorage2.connecting": "连接",
"advancements.refinedstorage2.connecting.description": "使用电缆将设备连接在一起,或放置时使设备贴在一起",
"advancements.refinedstorage2.drives": "驱动器",
"advancements.refinedstorage2.drives.description": "合成一个磁盘驱动器,以便能够收纳您的存储磁盘",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "存储物品",
"advancements.refinedstorage2.storing_items.description": "合成一个存储磁盘并将其放入磁盘驱动器中",
"advancements.refinedstorage2.viewing_your_storage": "查看您的存储",
@@ -422,6 +447,6 @@
"advancements.refinedstorage2.portable_storage.description": "合成一个便携式终端,在不需要连接到存储网络的情况下也可以访问磁盘内容。",
"advancements.refinedstorage2.security": "权限",
"advancements.refinedstorage2.security.description": "用权限管理器和权限卡来保护你的存储网络",
- "advancements.refinedstorage2.conditional_connecting": "Conditional connecting",
+ "advancements.refinedstorage2.conditional_connecting": "条件连接",
"advancements.refinedstorage2.conditional_connecting.description": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay"
}
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json
index 6e06c5772..79efad7d4 100644
--- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json
+++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/zh_tw.json
@@ -7,7 +7,6 @@
"block.refinedstorage2.grid": "Grid",
"block.refinedstorage2.crafting_grid": "Crafting Grid",
"block.refinedstorage2.controller": "Controller",
- "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller",
"block.refinedstorage2.creative_controller": "Creative Controller",
"block.refinedstorage2.1k_storage_block": "1K Storage Block",
"block.refinedstorage2.4k_storage_block": "4K Storage Block",
@@ -35,7 +34,7 @@
"block.refinedstorage2.security_manager": "Security Manager",
"block.refinedstorage2.security_manager.help": "When this device is active, will protect the network by default and block all operations. Start adding Security Cards to permit or deny specific operations for a player.",
"block.refinedstorage2.relay": "Relay",
- "block.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network with a Relay.",
+ "block.refinedstorage2.disk_interface": "Disk Interface",
"gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.",
"gui.refinedstorage2.disk_drive.disks": "Disks",
"gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.",
@@ -56,14 +55,6 @@
"gui.refinedstorage2.grid.synchronizer": "Synchronization mode",
"gui.refinedstorage2.grid.synchronizer.off": "Off",
"gui.refinedstorage2.grid.synchronizer.off.help": "Don't sync the search box text.",
- "gui.refinedstorage2.grid.synchronizer.jei": "JEI",
- "gui.refinedstorage2.grid.synchronizer.jei.help": "Sync the search box text to the JEI filter.",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way": "JEI two-way",
- "gui.refinedstorage2.grid.synchronizer.jei.two_way.help": "Sync the search box text to the JEI filter, and the JEI filter to the search box text.",
- "gui.refinedstorage2.grid.synchronizer.rei": "REI",
- "gui.refinedstorage2.grid.synchronizer.rei.help": "Sync the search box text to the REI filter.",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way": "REI two-way",
- "gui.refinedstorage2.grid.synchronizer.rei.two_way.help": "Sync the search box text to the REI filter, and the REI filter to the search box text.",
"gui.refinedstorage2.grid.resource_type": "Resource type",
"gui.refinedstorage2.grid.resource_type.all": "All",
"gui.refinedstorage2.grid.resource_type.help": "Filter specific resource types.",
@@ -162,9 +153,20 @@
"gui.refinedstorage2.relay.pass_security.help": "Whether this device should pass the security settings from the input network to the output network.",
"gui.refinedstorage2.relay.filter_mode.allow.help": "Only expose resources from the input network to the output network that are configured in the filters.",
"gui.refinedstorage2.relay.filter_mode.block.help": "Don't expose resources from the input network to the output network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.allow.help": "Only allow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.filter_mode.block.help": "Disallow resources into the storage disks or into the network that are configured in the filters.",
+ "gui.refinedstorage2.disk_interface.in": "In",
+ "gui.refinedstorage2.disk_interface.out": "Out",
+ "gui.refinedstorage2.disk_interface.filter_help": "The resources that may or may not be allowed transferred from or into the provided storage disks, depending if the device is in allowlist or blocklist mode.",
+ "gui.refinedstorage2.disk_interface.transfer_mode": "Transfer mode",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network": "Insert into network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.insert_into_network.help": "Insert the resources from the storage disks into the storage network.",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network": "Extract from network",
+ "gui.refinedstorage2.disk_interface.transfer_mode.extract_from_network.help": "Insert the resources from the storage network into the storage disks.",
"item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.",
"item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.",
"item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.",
+ "item.refinedstorage2.disk_interface.help": "Transfers resources between the storage network and provided storage disks.",
"item.refinedstorage2.grid.help": "Allows for interacting with the storage network.",
"item.refinedstorage2.crafting_grid.help": "Allows for interacting with the storage network, with crafting abilities.",
"item.refinedstorage2.importer.help": "Imports resources from an external source to the storage network.",
@@ -174,6 +176,7 @@
"item.refinedstorage2.detector.help": "Emits a redstone signal if the storage network contains a resource equal, above or under a given amount.",
"item.refinedstorage2.constructor.help": "Places blocks from the storage network in the world.",
"item.refinedstorage2.destructor.help": "Destroys blocks from the world and puts them in the storage network.",
+ "item.refinedstorage2.relay.help": "Turn entire sections of a storage network on or off and create new branches of your network.",
"item.refinedstorage2.quartz_enriched_iron": "Quartz Enriched Iron",
"item.refinedstorage2.processor_binding": "Processor Binding",
"item.refinedstorage2.silicon": "Silicon",
@@ -279,8 +282,6 @@
"key.refinedstorage2.clear_crafting_grid_matrix_to_inventory": "Clear Crafting Grid matrix to inventory",
"key.refinedstorage2.open_wireless_grid": "Open Wireless Grid",
"refinedstorage2.subtitle.wrench": "Wrench used",
- "curios.identifier.refinedstorage2": "Refined Storage 2",
- "trinkets.slot.refinedstorage2.wireless": "Refined Storage 2",
"permission.refinedstorage2.insert": "Insert",
"permission.refinedstorage2.insert.description": "Whether the player can insert resources in a network.",
"permission.refinedstorage2.extract": "Extract",
@@ -293,6 +294,25 @@
"permission.refinedstorage2.build.description": "Whether the player can add or remove network devices.",
"permission.refinedstorage2.security": "Security",
"permission.refinedstorage2.security.description": "Whether the player can manage the security options for a network.",
+ "tag.item.refinedstorage2.cables": "Cables",
+ "tag.item.refinedstorage2.constructors": "Constructors",
+ "tag.item.refinedstorage2.controllers": "Controllers",
+ "tag.item.refinedstorage2.crafting_grids": "Crafting Grids",
+ "tag.item.refinedstorage2.creative_controllers": "Creative Controllers",
+ "tag.item.refinedstorage2.destructors": "Destructors",
+ "tag.item.refinedstorage2.detectors": "Detectors",
+ "tag.item.refinedstorage2.exporters": "Exporters",
+ "tag.item.refinedstorage2.external_storages": "External Storages",
+ "tag.item.refinedstorage2.fluid_storage_disks": "Fluid Storage Disks",
+ "tag.item.refinedstorage2.grids": "Grids",
+ "tag.item.refinedstorage2.importers": "Importers",
+ "tag.item.refinedstorage2.network_receivers": "Network Receivers",
+ "tag.item.refinedstorage2.network_transmitters": "Network Transmitters",
+ "tag.item.refinedstorage2.relays": "Relays",
+ "tag.item.refinedstorage2.security_managers": "Security Managers",
+ "tag.item.refinedstorage2.storage_disks": "Storage Disks",
+ "tag.item.refinedstorage2.wireless_transmitters": "Wireless Transmitters",
+ "tag.item.refinedstorage2.disk_interfaces": "Disk Interfaces",
"text.autoconfig.refinedstorage2.title": "Refined Storage 2",
"text.autoconfig.refinedstorage2.option.smoothScrolling": "Smooth scrolling",
"text.autoconfig.refinedstorage2.option.screenSize": "Screen size",
@@ -318,6 +338,9 @@
"text.autoconfig.refinedstorage2.option.diskDrive": "Disk Drive",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsage": "Energy usage",
"text.autoconfig.refinedstorage2.option.diskDrive.energyUsagePerDisk": "Energy usage per disk",
+ "text.autoconfig.refinedstorage2.option.diskInterface": "Disk Interface",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsage": "Energy usage",
+ "text.autoconfig.refinedstorage2.option.diskInterface.energyUsagePerDisk": "Energy usage per disk",
"text.autoconfig.refinedstorage2.option.storageBlock": "Storage Block",
"text.autoconfig.refinedstorage2.option.storageBlock.oneKEnergyUsage": "1K energy usage",
"text.autoconfig.refinedstorage2.option.storageBlock.fourKEnergyUsage": "4K energy usage",
@@ -388,6 +411,8 @@
"advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other",
"advancements.refinedstorage2.drives": "Drives",
"advancements.refinedstorage2.drives.description": "Craft a Disk Drive to be able to store your storage disks",
+ "advancements.refinedstorage2.interfacing_with_disks": "Interfacing with disks",
+ "advancements.refinedstorage2.interfacing_with_disks.description": "Craft a Disk Interface to transfer resources between the storage network and storage disks",
"advancements.refinedstorage2.storing_items": "Storing items",
"advancements.refinedstorage2.storing_items.description": "Craft a Storage Disk and put it in your Disk Drive",
"advancements.refinedstorage2.viewing_your_storage": "Viewing your storage",
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/back.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/back.png
new file mode 100644
index 000000000..fb5815576
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/back.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/black.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/black.png
new file mode 100644
index 000000000..391bbcd57
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/black.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/blue.png
new file mode 100644
index 000000000..edeffbcf9
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/blue.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/brown.png
new file mode 100644
index 000000000..016dd7b4b
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/brown.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/cyan.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/cyan.png
new file mode 100644
index 000000000..cbd0c734c
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/cyan.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/gray.png
new file mode 100644
index 000000000..bd1182722
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/gray.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/green.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/green.png
new file mode 100644
index 000000000..59d0b8015
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/green.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/inactive.png
new file mode 100644
index 000000000..6e6d6facf
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/inactive.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/light_blue.png
new file mode 100644
index 000000000..5558434a4
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/light_blue.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/light_gray.png
new file mode 100644
index 000000000..bfbaabf99
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/light_gray.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/lime.png
new file mode 100644
index 000000000..501ea563b
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/lime.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/magenta.png
new file mode 100644
index 000000000..2a03a5e3d
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/magenta.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/orange.png
new file mode 100644
index 000000000..2498383c2
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/orange.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/pink.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/pink.png
new file mode 100644
index 000000000..9ae870552
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/pink.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/purple.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/purple.png
new file mode 100644
index 000000000..ac34cbef0
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/purple.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/red.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/red.png
new file mode 100644
index 000000000..caf5c5a28
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/red.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/white.png
new file mode 100644
index 000000000..40faad586
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/white.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/yellow.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/yellow.png
new file mode 100644
index 000000000..65bab549a
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/cutouts/yellow.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/front.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/front.png
new file mode 100644
index 000000000..faf04c29e
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/front.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/left.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/left.png
new file mode 100644
index 000000000..fb5815576
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/left.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/right.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/right.png
new file mode 100644
index 000000000..fb5815576
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/right.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/top.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/top.png
new file mode 100644
index 000000000..fb5815576
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/disk_interface/top.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/disk_interface.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/disk_interface.png
new file mode 100644
index 000000000..4e813bc8d
Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/disk_interface.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/icons.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/icons.png
index 2a5d67b2e..39ec1ea00 100644
Binary files a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/icons.png and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/icons.png differ
diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/interfacing_with_disks.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/interfacing_with_disks.json
new file mode 100644
index 000000000..abf6a881f
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/interfacing_with_disks.json
@@ -0,0 +1,26 @@
+{
+ "display": {
+ "icon": {
+ "item": "refinedstorage2:disk_interface"
+ },
+ "title": {
+ "translate": "advancements.refinedstorage2.interfacing_with_disks"
+ },
+ "description": {
+ "translate": "advancements.refinedstorage2.interfacing_with_disks.description"
+ }
+ },
+ "parent": "refinedstorage2:drives",
+ "criteria": {
+ "disk_interface_in_inventory": {
+ "trigger": "minecraft:inventory_changed",
+ "conditions": {
+ "items": [
+ {
+ "tag": "refinedstorage2:disk_interfaces"
+ }
+ ]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/disk_interface.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/disk_interface.json
new file mode 100644
index 000000000..4dd84737c
--- /dev/null
+++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/disk_interface.json
@@ -0,0 +1,28 @@
+{
+ "type": "minecraft:crafting_shaped",
+ "pattern": [
+ "ESE",
+ "CMD",
+ "ESE"
+ ],
+ "key": {
+ "E": {
+ "item": "refinedstorage2:quartz_enriched_iron"
+ },
+ "S": {
+ "item": "refinedstorage2:storage_housing"
+ },
+ "C": {
+ "item": "refinedstorage2:construction_core"
+ },
+ "M": {
+ "item": "refinedstorage2:machine_casing"
+ },
+ "D": {
+ "item": "refinedstorage2:destruction_core"
+ }
+ },
+ "result": {
+ "item": "refinedstorage2:disk_interface"
+ }
+}
\ No newline at end of file
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java
index 99f2fcd81..c6ba35785 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java
@@ -22,6 +22,7 @@
import com.refinedmods.refinedstorage2.platform.common.support.tooltip.ResourceClientTooltipComponent;
import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeItem;
import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinationClientTooltipComponent;
+import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil;
import com.refinedmods.refinedstorage2.platform.fabric.mixin.ItemPropertiesAccessor;
import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.EnergyInfoPacket;
import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridActivePacket;
@@ -34,6 +35,8 @@
import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.WirelessTransmitterRangePacket;
import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.DiskDriveBlockEntityRendererImpl;
import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.DiskDriveUnbakedModel;
+import com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface.DiskInterfaceBlockEntityRendererImpl;
+import com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface.DiskInterfaceUnbakedModel;
import com.refinedmods.refinedstorage2.platform.fabric.storage.portablegrid.PortableGridBlockEntityRendererImpl;
import com.refinedmods.refinedstorage2.platform.fabric.storage.portablegrid.PortableGridUnbakedModel;
import com.refinedmods.refinedstorage2.platform.fabric.support.render.EmissiveModelRegistry;
@@ -111,6 +114,7 @@ private void setRenderLayers() {
setCutout(Blocks.INSTANCE.getCreativePortableGrid());
setCutout(Blocks.INSTANCE.getSecurityManager());
setCutout(Blocks.INSTANCE.getRelay());
+ setCutout(Blocks.INSTANCE.getDiskInterface());
}
private void setCutout(final BlockColorMap, ?> blockMap) {
@@ -342,25 +346,56 @@ private void registerBlockEntityRenderers() {
BlockEntities.INSTANCE.getCreativePortableGrid(),
ctx -> new PortableGridBlockEntityRendererImpl<>()
);
+ BlockEntityRenderers.register(
+ BlockEntities.INSTANCE.getDiskInterface(),
+ ctx -> new DiskInterfaceBlockEntityRendererImpl<>()
+ );
}
private void registerCustomModels() {
registerDiskModels();
+ final QuadRotators quadRotators = new QuadRotators();
+ ModelLoadingPlugin.register(pluginContext -> {
+ registerCustomDiskDriveModels(pluginContext, quadRotators);
+ registerCustomDiskInterfaceModels(pluginContext, quadRotators);
+ registerCustomPortableGridModels(pluginContext, quadRotators);
+ });
+ }
- final ResourceLocation diskDriveIdentifier = createIdentifier("block/disk_drive");
- final ResourceLocation diskDriveIdentifierItem = createIdentifier("item/disk_drive");
+ private void registerCustomDiskInterfaceModels(final ModelLoadingPlugin.Context pluginContext,
+ final QuadRotators quadRotators) {
+ pluginContext.resolveModel().register(context -> {
+ if (context.id().getNamespace().equals(IdentifierUtil.MOD_ID)
+ && context.id().getPath().startsWith("item/")
+ && context.id().getPath().endsWith("disk_interface")) {
+ final boolean isDefault = !context.id().getPath().endsWith("_disk_interface");
+ final DyeColor color = isDefault
+ ? Blocks.INSTANCE.getDiskInterface().getDefault().getColor()
+ : DyeColor.byName(context.id().getPath().replace("_disk_interface", "")
+ .replace("item/", ""), Blocks.INSTANCE.getDiskInterface().getDefault().getColor());
+ return new DiskInterfaceUnbakedModel(quadRotators, color);
+ }
+ if (context.id().getNamespace().equals(IdentifierUtil.MOD_ID)
+ && context.id().getPath().startsWith("block/disk_interface/")
+ && !context.id().getPath().startsWith("block/disk_interface/base_")
+ && !context.id().getPath().equals("block/disk_interface/inactive")) {
+ final DyeColor color = DyeColor.byName(
+ context.id().getPath().replace("block/disk_interface/", ""),
+ Blocks.INSTANCE.getDiskInterface().getDefault().getColor()
+ );
+ return new DiskInterfaceUnbakedModel(quadRotators, color);
+ }
+ return null;
+ });
+ }
+ private void registerCustomPortableGridModels(final ModelLoadingPlugin.Context pluginContext,
+ final QuadRotators quadRotators) {
final ResourceLocation portableGridIdentifier = createIdentifier("block/portable_grid");
final ResourceLocation portableGridIdentifierItem = createIdentifier("item/portable_grid");
final ResourceLocation creativePortableGridIdentifier = createIdentifier("block/creative_portable_grid");
final ResourceLocation creativePortableGridIdentifierItem = createIdentifier("item/creative_portable_grid");
-
- final QuadRotators quadRotators = new QuadRotators();
-
- ModelLoadingPlugin.register(pluginContext -> pluginContext.resolveModel().register(context -> {
- if (context.id().equals(diskDriveIdentifier) || context.id().equals(diskDriveIdentifierItem)) {
- return new DiskDriveUnbakedModel(quadRotators);
- }
+ pluginContext.resolveModel().register(context -> {
if (context.id().equals(portableGridIdentifier)
|| context.id().equals(portableGridIdentifierItem)
|| context.id().equals(creativePortableGridIdentifier)
@@ -368,7 +403,19 @@ private void registerCustomModels() {
return new PortableGridUnbakedModel(quadRotators);
}
return null;
- }));
+ });
+ }
+
+ private void registerCustomDiskDriveModels(final ModelLoadingPlugin.Context pluginContext,
+ final QuadRotators quadRotators) {
+ final ResourceLocation diskDriveIdentifier = createIdentifier("block/disk_drive");
+ final ResourceLocation diskDriveIdentifierItem = createIdentifier("item/disk_drive");
+ pluginContext.resolveModel().register(context -> {
+ if (context.id().equals(diskDriveIdentifier) || context.id().equals(diskDriveIdentifierItem)) {
+ return new DiskDriveUnbakedModel(quadRotators);
+ }
+ return null;
+ });
}
private void registerCustomTooltips() {
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java
index 8f788287e..d08e39e19 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java
@@ -36,6 +36,9 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage2.p
@ConfigEntry.Gui.CollapsibleObject
private DiskDriveEntryImpl diskDrive = new DiskDriveEntryImpl();
+ @ConfigEntry.Gui.CollapsibleObject
+ private DiskInterfaceEntryImpl diskInterface = new DiskInterfaceEntryImpl();
+
@ConfigEntry.Gui.CollapsibleObject
private SimpleEnergyUsageEntryImpl cable = new SimpleEnergyUsageEntryImpl(DefaultEnergyUsage.CABLE);
@@ -156,6 +159,11 @@ public DiskDriveEntry getDiskDrive() {
return diskDrive;
}
+ @Override
+ public DiskInterfaceEntry getDiskInterface() {
+ return diskInterface;
+ }
+
@Override
public SimpleEnergyUsageEntry getCable() {
return cable;
@@ -417,6 +425,22 @@ public long getEnergyUsagePerDisk() {
}
}
+ private static class DiskInterfaceEntryImpl implements DiskInterfaceEntry {
+ private long energyUsage = DefaultEnergyUsage.DISK_INTERFACE;
+
+ private long energyUsagePerDisk = DefaultEnergyUsage.DISK_INTERFACE_PER_DISK;
+
+ @Override
+ public long getEnergyUsage() {
+ return energyUsage;
+ }
+
+ @Override
+ public long getEnergyUsagePerDisk() {
+ return energyUsagePerDisk;
+ }
+ }
+
private static class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry {
private long energyUsage;
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java
index 257d37da7..0a832563e 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ModInitializerImpl.java
@@ -19,6 +19,7 @@
import com.refinedmods.refinedstorage2.platform.common.security.FallbackSecurityCardItem;
import com.refinedmods.refinedstorage2.platform.common.security.SecurityCardItem;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridBlockItem;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridType;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock;
@@ -50,12 +51,14 @@
import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.UseNetworkBoundItemPacket;
import com.refinedmods.refinedstorage2.platform.fabric.security.NetworkNodeBreakSecurityEventListener;
import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.FabricDiskDriveBlockEntity;
+import com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface.FabricDiskInterfaceBlockEntity;
import com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage.FabricStoragePlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.fabric.storage.portablegrid.FabricPortableGridBlockEntity;
import com.refinedmods.refinedstorage2.platform.fabric.support.energy.EnergyStorageAdapter;
import com.refinedmods.refinedstorage2.platform.fabric.support.resource.ResourceContainerFluidStorageAdapter;
import com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -74,6 +77,10 @@
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage;
import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage;
import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage;
+import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant;
+import net.fabricmc.fabric.api.transfer.v1.storage.Storage;
+import net.fabricmc.fabric.api.transfer.v1.storage.base.CombinedStorage;
+import net.fabricmc.fabric.api.transfer.v1.storage.base.FilteringStorage;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
@@ -216,7 +223,8 @@ private void registerContent() {
new DirectRegistryCallback<>(BuiltInRegistries.BLOCK),
FabricDiskDriveBlockEntity::new,
(pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.NORMAL, pos, state),
- (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state)
+ (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state),
+ FabricDiskInterfaceBlockEntity::new
);
final DirectRegistryCallback
- itemRegistryCallback = new DirectRegistryCallback<>(BuiltInRegistries.ITEM);
registerItems(itemRegistryCallback);
@@ -234,7 +242,8 @@ public BlockEntityType create(final BlockEntitySuppli
},
FabricDiskDriveBlockEntity::new,
(pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.NORMAL, pos, state),
- (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state)
+ (pos, state) -> new FabricPortableGridBlockEntity(PortableGridType.CREATIVE, pos, state),
+ FabricDiskInterfaceBlockEntity::new
);
registerMenus(new DirectRegistryCallback<>(BuiltInRegistries.MENU), new MenuTypeFactory() {
@Override
@@ -388,6 +397,15 @@ private void registerSidedHandlers() {
InterfaceBlockEntity::getExportedResourcesAsContainer,
BlockEntities.INSTANCE.getInterface()
);
+ ItemStorage.SIDED.registerForBlockEntity((blockEntity, context) -> {
+ final InventoryStorage storage = InventoryStorage.of(blockEntity.getDiskInventory(), context);
+ final List> parts = new ArrayList<>();
+ for (int i = 0; i < AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS; ++i) {
+ final var slot = storage.getSlot(i);
+ parts.add(i < 3 ? FilteringStorage.insertOnlyOf(slot) : FilteringStorage.extractOnlyOf(slot));
+ }
+ return new CombinedStorage<>(parts);
+ }, BlockEntities.INSTANCE.getDiskInterface());
FluidStorage.SIDED.registerForBlockEntity(
(blockEntity, context) -> new ResourceContainerFluidStorageAdapter(blockEntity.getExportedResources()),
BlockEntities.INSTANCE.getInterface()
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/AbstractDiskContainerBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/AbstractDiskContainerBakedModel.java
new file mode 100644
index 000000000..1294a3911
--- /dev/null
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/AbstractDiskContainerBakedModel.java
@@ -0,0 +1,116 @@
+package com.refinedmods.refinedstorage2.platform.fabric.storage;
+
+import com.refinedmods.refinedstorage2.api.storage.StorageState;
+import com.refinedmods.refinedstorage2.platform.common.storage.AbstractDiskContainerBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
+import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadTranslator;
+
+import java.util.Map;
+import java.util.function.Supplier;
+import javax.annotation.Nullable;
+
+import net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel;
+import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
+import net.minecraft.client.resources.model.BakedModel;
+import net.minecraft.core.BlockPos;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.item.BlockItem;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.BlockAndTintGetter;
+import net.minecraft.world.level.block.state.BlockState;
+
+public abstract class AbstractDiskContainerBakedModel extends ForwardingBakedModel {
+ private final Map
- diskModels;
+ private final BakedModel inactiveLedModel;
+ private final QuadTranslator[] diskTranslations;
+
+ protected AbstractDiskContainerBakedModel(final Map
- diskModels,
+ final BakedModel inactiveLedModel,
+ final QuadTranslator[] diskTranslations) {
+ this.diskModels = diskModels;
+ this.inactiveLedModel = inactiveLedModel;
+ this.diskTranslations = diskTranslations;
+ }
+
+ @Override
+ public boolean isVanillaAdapter() {
+ return false;
+ }
+
+ @Override
+ public void emitBlockQuads(final BlockAndTintGetter blockView,
+ final BlockState state,
+ final BlockPos pos,
+ final Supplier randomSupplier,
+ final RenderContext context) {
+ final Object renderAttachment = blockView.getBlockEntityRenderData(pos);
+ if (renderAttachment instanceof Disk[] disks) {
+ emitDiskQuads(blockView, state, pos, randomSupplier, context, disks);
+ }
+ }
+
+ @Override
+ public void emitItemQuads(final ItemStack stack,
+ final Supplier randomSupplier,
+ final RenderContext context) {
+ final CompoundTag tag = BlockItem.getBlockEntityData(stack);
+ if (tag == null) {
+ return;
+ }
+ for (int i = 0; i < diskTranslations.length; ++i) {
+ final Item diskItem = AbstractDiskContainerBlockEntity.getDisk(tag, i);
+ emitDiskQuads(stack, randomSupplier, context, diskItem, i);
+ }
+ }
+
+ private void emitDiskQuads(final BlockAndTintGetter blockView,
+ final BlockState state,
+ final BlockPos pos,
+ final Supplier randomSupplier,
+ final RenderContext context,
+ final Disk[] disks) {
+ for (int i = 0; i < diskTranslations.length; ++i) {
+ final Disk disk = disks[i];
+ emitDiskQuads(blockView, state, pos, randomSupplier, context, disk, i);
+ }
+ }
+
+ private void emitDiskQuads(final BlockAndTintGetter blockView,
+ final BlockState state,
+ final BlockPos pos,
+ final Supplier randomSupplier,
+ final RenderContext context,
+ final Disk disk,
+ final int index) {
+ if (disk.state() == StorageState.NONE) {
+ return;
+ }
+ final BakedModel model = diskModels.get(disk.item());
+ if (model == null) {
+ return;
+ }
+ context.pushTransform(diskTranslations[index]);
+ model.emitBlockQuads(blockView, state, pos, randomSupplier, context);
+ context.popTransform();
+ }
+
+ private void emitDiskQuads(final ItemStack stack,
+ final Supplier randomSupplier,
+ final RenderContext context,
+ @Nullable final Item diskItem,
+ final int index) {
+ if (diskItem == null) {
+ return;
+ }
+ final BakedModel diskModel = diskModels.get(diskItem);
+ if (diskModel == null) {
+ return;
+ }
+ context.pushTransform(diskTranslations[index]);
+ diskModel.emitItemQuads(stack, randomSupplier, context);
+ inactiveLedModel.emitItemQuads(stack, randomSupplier, context);
+ context.popTransform();
+ }
+}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java
index 0be51b0f9..9b4765a14 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java
@@ -1,58 +1,48 @@
package com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive;
-import com.refinedmods.refinedstorage2.api.storage.StorageState;
-import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
-import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveBlock;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
+import com.refinedmods.refinedstorage2.platform.fabric.storage.AbstractDiskContainerBakedModel;
import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadRotators;
import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadTranslator;
import java.util.Map;
import java.util.function.Supplier;
-import javax.annotation.Nullable;
-import net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel;
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.BlockPos;
-import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.RandomSource;
-import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.state.BlockState;
-class DiskDriveBakedModel extends ForwardingBakedModel {
- private final Map
- diskModels;
- private final BakedModel inactiveLedModel;
+class DiskDriveBakedModel extends AbstractDiskContainerBakedModel {
private final QuadRotators quadRotators;
- private final QuadTranslator[] diskTranslations = new QuadTranslator[8];
DiskDriveBakedModel(final BakedModel baseModel,
final Map
- diskModels,
final BakedModel inactiveLedModel,
final QuadRotators quadRotators) {
+ super(diskModels, inactiveLedModel, getDiskTranslations());
this.wrapped = baseModel;
- this.diskModels = diskModels;
- this.inactiveLedModel = inactiveLedModel;
this.quadRotators = quadRotators;
+ }
+
+ private static QuadTranslator[] getDiskTranslations() {
+ final QuadTranslator[] translations = new QuadTranslator[8];
int i = 0;
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 2; ++x) {
- diskTranslations[i++] = new QuadTranslator(
+ translations[i++] = new QuadTranslator(
x == 0 ? -(2F / 16F) : -(9F / 16F),
-((y * 3F) / 16F) - (2F / 16F),
0
);
}
}
- }
-
- @Override
- public boolean isVanillaAdapter() {
- return false;
+ return translations;
}
@Override
@@ -60,14 +50,7 @@ public void emitItemQuads(final ItemStack stack,
final Supplier randomSupplier,
final RenderContext context) {
wrapped.emitItemQuads(stack, randomSupplier, context);
- final CompoundTag tag = BlockItem.getBlockEntityData(stack);
- if (tag == null) {
- return;
- }
- for (int i = 0; i < diskTranslations.length; ++i) {
- final Item diskItem = AbstractDiskDriveBlockEntity.getDisk(tag, i);
- emitDiskQuads(stack, randomSupplier, context, diskItem, i);
- }
+ super.emitItemQuads(stack, randomSupplier, context);
}
@Override
@@ -84,61 +67,8 @@ public void emitBlockQuads(final BlockAndTintGetter blockView,
return;
}
context.pushTransform(quadRotators.forDirection(direction));
+ wrapped.emitBlockQuads(blockView, state, pos, randomSupplier, context);
super.emitBlockQuads(blockView, state, pos, randomSupplier, context);
- final Object renderAttachment = blockView.getBlockEntityRenderData(pos);
- if (renderAttachment instanceof Disk[] disks) {
- emitDiskQuads(blockView, state, pos, randomSupplier, context, disks);
- }
- context.popTransform();
- }
-
- private void emitDiskQuads(final BlockAndTintGetter blockView,
- final BlockState state,
- final BlockPos pos,
- final Supplier randomSupplier,
- final RenderContext context,
- final Disk[] disks) {
- for (int i = 0; i < diskTranslations.length; ++i) {
- final Disk disk = disks[i];
- emitDiskQuads(blockView, state, pos, randomSupplier, context, disk, i);
- }
- }
-
- private void emitDiskQuads(final BlockAndTintGetter blockView,
- final BlockState state,
- final BlockPos pos,
- final Supplier randomSupplier,
- final RenderContext context,
- final Disk disk,
- final int index) {
- if (disk.state() == StorageState.NONE) {
- return;
- }
- final BakedModel model = diskModels.get(disk.item());
- if (model == null) {
- return;
- }
- context.pushTransform(diskTranslations[index]);
- model.emitBlockQuads(blockView, state, pos, randomSupplier, context);
- context.popTransform();
- }
-
-
- private void emitDiskQuads(final ItemStack stack,
- final Supplier randomSupplier,
- final RenderContext context,
- @Nullable final Item diskItem,
- final int index) {
- if (diskItem == null) {
- return;
- }
- final BakedModel diskModel = diskModels.get(diskItem);
- if (diskModel == null) {
- return;
- }
- context.pushTransform(diskTranslations[index]);
- diskModel.emitItemQuads(stack, randomSupplier, context);
- inactiveLedModel.emitItemQuads(stack, randomSupplier, context);
context.popTransform();
}
}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java
index 62b658e3a..0050dc78f 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java
@@ -13,10 +13,10 @@ public DiskDriveBlockEntityRendererImpl() {
@Override
protected Disk[] getDisks(final AbstractDiskDriveBlockEntity blockEntity) {
- if (!(blockEntity instanceof FabricDiskDriveBlockEntity fabricDiskDriveBlockEntity)) {
+ if (!(blockEntity instanceof FabricDiskDriveBlockEntity fabricBlockEntity)) {
return null;
}
- if (fabricDiskDriveBlockEntity.getRenderData() instanceof Disk[] disks) {
+ if (fabricBlockEntity.getRenderData() instanceof Disk[] disks) {
return disks;
}
return null;
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceBakedModel.java
new file mode 100644
index 000000000..a1bc278a1
--- /dev/null
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceBakedModel.java
@@ -0,0 +1,92 @@
+package com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.DiskInterfaceBlock;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
+import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
+import com.refinedmods.refinedstorage2.platform.fabric.storage.AbstractDiskContainerBakedModel;
+import com.refinedmods.refinedstorage2.platform.fabric.support.render.EmissiveTransform;
+import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadRotators;
+import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadTranslator;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Supplier;
+
+import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
+import net.minecraft.client.resources.model.BakedModel;
+import net.minecraft.core.BlockPos;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.BlockAndTintGetter;
+import net.minecraft.world.level.block.state.BlockState;
+
+class DiskInterfaceBakedModel extends AbstractDiskContainerBakedModel {
+ private final BakedModel inactiveModel;
+ private final QuadRotators quadRotators;
+ private final EmissiveTransform emissiveTransform;
+
+ DiskInterfaceBakedModel(final BakedModel baseModel,
+ final BakedModel inactiveModel,
+ final Map
- diskModels,
+ final BakedModel inactiveLedModel,
+ final QuadRotators quadRotators,
+ final ResourceLocation emissiveSprite) {
+ super(diskModels, inactiveLedModel, getDiskTranslations());
+ this.wrapped = baseModel;
+ this.inactiveModel = inactiveModel;
+ this.quadRotators = quadRotators;
+ this.emissiveTransform = new EmissiveTransform(Set.of(emissiveSprite));
+ }
+
+ private static QuadTranslator[] getDiskTranslations() {
+ final QuadTranslator[] translations = new QuadTranslator[6];
+ for (int i = 0; i < translations.length; ++i) {
+ final int x = i < 3 ? 0 : 1;
+ final int y = i % 3;
+ translations[i] = new QuadTranslator(
+ x == 0 ? -(2F / 16F) : -(9F / 16F),
+ -((y * 3F) / 16F) - (6F / 16F),
+ 0
+ );
+ }
+ return translations;
+ }
+
+ @Override
+ public void emitItemQuads(final ItemStack stack,
+ final Supplier randomSupplier,
+ final RenderContext context) {
+ context.pushTransform(emissiveTransform);
+ wrapped.emitItemQuads(stack, randomSupplier, context);
+ context.popTransform();
+ super.emitItemQuads(stack, randomSupplier, context);
+ }
+
+ @Override
+ public void emitBlockQuads(final BlockAndTintGetter blockView,
+ final BlockState state,
+ final BlockPos pos,
+ final Supplier randomSupplier,
+ final RenderContext context) {
+ if (!(state.getBlock() instanceof DiskInterfaceBlock diskInterfaceBlock)) {
+ return;
+ }
+ final BiDirection direction = diskInterfaceBlock.getDirection(state);
+ if (direction == null) {
+ return;
+ }
+ context.pushTransform(quadRotators.forDirection(direction));
+ final boolean active = state.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE);
+ if (active) {
+ context.pushTransform(emissiveTransform);
+ }
+ (active ? wrapped : inactiveModel).emitBlockQuads(blockView, state, pos, randomSupplier, context);
+ super.emitBlockQuads(blockView, state, pos, randomSupplier, context);
+ if (active) {
+ context.popTransform();
+ }
+ context.popTransform();
+ }
+}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java
new file mode 100644
index 000000000..4a62ebca9
--- /dev/null
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceBlockEntityRendererImpl.java
@@ -0,0 +1,24 @@
+package com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntityRenderer;
+import com.refinedmods.refinedstorage2.platform.fabric.support.render.RenderTypes;
+
+public class DiskInterfaceBlockEntityRendererImpl
+ extends AbstractDiskInterfaceBlockEntityRenderer {
+ public DiskInterfaceBlockEntityRendererImpl() {
+ super(RenderTypes.DISK_LED);
+ }
+
+ @Override
+ protected Disk[] getDisks(final AbstractDiskInterfaceBlockEntity blockEntity) {
+ if (!(blockEntity instanceof FabricDiskInterfaceBlockEntity fabricBlockEntity)) {
+ return null;
+ }
+ if (fabricBlockEntity.getRenderData() instanceof Disk[] disks) {
+ return disks;
+ }
+ return null;
+ }
+}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java
new file mode 100644
index 000000000..e319153c1
--- /dev/null
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/DiskInterfaceUnbakedModel.java
@@ -0,0 +1,84 @@
+package com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.platform.api.PlatformApi;
+import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadRotators;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import javax.annotation.Nullable;
+
+import net.minecraft.client.renderer.texture.TextureAtlasSprite;
+import net.minecraft.client.resources.model.BakedModel;
+import net.minecraft.client.resources.model.Material;
+import net.minecraft.client.resources.model.ModelBaker;
+import net.minecraft.client.resources.model.ModelState;
+import net.minecraft.client.resources.model.UnbakedModel;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.world.item.DyeColor;
+import net.minecraft.world.item.Item;
+
+import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier;
+import static java.util.Objects.requireNonNull;
+
+public class DiskInterfaceUnbakedModel implements UnbakedModel {
+ private static final ResourceLocation INACTIVE_MODEL = createIdentifier("block/disk_interface/inactive");
+ private static final ResourceLocation LED_INACTIVE_MODEL = createIdentifier("block/disk/led_inactive");
+
+ private final QuadRotators quadRotators;
+ private final ResourceLocation baseModel;
+ private final ResourceLocation emissiveSprite;
+
+ public DiskInterfaceUnbakedModel(final QuadRotators quadRotators, final DyeColor color) {
+ this.quadRotators = quadRotators;
+ this.baseModel = createIdentifier("block/disk_interface/base_" + color.getName());
+ this.emissiveSprite = createIdentifier("block/disk_interface/cutouts/" + color.getName());
+ }
+
+ @Override
+ public Collection getDependencies() {
+ final Set dependencies = new HashSet<>();
+ dependencies.add(baseModel);
+ dependencies.add(INACTIVE_MODEL);
+ dependencies.add(LED_INACTIVE_MODEL);
+ dependencies.addAll(PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels());
+ return dependencies;
+ }
+
+ @Override
+ public void resolveParents(final Function modelGetter) {
+ modelGetter.apply(baseModel).resolveParents(modelGetter);
+ modelGetter.apply(INACTIVE_MODEL).resolveParents(modelGetter);
+ PlatformApi.INSTANCE.getStorageContainerItemHelper().getDiskModels().forEach(
+ diskModel -> modelGetter.apply(diskModel).resolveParents(modelGetter)
+ );
+ modelGetter.apply(LED_INACTIVE_MODEL).resolveParents(modelGetter);
+ }
+
+ @Nullable
+ @Override
+ public BakedModel bake(final ModelBaker baker,
+ final Function spriteGetter,
+ final ModelState state,
+ final ResourceLocation location) {
+ final Map
- diskModels = PlatformApi.INSTANCE.getStorageContainerItemHelper()
+ .getDiskModelsByItem()
+ .entrySet()
+ .stream()
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ entry -> requireNonNull(baker.bake(entry.getValue(), state))
+ ));
+ return new DiskInterfaceBakedModel(
+ requireNonNull(baker.bake(baseModel, state)),
+ requireNonNull(baker.bake(INACTIVE_MODEL, state)),
+ diskModels,
+ requireNonNull(baker.bake(LED_INACTIVE_MODEL, state)),
+ quadRotators,
+ emissiveSprite
+ );
+ }
+}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java
new file mode 100644
index 000000000..30370e0be
--- /dev/null
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/FabricDiskInterfaceBlockEntity.java
@@ -0,0 +1,20 @@
+package com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
+
+import javax.annotation.Nullable;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.level.block.state.BlockState;
+
+public class FabricDiskInterfaceBlockEntity extends AbstractDiskInterfaceBlockEntity {
+ public FabricDiskInterfaceBlockEntity(final BlockPos pos, final BlockState state) {
+ super(pos, state);
+ }
+
+ @Override
+ @Nullable
+ public Object getRenderData() {
+ return disks;
+ }
+}
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/package-info.java
new file mode 100644
index 000000000..2e7c72336
--- /dev/null
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskinterface/package-info.java
@@ -0,0 +1,7 @@
+@ParametersAreNonnullByDefault
+@FieldsAndMethodsAreNonnullByDefault
+package com.refinedmods.refinedstorage2.platform.fabric.storage.diskinterface;
+
+import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java
index c87fc09b0..fc482524b 100644
--- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java
+++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java
@@ -11,10 +11,10 @@
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.resources.ResourceLocation;
-class EmissiveTransform implements RenderContext.QuadTransform {
+public class EmissiveTransform implements RenderContext.QuadTransform {
private final Set emissiveSprites;
- EmissiveTransform(final Set emissiveSprites) {
+ public EmissiveTransform(final Set emissiveSprites) {
this.emissiveSprites = emissiveSprites;
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java
index 1ec7e7b94..4c2983c95 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java
@@ -6,6 +6,7 @@
import com.refinedmods.refinedstorage2.platform.common.AbstractClientModInitializer;
import com.refinedmods.refinedstorage2.platform.common.configurationcard.ConfigurationCardItemPropertyFunction;
import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities;
+import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
import com.refinedmods.refinedstorage2.platform.common.content.ContentNames;
import com.refinedmods.refinedstorage2.platform.common.content.Items;
import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings;
@@ -21,6 +22,8 @@
import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinationClientTooltipComponent;
import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.DiskDriveBlockEntityRendererImpl;
import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.DiskDriveGeometryLoader;
+import com.refinedmods.refinedstorage2.platform.forge.storage.diskinterface.DiskInterfaceBlockEntityRendererImpl;
+import com.refinedmods.refinedstorage2.platform.forge.storage.diskinterface.DiskInterfaceGeometryLoader;
import com.refinedmods.refinedstorage2.platform.forge.storage.portablegrid.PortableGridBlockEntityRendererImpl;
import com.refinedmods.refinedstorage2.platform.forge.storage.portablegrid.PortableGridGeometryLoader;
@@ -85,6 +88,9 @@ public static void onRegisterModelGeometry(final ModelEvent.RegisterGeometryLoad
registerDiskModels();
e.register(DISK_DRIVE, new DiskDriveGeometryLoader());
e.register(PORTABLE_GRID, new PortableGridGeometryLoader());
+ Blocks.INSTANCE.getDiskInterface().forEach(
+ (color, id, supplier) -> e.register(id, new DiskInterfaceGeometryLoader(color))
+ );
}
@SubscribeEvent
@@ -157,6 +163,10 @@ private static void registerBlockEntityRenderer() {
BlockEntities.INSTANCE.getCreativePortableGrid(),
ctx -> new PortableGridBlockEntityRendererImpl<>()
);
+ BlockEntityRenderers.register(
+ BlockEntities.INSTANCE.getDiskInterface(),
+ ctx -> new DiskInterfaceBlockEntityRendererImpl<>()
+ );
}
@SubscribeEvent
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java
index 2406e4068..f9a3477ed 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java
@@ -25,6 +25,7 @@ public class ConfigImpl implements Config {
private final SimpleEnergyUsageEntry cable;
private final ControllerEntry controller;
private final DiskDriveEntry diskDrive;
+ private final DiskInterfaceEntry diskInterface;
private final GridEntry grid;
private final CraftingGridEntry craftingGrid;
private final StorageBlockEntry storageBlock;
@@ -61,6 +62,7 @@ public ConfigImpl() {
cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE);
controller = new ControllerEntryImpl();
diskDrive = new DiskDriveEntryImpl();
+ diskInterface = new DiskInterfaceEntryImpl();
grid = new GridEntryImpl();
craftingGrid = new CraftingGridEntryImpl();
storageBlock = new StorageBlockEntryImpl();
@@ -158,6 +160,11 @@ public DiskDriveEntry getDiskDrive() {
return diskDrive;
}
+ @Override
+ public DiskInterfaceEntry getDiskInterface() {
+ return diskInterface;
+ }
+
@Override
public SimpleEnergyUsageEntry getCable() {
return cable;
@@ -320,6 +327,30 @@ public long getEnergyUsagePerDisk() {
}
}
+ private class DiskInterfaceEntryImpl implements DiskInterfaceEntry {
+ private final ModConfigSpec.LongValue energyUsage;
+ private final ModConfigSpec.LongValue energyUsagePerDisk;
+
+ private DiskInterfaceEntryImpl() {
+ builder.push("diskInterface");
+ energyUsage = builder.comment("The energy used by the Disk Interface")
+ .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.DISK_INTERFACE, 0, Long.MAX_VALUE);
+ energyUsagePerDisk = builder.comment("The energy used per disk")
+ .defineInRange("energyUsagePerDisk", DefaultEnergyUsage.DISK_INTERFACE_PER_DISK, 0, Long.MAX_VALUE);
+ builder.pop();
+ }
+
+ @Override
+ public long getEnergyUsage() {
+ return energyUsage.get();
+ }
+
+ @Override
+ public long getEnergyUsagePerDisk() {
+ return energyUsagePerDisk.get();
+ }
+ }
+
private class GridEntryImpl implements GridEntry {
private final ModConfigSpec.BooleanValue largeFont;
private final ModConfigSpec.BooleanValue preventSortingWhileShiftIsDown;
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java
index 9025bb209..d2893a554 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ModInitializer.java
@@ -17,6 +17,7 @@
import com.refinedmods.refinedstorage2.platform.common.iface.InterfacePlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.common.security.FallbackSecurityCardItem;
import com.refinedmods.refinedstorage2.platform.common.security.SecurityCardItem;
+import com.refinedmods.refinedstorage2.platform.common.storage.diskinterface.AbstractDiskInterfaceBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridBlockItem;
import com.refinedmods.refinedstorage2.platform.common.storage.portablegrid.PortableGridType;
import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock;
@@ -33,10 +34,12 @@
import com.refinedmods.refinedstorage2.platform.forge.importer.FluidHandlerImporterTransferStrategyFactory;
import com.refinedmods.refinedstorage2.platform.forge.importer.ItemHandlerImporterTransferStrategyFactory;
import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.ForgeDiskDriveBlockEntity;
+import com.refinedmods.refinedstorage2.platform.forge.storage.diskinterface.ForgeDiskInterfaceBlockEntity;
import com.refinedmods.refinedstorage2.platform.forge.storage.externalstorage.FluidHandlerPlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.forge.storage.externalstorage.ItemHandlerPlatformExternalStorageProviderFactory;
import com.refinedmods.refinedstorage2.platform.forge.storage.portablegrid.ForgePortableGridBlockEntity;
import com.refinedmods.refinedstorage2.platform.forge.support.energy.EnergyStorageAdapter;
+import com.refinedmods.refinedstorage2.platform.forge.support.inventory.InsertExtractItemHandler;
import com.refinedmods.refinedstorage2.platform.forge.support.packet.c2s.CraftingGridClearPacket;
import com.refinedmods.refinedstorage2.platform.forge.support.packet.c2s.CraftingGridRecipeTransferPacket;
import com.refinedmods.refinedstorage2.platform.forge.support.packet.c2s.GridExtractPacket;
@@ -97,6 +100,7 @@
import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent;
import net.neoforged.neoforge.event.level.BlockEvent;
import net.neoforged.neoforge.items.wrapper.InvWrapper;
+import net.neoforged.neoforge.items.wrapper.RangedWrapper;
import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent;
import net.neoforged.neoforge.network.registration.IPayloadRegistrar;
import net.neoforged.neoforge.registries.DeferredRegister;
@@ -198,7 +202,8 @@ private void registerExternalStorageProviderFactories() {
PlatformApi.INSTANCE.addExternalStorageProviderFactory(new InterfacePlatformExternalStorageProviderFactory());
PlatformApi.INSTANCE.addExternalStorageProviderFactory(new ItemHandlerPlatformExternalStorageProviderFactory());
PlatformApi.INSTANCE.addExternalStorageProviderFactory(
- new FluidHandlerPlatformExternalStorageProviderFactory());
+ new FluidHandlerPlatformExternalStorageProviderFactory()
+ );
}
private void registerContent(final IEventBus eventBus) {
@@ -213,7 +218,8 @@ private void registerBlocks(final IEventBus eventBus) {
new ForgeRegistryCallback<>(blockRegistry),
ForgeDiskDriveBlockEntity::new,
(pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.NORMAL, pos, state),
- (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state)
+ (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state),
+ ForgeDiskInterfaceBlockEntity::new
);
blockRegistry.register(eventBus);
}
@@ -309,7 +315,8 @@ public BlockEntityType create(final BlockEntitySuppli
},
ForgeDiskDriveBlockEntity::new,
(pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.NORMAL, pos, state),
- (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state)
+ (pos, state) -> new ForgePortableGridBlockEntity(PortableGridType.CREATIVE, pos, state),
+ ForgeDiskInterfaceBlockEntity::new
);
blockEntityTypeRegistry.register(eventBus);
}
@@ -365,6 +372,25 @@ private void registerCapabilities(final RegisterCapabilitiesEvent event) {
(stack, ctx) -> new EnergyStorageAdapter(PortableGridBlockItem.createEnergyStorage(stack)),
Items.INSTANCE.getPortableGrid()
);
+ event.registerBlockEntity(
+ Capabilities.ItemHandler.BLOCK,
+ BlockEntities.INSTANCE.getDiskInterface(),
+ (be, side) -> {
+ final InvWrapper wrapper = new InvWrapper(be.getDiskInventory());
+ return new InsertExtractItemHandler(
+ new RangedWrapper(
+ wrapper,
+ 0,
+ AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS / 2
+ ),
+ new RangedWrapper(
+ wrapper,
+ AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS / 2,
+ AbstractDiskInterfaceBlockEntity.AMOUNT_OF_DISKS
+ )
+ );
+ }
+ );
}
private void registerSounds(final IEventBus eventBus) {
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProviderImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProviderImpl.java
index 17bb5bff8..16314ba54 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProviderImpl.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProviderImpl.java
@@ -2,11 +2,11 @@
import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap;
import com.refinedmods.refinedstorage2.platform.common.content.Blocks;
-import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridBlock;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.neoforge.client.model.generators.BlockModelProvider;
+import net.neoforged.neoforge.client.model.generators.CustomLoaderBuilder;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.MOD_ID;
@@ -48,14 +48,15 @@ public BlockModelProviderImpl(final PackOutput output, final ExistingFileHelper
protected void registerModels() {
registerCables();
registerControllers();
- registerGrids(Blocks.INSTANCE.getGrid(), "grid");
- registerGrids(Blocks.INSTANCE.getCraftingGrid(), "crafting_grid");
+ registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getGrid(), "grid", "");
+ registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getCraftingGrid(), "crafting_grid", "");
registerDetectors();
registerWirelessTransmitters();
registerNetworkReceivers();
registerNetworkTransmitters();
registerSecurityManagers();
registerRelays();
+ registerDiskInterfaces();
}
private void registerCables() {
@@ -84,19 +85,21 @@ private void registerControllers() {
});
}
- private void registerGrids(final BlockColorMap extends AbstractGridBlock, ?>, ?> blockMap, final String name) {
+ private void registerRightLeftBackFrontTopModel(final BlockColorMap, ?> blockMap,
+ final String name,
+ final String modelPrefix) {
blockMap.forEach((color, id, block) -> {
final ResourceLocation cutout = createIdentifier(BLOCK_PREFIX + "/" + name + "/cutouts/" + color.getName());
- registerEmissiveGrids(name, color.getName(), cutout);
+ registerRightLeftBackFrontTopModel(name, modelPrefix + color.getName(), cutout, EMISSIVE_NORTH_CUTOUT);
});
final ResourceLocation inactiveCutout = createIdentifier(BLOCK_PREFIX + "/" + name + "/cutouts/inactive");
- registerGrids(name, "inactive", inactiveCutout, NORTH_CUTOUT);
+ registerRightLeftBackFrontTopModel(name, "inactive", inactiveCutout, NORTH_CUTOUT);
}
- private void registerGrids(final String name,
- final String variantName,
- final ResourceLocation cutout,
- final ResourceLocation baseModel) {
+ private void registerRightLeftBackFrontTopModel(final String name,
+ final String variantName,
+ final ResourceLocation cutout,
+ final ResourceLocation baseModel) {
final ResourceLocation right = createIdentifier(BLOCK_PREFIX + "/" + name + "/right");
final ResourceLocation left = createIdentifier(BLOCK_PREFIX + "/" + name + "/left");
final ResourceLocation back = createIdentifier(BLOCK_PREFIX + "/" + name + "/back");
@@ -113,10 +116,6 @@ private void registerGrids(final String name,
.texture(CUTOUT_TEXTURE, cutout);
}
- private void registerEmissiveGrids(final String name, final String variantName, final ResourceLocation cutout) {
- registerGrids(name, variantName, cutout, EMISSIVE_NORTH_CUTOUT);
- }
-
private void registerDetectors() {
final ResourceLocation parent = createIdentifier("block/detector/powered");
final ResourceLocation side = createIdentifier("block/detector/side");
@@ -271,4 +270,17 @@ private void registerRelays() {
.texture(CUTOUT_UP, cutoutIn)
.texture(CUTOUT_DOWN, cutoutIn);
}
+
+ private void registerDiskInterfaces() {
+ registerRightLeftBackFrontTopModel(Blocks.INSTANCE.getDiskInterface(), "disk_interface", "base_");
+ Blocks.INSTANCE.getDiskInterface()
+ .forEach((color, id, block) -> getBuilder("block/disk_interface/" + color.getName())
+ .customLoader((blockModelBuilder, existingFileHelper) -> new CustomLoaderBuilder<>(
+ id,
+ blockModelBuilder,
+ existingFileHelper,
+ true
+ ) {
+ }).end());
+ }
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProviderImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProviderImpl.java
index 668da5c78..4d6098d07 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProviderImpl.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProviderImpl.java
@@ -6,17 +6,14 @@
import com.refinedmods.refinedstorage2.platform.common.controller.AbstractControllerBlock;
import com.refinedmods.refinedstorage2.platform.common.controller.ControllerEnergyType;
import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlock;
-import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridBlock;
import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock;
import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock;
-import com.refinedmods.refinedstorage2.platform.common.networking.RelayBlock;
-import com.refinedmods.refinedstorage2.platform.common.security.SecurityManagerBlock;
+import com.refinedmods.refinedstorage2.platform.common.support.AbstractActiveColoredDirectionalBlock;
import com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.direction.DefaultDirectionType;
import com.refinedmods.refinedstorage2.platform.common.support.direction.HorizontalDirectionType;
-import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlock;
import java.util.EnumMap;
import java.util.Map;
@@ -73,6 +70,7 @@ protected void registerStatesAndModels() {
registerNetworkTransmitters();
registerSecurityManagers();
registerRelays();
+ registerDiskInterfaces();
}
private void registerCables() {
@@ -154,32 +152,18 @@ private static void addDirectionalRotation(
}
private void registerGrids() {
- Blocks.INSTANCE.getGrid().forEach((color, id, block) -> configureGridVariants(color, block, "grid"));
- Blocks.INSTANCE.getCraftingGrid().forEach((color, id, block) -> configureGridVariants(
+ Blocks.INSTANCE.getGrid().forEach((color, id, block) -> configureActiveColoredDirectionalBlock(
+ color,
+ block,
+ "grid"
+ ));
+ Blocks.INSTANCE.getCraftingGrid().forEach((color, id, block) -> configureActiveColoredDirectionalBlock(
color,
block,
"crafting_grid"
));
}
- private void configureGridVariants(final DyeColor color,
- final Supplier extends AbstractGridBlock, ?>> block,
- final String name) {
- final ModelFile inactive = modelFile(createIdentifier(BLOCK_PREFIX + "/" + name + "/inactive"));
- final ModelFile active = modelFile(createIdentifier(BLOCK_PREFIX + "/" + name + "/" + color.getName()));
- final var builder = getVariantBuilder(block.get());
- builder.forAllStates(blockState -> {
- final ConfiguredModel.Builder> model = ConfiguredModel.builder();
- if (Boolean.TRUE.equals(blockState.getValue(AbstractGridBlock.ACTIVE))) {
- model.modelFile(active);
- } else {
- model.modelFile(inactive);
- }
- addRotationFrontFacingNorth(model, blockState.getValue(BiDirectionType.INSTANCE.getProperty()));
- return model.build();
- });
- }
-
private void registerControllers() {
Blocks.INSTANCE.getController().forEach((color, id, block) -> configureControllerVariants(color, block));
Blocks.INSTANCE.getCreativeController().forEach(
@@ -226,7 +210,7 @@ private void registerWirelessTransmitters() {
final var builder = getVariantBuilder(block.get());
builder.forAllStates(blockState -> {
final ConfiguredModel.Builder> model = ConfiguredModel.builder();
- if (Boolean.TRUE.equals(blockState.getValue(WirelessTransmitterBlock.ACTIVE))) {
+ if (Boolean.TRUE.equals(blockState.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE))) {
model.modelFile(modelFile(createIdentifier("block/wireless_transmitter/" + color.getName())));
} else {
model.modelFile(inactive);
@@ -315,7 +299,7 @@ private void registerSecurityManagers() {
final var builder = getVariantBuilder(block.get());
builder.forAllStates(blockState -> {
final ConfiguredModel.Builder> model = ConfiguredModel.builder();
- if (Boolean.TRUE.equals(blockState.getValue(SecurityManagerBlock.ACTIVE))) {
+ if (Boolean.TRUE.equals(blockState.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE))) {
model.modelFile(active);
} else {
model.modelFile(inactive);
@@ -336,7 +320,7 @@ private void registerRelays() {
final var builder = getVariantBuilder(block.get());
builder.forAllStates(blockState -> {
final ConfiguredModel.Builder> model = ConfiguredModel.builder();
- if (Boolean.TRUE.equals(blockState.getValue(RelayBlock.ACTIVE))) {
+ if (Boolean.TRUE.equals(blockState.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE))) {
model.modelFile(active);
} else {
model.modelFile(inactive);
@@ -354,6 +338,36 @@ private void registerRelays() {
});
}
+ private void registerDiskInterfaces() {
+ Blocks.INSTANCE.getDiskInterface().forEach((color, id, block) -> {
+ final var builder = getVariantBuilder(block.get());
+ builder.addModels(
+ builder.partialState(),
+ ConfiguredModel.builder().modelFile(
+ modelFile(createIdentifier("block/disk_interface/" + color.getName()))
+ ).build()
+ );
+ });
+ }
+
+ private void configureActiveColoredDirectionalBlock(final DyeColor color,
+ final Supplier extends Block> block,
+ final String name) {
+ final ModelFile inactive = modelFile(createIdentifier(BLOCK_PREFIX + "/" + name + "/inactive"));
+ final ModelFile active = modelFile(createIdentifier(BLOCK_PREFIX + "/" + name + "/" + color.getName()));
+ final var builder = getVariantBuilder(block.get());
+ builder.forAllStates(blockState -> {
+ final ConfiguredModel.Builder> model = ConfiguredModel.builder();
+ if (Boolean.TRUE.equals(blockState.getValue(AbstractActiveColoredDirectionalBlock.ACTIVE))) {
+ model.modelFile(active);
+ } else {
+ model.modelFile(inactive);
+ }
+ addRotationFrontFacingNorth(model, blockState.getValue(BiDirectionType.INSTANCE.getProperty()));
+ return model.build();
+ });
+ }
+
private void addRotation(final ConfiguredModel.Builder> model, final Direction direction) {
final int rotationX;
if (direction.getAxis() == Direction.Axis.Y) {
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/DataGenerators.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/DataGenerators.java
index 9ce374516..a4f33facc 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/DataGenerators.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/DataGenerators.java
@@ -40,33 +40,28 @@ public static void onGatherData(final GatherDataEvent dataEvent) {
private static void registerBlockStateProviders(final DataGenerator generator,
final ExistingFileHelper existingFileHelper) {
final PackGenerator mainPack = generator.getVanillaPack(true);
-
mainPack.addProvider(output -> new BlockStateProviderImpl(output, existingFileHelper));
}
private static void registerBlockModelProviders(final DataGenerator generator,
final ExistingFileHelper existingFileHelper) {
final PackGenerator mainPack = generator.getVanillaPack(true);
-
mainPack.addProvider(output -> new BlockModelProviderImpl(output, existingFileHelper));
}
private static void registerItemModelProviders(final DataGenerator generator,
final ExistingFileHelper existingFileHelper) {
final PackGenerator mainPack = generator.getVanillaPack(true);
-
mainPack.addProvider(output -> new ItemModelProviderImpl(output, existingFileHelper));
}
private static void registerLootTableProviders(final DataGenerator generator) {
final PackGenerator mainPack = generator.getVanillaPack(true);
-
mainPack.addProvider(LootTableProviderImpl::new);
}
private static void registerRecipeProviders(final DataGenerator generator) {
final PackGenerator mainPack = generator.getVanillaPack(true);
-
mainPack.addProvider(RecoloringRecipeProvider::new);
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProviderImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProviderImpl.java
index 9e48971b1..51f836178 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProviderImpl.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProviderImpl.java
@@ -15,6 +15,7 @@
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.DyeColor;
+import net.neoforged.neoforge.client.model.generators.CustomLoaderBuilder;
import net.neoforged.neoforge.client.model.generators.ItemModelProvider;
import net.neoforged.neoforge.client.model.generators.ModelFile;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
@@ -48,6 +49,7 @@ protected void registerModels() {
registerNetworkTransmitters();
registerSecurityManagers();
registerRelays();
+ registerDiskInterfaces();
}
private void registerCables() {
@@ -195,6 +197,18 @@ private void registerRelays() {
));
}
+ private void registerDiskInterfaces() {
+ final var blocks = Blocks.INSTANCE.getDiskInterface();
+ blocks.forEach((color, id, block) -> getBuilder(id.getPath()).customLoader(
+ (blockModelBuilder, existingFileHelper) -> new CustomLoaderBuilder<>(
+ id,
+ blockModelBuilder,
+ existingFileHelper,
+ true
+ ) {
+ }).end());
+ }
+
private ModelFile modelFile(final ResourceLocation location) {
return new ModelFile.ExistingModelFile(location, existingFileHelper);
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java
index f0d9df1ba..68ccaf7cf 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java
@@ -34,6 +34,7 @@ protected void generate() {
Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> dropSelf(block.get()));
Blocks.INSTANCE.getSecurityManager().forEach((color, id, block) -> dropSelf(block.get()));
Blocks.INSTANCE.getRelay().forEach((color, id, block) -> dropSelf(block.get()));
+ Blocks.INSTANCE.getDiskInterface().forEach((color, id, block) -> dropSelf(block.get()));
}
@Override
@@ -52,6 +53,7 @@ protected Iterable getKnownBlocks() {
blocks.addAll(Blocks.INSTANCE.getNetworkTransmitter().values());
blocks.addAll(Blocks.INSTANCE.getSecurityManager().values());
blocks.addAll(Blocks.INSTANCE.getRelay().values());
+ blocks.addAll(Blocks.INSTANCE.getDiskInterface().values());
return blocks;
}
}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java
index 55386a36a..5049b81da 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java
@@ -68,6 +68,9 @@ protected void buildRecipes(final RecipeOutput output) {
Blocks.INSTANCE.getRelay().forEach((color, id, block) ->
recipe(Tags.RELAYS, block.get().asItem(), color)
.save(output, recipeId(color, "relay")));
+ Blocks.INSTANCE.getDiskInterface().forEach((color, id, block) ->
+ recipe(Tags.DISK_INTERFACES, block.get().asItem(), color)
+ .save(output, recipeId(color, "disk_interface")));
}
private ResourceLocation recipeId(final DyeColor color, final String suffix) {
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagsProviderImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagsProviderImpl.java
index 5aee00d63..254ce5918 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagsProviderImpl.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagsProviderImpl.java
@@ -27,6 +27,7 @@
import static com.refinedmods.refinedstorage2.platform.common.content.Tags.CREATIVE_CONTROLLERS;
import static com.refinedmods.refinedstorage2.platform.common.content.Tags.DESTRUCTORS;
import static com.refinedmods.refinedstorage2.platform.common.content.Tags.DETECTORS;
+import static com.refinedmods.refinedstorage2.platform.common.content.Tags.DISK_INTERFACES;
import static com.refinedmods.refinedstorage2.platform.common.content.Tags.EXPORTERS;
import static com.refinedmods.refinedstorage2.platform.common.content.Tags.EXTERNAL_STORAGES;
import static com.refinedmods.refinedstorage2.platform.common.content.Tags.FLUID_STORAGE_DISKS;
@@ -120,6 +121,10 @@ protected void addTags(final HolderLookup.Provider provider) {
Blocks.INSTANCE.getRelay().values().stream()
.map(block -> (Supplier
- ) block::asItem)
.toList());
+ addAllToTag(DISK_INTERFACES,
+ Blocks.INSTANCE.getDiskInterface().values().stream()
+ .map(block -> (Supplier
- ) block::asItem)
+ .toList());
}
private void addAllToTag(final TagKey
- t, final Collection> items) {
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/DiskContainerItemOverrides.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/DiskContainerItemOverrides.java
new file mode 100644
index 000000000..f08602694
--- /dev/null
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/DiskContainerItemOverrides.java
@@ -0,0 +1,75 @@
+package com.refinedmods.refinedstorage2.platform.forge.storage;
+
+import com.refinedmods.refinedstorage2.api.storage.StorageState;
+import com.refinedmods.refinedstorage2.platform.common.storage.AbstractDiskContainerBlockEntity;
+import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
+import com.refinedmods.refinedstorage2.platform.forge.support.render.ItemBakedModel;
+
+import java.util.List;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import javax.annotation.Nullable;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import net.minecraft.client.multiplayer.ClientLevel;
+import net.minecraft.client.renderer.block.model.BakedQuad;
+import net.minecraft.client.renderer.block.model.ItemOverrides;
+import net.minecraft.client.resources.model.BakedModel;
+import net.minecraft.core.Direction;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.world.entity.LivingEntity;
+import net.minecraft.world.item.BlockItem;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
+import org.joml.Vector3f;
+
+public class DiskContainerItemOverrides extends ItemOverrides {
+ private final LoadingCache cache;
+ private final BakedModel originalModel;
+ private final Vector3f[] diskTranslations;
+ private final Function cacheKeyFactory;
+
+ public DiskContainerItemOverrides(final LoadingCache> blockCache,
+ final BakedModel originalModel,
+ final Vector3f[] diskTranslations,
+ final Function cacheKeyFactory,
+ final BiFunction cacheKeySideFactory) {
+ this.cache = CacheBuilder.newBuilder().build(CacheLoader.from(cacheKey -> new ItemBakedModel(
+ originalModel,
+ blockCache.getUnchecked(cacheKey),
+ Map.of(
+ Direction.NORTH, blockCache.getUnchecked(cacheKeySideFactory.apply(cacheKey, Direction.NORTH)),
+ Direction.EAST, blockCache.getUnchecked(cacheKeySideFactory.apply(cacheKey, Direction.EAST)),
+ Direction.SOUTH, blockCache.getUnchecked(cacheKeySideFactory.apply(cacheKey, Direction.SOUTH)),
+ Direction.WEST, blockCache.getUnchecked(cacheKeySideFactory.apply(cacheKey, Direction.WEST)),
+ Direction.UP, blockCache.getUnchecked(cacheKeySideFactory.apply(cacheKey, Direction.UP)),
+ Direction.DOWN, blockCache.getUnchecked(cacheKeySideFactory.apply(cacheKey, Direction.DOWN))
+ )
+ )));
+ this.originalModel = originalModel;
+ this.diskTranslations = diskTranslations;
+ this.cacheKeyFactory = cacheKeyFactory;
+ }
+
+ @Nullable
+ @Override
+ public BakedModel resolve(final BakedModel bakedModel,
+ final ItemStack stack,
+ @Nullable final ClientLevel level,
+ @Nullable final LivingEntity entity,
+ final int seed) {
+ final CompoundTag tag = BlockItem.getBlockEntityData(stack);
+ if (tag == null) {
+ return originalModel.getOverrides().resolve(bakedModel, stack, level, entity, seed);
+ }
+ final Disk[] disks = new Disk[diskTranslations.length];
+ for (int i = 0; i < diskTranslations.length; ++i) {
+ final Item diskItem = AbstractDiskContainerBlockEntity.getDisk(tag, i);
+ disks[i] = new Disk(diskItem, diskItem == null ? StorageState.NONE : StorageState.INACTIVE);
+ }
+ return cache.getUnchecked(cacheKeyFactory.apply(disks));
+ }
+}
diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java
index 9b5f8e191..89fd3bb60 100644
--- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java
+++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java
@@ -2,18 +2,16 @@
import com.refinedmods.refinedstorage2.api.storage.StorageState;
import com.refinedmods.refinedstorage2.platform.common.storage.Disk;
-import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity;
import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveBlock;
import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection;
+import com.refinedmods.refinedstorage2.platform.forge.storage.DiskContainerItemOverrides;
import com.refinedmods.refinedstorage2.platform.forge.support.render.DiskModelBaker;
-import com.refinedmods.refinedstorage2.platform.forge.support.render.ItemBakedModel;
import com.refinedmods.refinedstorage2.platform.forge.support.render.RotationTranslationModelBaker;
import com.refinedmods.refinedstorage2.platform.forge.support.render.TransformationBuilder;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
import javax.annotation.Nullable;
@@ -21,18 +19,12 @@
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.mojang.math.Transformation;
-import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemOverrides;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.Direction;
-import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.RandomSource;
-import net.minecraft.world.entity.LivingEntity;
-import net.minecraft.world.item.BlockItem;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.neoforged.neoforge.client.model.BakedModelWrapper;
import net.neoforged.neoforge.client.model.data.ModelData;
@@ -40,7 +32,7 @@
class DiskDriveBakedModel extends BakedModelWrapper