diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b229e26..1d0114b93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,26 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [v2.0.0-milestone.3.2] - 2023-11-03 + +### Added + +- Configuration Card. It copies device configurations and can transfer upgrades. +- Network Receiver +- Network Card +- Network Transmitter + +### Changed + +- The Network Transmitter now goes into an "errored" state if there is no connection (anymore) with the Network Receiver (due to chunk unloading for example). +- The Network Transmitter will actively try to reconnect with the Network Receiver if connection is lost. + +### Fixed + +- Inactive Wireless Transmitter model being emissive. +- Unneeded network graph updating after placing a network device. +- Cable blocks not updating connections properly when using wrench. + ## [2.0.0-milestone.3.1] - 2023-10-30 ### Added @@ -477,7 +497,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.1...HEAD +[Unreleased]: https://github.com/refinedmods/refinedstorage2/compare/vv2.0.0-milestone.3.2...HEAD + +[v2.0.0-milestone.3.2]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.1...vv2.0.0-milestone.3.2 [2.0.0-milestone.3.1]: https://github.com/refinedmods/refinedstorage2/compare/v2.0.0-milestone.3.0...v2.0.0-milestone.3.1 diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/component/GraphNetworkComponent.java b/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/component/GraphNetworkComponent.java new file mode 100644 index 000000000..3fd9c1071 --- /dev/null +++ b/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/component/GraphNetworkComponent.java @@ -0,0 +1,38 @@ +package com.refinedmods.refinedstorage2.api.network.component; + +import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; + +import java.util.Set; +import javax.annotation.Nullable; + +import org.apiguardian.api.API; + +/** + * Responsible for managing the connected network nodes in a network. + */ +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.2") +public interface GraphNetworkComponent extends NetworkComponent { + /** + * @return all the containers currently present in this graph + */ + Set getContainers(); + + /** + * Retrieves containers by container type. + * It can be queried by exact class type or by interface type. + * + * @param clazz the container class type + * @param the container class type + * @return the containers matching the type + */ + Set getContainers(Class clazz); + + /** + * Retrieves a container by key, defined in {@link NetworkNodeContainer#createKey()}. + * + * @param key the key + * @return the container, or null if not found + */ + @Nullable + NetworkNodeContainer getContainer(Object key); +} diff --git a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java b/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java index e3302fb26..3f7aaf65d 100644 --- a/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java +++ b/refinedstorage2-network-api/src/main/java/com/refinedmods/refinedstorage2/api/network/node/container/NetworkNodeContainer.java @@ -2,6 +2,8 @@ import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; +import javax.annotation.Nullable; + import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.1.0") @@ -9,6 +11,22 @@ public interface NetworkNodeContainer { NetworkNode getNode(); + /** + * If this container needs to be indexed by the network graph, so it can be queried quickly (by key), + * you can return a key here. + * The key must be kept stable, and must stay the same for the lifetime of the container. + * If it changes after adding it into the graph, the container would not be removed from the key index when the + * container is removed! + * The container can be queried by + * {@link com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent#getContainer(Object)}. + * + * @return the key, or null if indexing is not required + */ + @Nullable + default Object createKey() { + return null; + } + /** * The container priority determines the order in which the remainder containers as the result of a network split * are re-initialized with a new network. 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 96ebf89ec..122c7e57c 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 @@ -3,10 +3,11 @@ import com.refinedmods.refinedstorage2.api.core.component.ComponentMapFactory; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.component.NetworkComponent; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.network.impl.component.EnergyNetworkComponentImpl; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponentImpl; import com.refinedmods.refinedstorage2.api.network.impl.component.StorageNetworkComponentImpl; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelImpl; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; @@ -26,7 +27,7 @@ public final class NetworkTestFixtures { ); NETWORK_COMPONENT_MAP_FACTORY.addFactory( GraphNetworkComponent.class, - GraphNetworkComponent::new + GraphNetworkComponentImpl::new ); NETWORK_COMPONENT_MAP_FACTORY.addFactory( StorageNetworkComponent.class, 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 c7cb59f11..fdc23d6d2 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 @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; 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; diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java index 054282a8f..3d7859e02 100644 --- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java +++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/NetworkBuilderImpl.java @@ -5,7 +5,7 @@ import com.refinedmods.refinedstorage2.api.network.Connections; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.NetworkBuilder; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentImpl.java similarity index 64% rename from refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java rename to refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentImpl.java index 18bda8c72..9ce369dc1 100644 --- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java +++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentImpl.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.api.network.impl.component; import com.refinedmods.refinedstorage2.api.network.Network; -import com.refinedmods.refinedstorage2.api.network.component.NetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import java.util.Collections; @@ -9,28 +9,38 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import javax.annotation.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class GraphNetworkComponent implements NetworkComponent { - private static final Logger LOGGER = LoggerFactory.getLogger(GraphNetworkComponent.class); +public class GraphNetworkComponentImpl implements GraphNetworkComponent { + private static final Logger LOGGER = LoggerFactory.getLogger(GraphNetworkComponentImpl.class); private final Network network; private final Set containers = new HashSet<>(); - private final Map, Set> containerIndex = new HashMap<>(); + private final Map, Set> byClassIndex = new HashMap<>(); + private final Map byKeyIndex = new HashMap<>(); - public GraphNetworkComponent(final Network network) { + public GraphNetworkComponentImpl(final Network network) { this.network = network; } + @Override public Set getContainers() { return Collections.unmodifiableSet(containers); } + @Override @SuppressWarnings("unchecked") public Set getContainers(final Class clazz) { - return (Set) Collections.unmodifiableSet(containerIndex.getOrDefault(clazz, Collections.emptySet())); + return (Set) Collections.unmodifiableSet(byClassIndex.getOrDefault(clazz, Collections.emptySet())); + } + + @Override + @Nullable + public NetworkNodeContainer getContainer(final Object key) { + return byKeyIndex.get(key); } @Override @@ -44,10 +54,14 @@ public void onContainerAdded(final NetworkNodeContainer container) { public void onContainerRemoved(final NetworkNodeContainer container) { LOGGER.debug("Container {} removed from network {}", container, network.hashCode()); containers.remove(container); - deleteFromIndex(container); + removeFromIndex(container); } private void addToIndex(final NetworkNodeContainer container) { + final Object key = container.createKey(); + if (key != null) { + byKeyIndex.put(key, container); + } final Class clazz = container.getClass(); addToIndex(clazz, container); for (final Class iface : clazz.getInterfaces()) { @@ -56,23 +70,27 @@ private void addToIndex(final NetworkNodeContainer container) { } private void addToIndex(final Class indexKey, final NetworkNodeContainer container) { - containerIndex.computeIfAbsent(indexKey, k -> new HashSet<>()).add(container); + byClassIndex.computeIfAbsent(indexKey, k -> new HashSet<>()).add(container); } - private void deleteFromIndex(final NetworkNodeContainer container) { + private void removeFromIndex(final NetworkNodeContainer container) { + final Object key = container.createKey(); + if (key != null) { + byKeyIndex.remove(key); + } final Class clazz = container.getClass(); - deleteFromIndex(clazz, container); + removeFromIndex(clazz, container); for (final Class iface : clazz.getInterfaces()) { - deleteFromIndex(iface, container); + removeFromIndex(iface, container); } } - private void deleteFromIndex(final Class indexKey, final NetworkNodeContainer container) { - final Set index = containerIndex.get(indexKey); + private void removeFromIndex(final Class indexKey, final NetworkNodeContainer container) { + final Set index = byClassIndex.get(indexKey); if (index != null) { index.remove(container); if (index.isEmpty()) { - containerIndex.remove(indexKey); + byClassIndex.remove(indexKey); } } } diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java index d770b8684..34787628b 100644 --- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/AbstractNetworkBuilderImplTest.java @@ -10,12 +10,14 @@ import java.util.ArrayList; import java.util.List; -import java.util.Objects; import java.util.Set; import java.util.function.Function; +import javax.annotation.Nullable; import org.junit.jupiter.api.BeforeEach; +import static java.util.Objects.requireNonNull; + abstract class AbstractNetworkBuilderImplTest { protected NetworkBuilder sut; private ComponentMapFactory componentMapFactory; @@ -30,10 +32,8 @@ void setUp() { sut = new NetworkBuilderImpl(new NetworkFactory(componentMapFactory)); } - protected void clearTracking(final Network network) { - Objects.requireNonNull(network) - .getComponent(InterceptingNetworkComponent.class) - .clear(); + protected void clearTracking(@Nullable final Network network) { + requireNonNull(network).getComponent(InterceptingNetworkComponent.class).clear(); } protected NetworkNodeContainer createContainerWithNetwork() { diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java index 3b43bb65b..76f4d1e9a 100644 --- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/InitializeNetworkBuilderImplTest.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.api.network.impl; import com.refinedmods.refinedstorage2.api.network.Network; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import org.junit.jupiter.api.Test; @@ -50,7 +50,8 @@ void shouldFormNetwork() { assertThat(unrelatedContainer.getNode().getNetwork()) .isNotNull() .isNotEqualTo(container.getNode().getNetwork()); - assertThat(unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) + assertThat( + unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) .containsExactly(unrelatedContainer); } @@ -85,7 +86,8 @@ void shouldJoinExistingNetwork() { assertThat(existingContainer1.getNode().getNetwork()).isEqualTo(expectedNetwork); assertThat(existingContainer2.getNode().getNetwork()).isEqualTo(expectedNetwork); assertThat(newContainer.getNode().getNetwork()).isEqualTo(expectedNetwork); - assertThat(expectedNetwork.getComponent(GraphNetworkComponent.class).getContainers()).containsExactlyInAnyOrder( + assertThat( + expectedNetwork.getComponent(GraphNetworkComponent.class).getContainers()).containsExactlyInAnyOrder( existingContainer1, existingContainer2, newContainer @@ -101,7 +103,8 @@ void shouldJoinExistingNetwork() { assertThat(getNetworkMerges(expectedNetwork)).isEmpty(); assertThat(unrelatedContainer.getNode().getNetwork()).isNotNull().isNotEqualTo(expectedNetwork); - assertThat(unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) + assertThat( + unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) .containsExactly(unrelatedContainer); } @@ -140,7 +143,8 @@ void shouldMergeWithExistingNetworks() { assertThat(existingContainer2.getNode().getNetwork()).isEqualTo(expectedNetwork); assertThat(existingContainer0.getNode().getNetwork()).isEqualTo(expectedNetwork); assertThat(newContainer.getNode().getNetwork()).isEqualTo(expectedNetwork); - assertThat(expectedNetwork.getComponent(GraphNetworkComponent.class).getContainers()).containsExactlyInAnyOrder( + assertThat( + expectedNetwork.getComponent(GraphNetworkComponent.class).getContainers()).containsExactlyInAnyOrder( existingContainer1, existingContainer2, existingContainer0, @@ -154,7 +158,8 @@ void shouldMergeWithExistingNetworks() { assertThat(getNetworkMerges(expectedNetwork)).isEmpty(); assertThat(unrelatedContainer.getNode().getNetwork()).isNotNull().isNotEqualTo(expectedNetwork); - assertThat(unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) + assertThat( + unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) .containsExactly(unrelatedContainer); } @@ -190,7 +195,8 @@ void shouldFormNetworkIfThereAreNeighborsWithoutNetwork() { assertThat(container2.getNode().getNetwork()).isEqualTo(expectedNetwork); assertThat(container3.getNode().getNetwork()).isEqualTo(expectedNetwork); - assertThat(expectedNetwork.getComponent(GraphNetworkComponent.class).getContainers()).containsExactlyInAnyOrder( + assertThat( + expectedNetwork.getComponent(GraphNetworkComponent.class).getContainers()).containsExactlyInAnyOrder( container1, container2, container3 @@ -202,7 +208,8 @@ void shouldFormNetworkIfThereAreNeighborsWithoutNetwork() { assertThat(getAmountRemoved(expectedNetwork)).isZero(); assertThat(unrelatedContainer.getNode().getNetwork()).isNotNull().isNotEqualTo(expectedNetwork); - assertThat(unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) + assertThat( + unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) .containsExactly(unrelatedContainer); } } diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java index d5fd697cf..16aeb3b0d 100644 --- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/RemoveNetworkBuilderImplTest.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.api.network.impl; import com.refinedmods.refinedstorage2.api.network.Network; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import java.util.List; @@ -235,7 +235,8 @@ void shouldRemoveNetwork() { assertThat(container.getNode().getNetwork()).isNull(); assertThat(unrelatedContainer.getNode().getNetwork()).isNotNull(); - assertThat(unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) + assertThat( + unrelatedContainer.getNode().getNetwork().getComponent(GraphNetworkComponent.class).getContainers()) .containsExactlyInAnyOrder(unrelatedContainer); assertThat(network).isNotNull(); diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java index 403d91033..deba09825 100644 --- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/UpdateNetworkBuilderImplTest.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.api.network.impl; import com.refinedmods.refinedstorage2.api.network.Network; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import java.util.Set; diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentImplTest.java similarity index 71% rename from refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java rename to refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentImplTest.java index dc9b2ab61..901e04bb8 100644 --- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentImplTest.java @@ -1,5 +1,6 @@ package com.refinedmods.refinedstorage2.api.network.impl.component; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.impl.NetworkImpl; import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; @@ -13,12 +14,12 @@ import static org.assertj.core.api.Assertions.assertThat; -class GraphNetworkComponentTest { +class GraphNetworkComponentImplTest { GraphNetworkComponent sut; @BeforeEach void setUp() { - sut = new GraphNetworkComponent(new NetworkImpl(NetworkTestFixtures.NETWORK_COMPONENT_MAP_FACTORY)); + sut = new GraphNetworkComponentImpl(new NetworkImpl(NetworkTestFixtures.NETWORK_COMPONENT_MAP_FACTORY)); } @Test @@ -51,7 +52,7 @@ void shouldRemoveContainer() { } @Test - void shouldNotRetrieveContainersByClassThatDontExist() { + void shouldNotRetrieveContainersByClassThatDoesNotExist() { // Act final Set containers = sut.getContainers(NetworkNodeContainer1.class); @@ -191,6 +192,98 @@ void shouldRemoveMultipleContainersAndRetrieveByInterface() { assertThat(containers).isEmpty(); } + @Test + void shouldNotRetrieveContainerByIndexThatDoesNotExist() { + // Arrange + sut.onContainerAdded(() -> new SimpleNetworkNode(0)); + + // Act + final NetworkNodeContainer container = sut.getContainer("does not exist"); + + // Assert + assertThat(container).isNull(); + } + + @Test + void shouldRetrieveContainerByIndex() { + // Arrange + final NetworkNodeContainer container1 = new NetworkNodeContainer() { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + + @Override + public Object createKey() { + return "key0"; + } + }; + + final NetworkNodeContainer container2 = new NetworkNodeContainer() { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + + @Override + public Object createKey() { + return "key1"; + } + }; + + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Act + final NetworkNodeContainer foundContainer1 = sut.getContainer("key0"); + final NetworkNodeContainer foundContainer2 = sut.getContainer("key1"); + + // Assert + assertThat(foundContainer1).isEqualTo(container1); + assertThat(foundContainer2).isEqualTo(container2); + } + + @Test + void shouldRemoveContainerWithKey() { + // Arrange + final NetworkNodeContainer container1 = new NetworkNodeContainer() { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + + @Override + public Object createKey() { + return "key0"; + } + }; + + final NetworkNodeContainer container2 = new NetworkNodeContainer() { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + + @Override + public Object createKey() { + return "key1"; + } + }; + + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container2); + + // Assert + final NetworkNodeContainer foundContainer1 = sut.getContainer("key0"); + final NetworkNodeContainer foundContainer2 = sut.getContainer("key1"); + + assertThat(foundContainer1).isEqualTo(container1); + assertThat(foundContainer2).isNull(); + } + private static class NetworkNodeContainer1 implements NetworkNodeContainer, BothImplements { @Override public NetworkNode getNode() { diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java index 5387f40f7..ee0c849dc 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java @@ -5,41 +5,41 @@ import com.refinedmods.refinedstorage2.api.network.component.NetworkComponent; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHints; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.item.EnergyItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItemHelper; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import java.util.Collection; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java index b4f895589..b934fa5f6 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java @@ -5,41 +5,41 @@ import com.refinedmods.refinedstorage2.api.network.component.NetworkComponent; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHints; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.item.EnergyItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItemHelper; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import java.util.Collection; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java deleted file mode 100644 index 71e76a806..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/configurationcard/ConfigurationCardTarget.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/configurationcard/ConfigurationCardTarget.java new file mode 100644 index 000000000..16500540f --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/configurationcard/ConfigurationCardTarget.java @@ -0,0 +1,21 @@ +package com.refinedmods.refinedstorage2.platform.api.configurationcard; + +import java.util.List; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.Item; +import org.apiguardian.api.API; + +/** + * Implement this on a block entity that supports the configuration card. + */ +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.2") +public interface ConfigurationCardTarget { + void writeConfiguration(CompoundTag tag); + + void readConfiguration(CompoundTag tag); + + List getUpgradeItems(); + + boolean addUpgradeItem(Item upgradeItem); +} diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/configurationcard/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/configurationcard/package-info.java new file mode 100644 index 000000000..096af66d9 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/configurationcard/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.configurationcard; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/ConstructorStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/ConstructorStrategy.java similarity index 84% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/ConstructorStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/ConstructorStrategy.java index d41b77c5e..2e51e0308 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/ConstructorStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/ConstructorStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.constructor; +package com.refinedmods.refinedstorage2.platform.api.constructordestructor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/ConstructorStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/ConstructorStrategyFactory.java similarity index 90% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/ConstructorStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/ConstructorStrategyFactory.java index 1e607d1d8..221bab6da 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/ConstructorStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/ConstructorStrategyFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.constructor; +package com.refinedmods.refinedstorage2.platform.api.constructordestructor; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/DestructorStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/DestructorStrategy.java similarity index 92% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/DestructorStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/DestructorStrategy.java index 773d33755..719dec17d 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/DestructorStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/DestructorStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.destructor; +package com.refinedmods.refinedstorage2.platform.api.constructordestructor; import com.refinedmods.refinedstorage2.api.core.filter.Filter; import com.refinedmods.refinedstorage2.api.network.Network; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/DestructorStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/DestructorStrategyFactory.java similarity index 90% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/DestructorStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/DestructorStrategyFactory.java index 95fdcb71a..bf1b7eeb3 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/DestructorStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/DestructorStrategyFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.destructor; +package com.refinedmods.refinedstorage2.platform.api.constructordestructor; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/recipemod/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/package-info.java similarity index 73% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/recipemod/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/package-info.java index daf4f55f7..cdb81c84a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/recipemod/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/constructordestructor/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.integration.recipemod; +package com.refinedmods.refinedstorage2.platform.api.constructordestructor; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/AmountOverride.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/AmountOverride.java similarity index 91% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/AmountOverride.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/AmountOverride.java index 1da91391b..12cf11a6f 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/AmountOverride.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/AmountOverride.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.network.node.exporter; +package com.refinedmods.refinedstorage2.platform.api.exporter; import java.util.function.LongSupplier; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/ExporterTransferStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/ExporterTransferStrategyFactory.java similarity index 89% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/ExporterTransferStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/ExporterTransferStrategyFactory.java index 1a39ef015..153e5f9f4 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/ExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/ExporterTransferStrategyFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.network.node.exporter; +package com.refinedmods.refinedstorage2.platform.api.exporter; import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/registry/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/package-info.java similarity index 76% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/registry/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/package-info.java index 1a3cac5c8..8c0e409db 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/registry/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/exporter/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.registry; +package com.refinedmods.refinedstorage2.platform.api.exporter; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/Grid.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/Grid.java index 3248a1016..ac8540118 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/Grid.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/Grid.java @@ -6,8 +6,8 @@ import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.api.storage.TrackedResourceAmount; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import java.util.List; @@ -21,7 +21,7 @@ public interface Grid { Storage getItemStorage(); - boolean isActive(); + boolean isGridActive(); List> getResources(StorageChannelType type, Class actorType); diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridExtractionStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridExtractionStrategy.java similarity index 87% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridExtractionStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridExtractionStrategy.java index e29436908..79531e4dc 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridExtractionStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridExtractionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridExtractionStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridExtractionStrategyFactory.java similarity index 74% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridExtractionStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridExtractionStrategyFactory.java index 877fb4f60..5ed2926fd 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridExtractionStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridExtractionStrategyFactory.java @@ -1,4 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; + +import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridInsertionStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridInsertionStrategy.java similarity index 82% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridInsertionStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridInsertionStrategy.java index 0d5d01618..ef606ff6f 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridInsertionStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridInsertionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridInsertionStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridInsertionStrategyFactory.java similarity index 73% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridInsertionStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridInsertionStrategyFactory.java index 2bcf1db77..05594da03 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridInsertionStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridInsertionStrategyFactory.java @@ -1,4 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; + +import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridScrollingStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridScrollingStrategy.java similarity index 74% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridScrollingStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridScrollingStrategy.java index fdd5125f3..2648e9424 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridScrollingStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridScrollingStrategy.java @@ -1,5 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; +import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import org.apiguardian.api.API; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridScrollingStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridScrollingStrategyFactory.java similarity index 73% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridScrollingStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridScrollingStrategyFactory.java index 2ce809ea7..e3638940c 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/GridScrollingStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/GridScrollingStrategyFactory.java @@ -1,4 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; + +import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/package-info.java new file mode 100644 index 000000000..ec1631346 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.grid.strategy; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/AbstractPlatformGridResource.java similarity index 97% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/AbstractPlatformGridResource.java index 2383f6e8b..1cdf4b95f 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/AbstractPlatformGridResource.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.view; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceAttributeKey; import com.refinedmods.refinedstorage2.api.grid.view.GridView; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/PlatformGridResource.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/PlatformGridResource.java similarity index 78% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/PlatformGridResource.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/PlatformGridResource.java index 92ef6a334..a469a88f8 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/PlatformGridResource.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/PlatformGridResource.java @@ -1,7 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.api.grid; +package com.refinedmods.refinedstorage2.platform.api.grid.view; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; +import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/package-info.java new file mode 100644 index 000000000..8303cec5a --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.grid.view; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/importer/ImporterTransferStrategyFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/importer/ImporterTransferStrategyFactory.java similarity index 79% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/importer/ImporterTransferStrategyFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/importer/ImporterTransferStrategyFactory.java index 60216d7c9..9f15f1da9 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/importer/ImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/importer/ImporterTransferStrategyFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.api.network.node.importer; +package com.refinedmods.refinedstorage2.platform.api.importer; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import net.minecraft.core.BlockPos; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/importer/package-info.java similarity index 76% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/importer/package-info.java index e897c25d5..33f2b92a9 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/importer/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.importer; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/package-info.java deleted file mode 100644 index 5d0ef7028..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.network.node.exporter; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/externalstorage/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/externalstorage/package-info.java deleted file mode 100644 index 1a8231b09..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/importer/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/importer/package-info.java deleted file mode 100644 index a5a4f0b8c..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.network.node.importer; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/package-info.java deleted file mode 100644 index 0ea893733..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.network.node; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/recipemod/IngredientConverter.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/recipemod/IngredientConverter.java similarity index 82% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/recipemod/IngredientConverter.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/recipemod/IngredientConverter.java index fe45490cb..53934e2a0 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/recipemod/IngredientConverter.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/recipemod/IngredientConverter.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.integration.recipemod; +package com.refinedmods.refinedstorage2.platform.api.recipemod; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/recipemod/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/recipemod/package-info.java new file mode 100644 index 000000000..5edfdcca5 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/recipemod/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.recipemod; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/package-info.java deleted file mode 100644 index 48d760595..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.resource.list; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/block/AbstractStorageContainerBlockItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java similarity index 93% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/block/AbstractStorageContainerBlockItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java index 928d8b643..438bee050 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/block/AbstractStorageContainerBlockItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerBlockItem.java @@ -1,8 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.api.item.block; +package com.refinedmods.refinedstorage2.platform.api.storage; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper; -import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import java.util.List; import java.util.UUID; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractStorageContainerItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerItem.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractStorageContainerItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerItem.java index 42109c34a..ea09277b1 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractStorageContainerItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/AbstractStorageContainerItem.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.storage; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.api.storage.TypedStorage; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/SerializableStorage.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/SerializableStorage.java index cc20fcdbf..688eddd8b 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/SerializableStorage.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/SerializableStorage.java @@ -1,7 +1,5 @@ package com.refinedmods.refinedstorage2.platform.api.storage; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; - import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.1.4") diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/StorageContainerItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java similarity index 79% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/StorageContainerItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java index eb894e919..dae2a1f27 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/StorageContainerItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItem.java @@ -1,8 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.storage; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.api.storage.TypedStorage; -import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/StorageContainerItemHelper.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java similarity index 92% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/StorageContainerItemHelper.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java index 4121a6b9b..c530fb5e5 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/StorageContainerItemHelper.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageContainerItemHelper.java @@ -1,8 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.storage; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; -import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/type/StorageType.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java similarity index 86% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/type/StorageType.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java index 1811cad1a..81091b40a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/type/StorageType.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/StorageType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.storage.type; +package com.refinedmods.refinedstorage2.platform.api.storage; import com.refinedmods.refinedstorage2.api.storage.Storage; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/channel/FuzzyStorageChannelImpl.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/channel/FuzzyStorageChannelImpl.java index 60fe60a32..a8a11086a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/channel/FuzzyStorageChannelImpl.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/channel/FuzzyStorageChannelImpl.java @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage2.platform.api.resource.list.FuzzyResourceList; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.list.FuzzyResourceList; import java.util.Collection; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/externalstorage/PlatformExternalStorageProviderFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java similarity index 88% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/externalstorage/PlatformExternalStorageProviderFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java index 42f37edd4..4ef0049f9 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/externalstorage/PlatformExternalStorageProviderFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/externalstorage/PlatformExternalStorageProviderFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.api.storage.externalstorage; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/externalstorage/package-info.java similarity index 72% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/externalstorage/package-info.java index 687287584..dbe45c708 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/constructor/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/externalstorage/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.blockentity.constructor; +package com.refinedmods.refinedstorage2.platform.api.storage.externalstorage; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/type/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/type/package-info.java deleted file mode 100644 index 49a60dc7c..000000000 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storage/type/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.storage.type; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/StorageMonitorExtractionStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/StorageMonitorExtractionStrategy.java similarity index 84% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/StorageMonitorExtractionStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/StorageMonitorExtractionStrategy.java index 519fd326a..595d6df0e 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/StorageMonitorExtractionStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/StorageMonitorExtractionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.api.storagemonitor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/StorageMonitorInsertionStrategy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/StorageMonitorInsertionStrategy.java similarity index 85% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/StorageMonitorInsertionStrategy.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/StorageMonitorInsertionStrategy.java index b2168b22c..624bfb67a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/StorageMonitorInsertionStrategy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/StorageMonitorInsertionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.api.storagemonitor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/package-info.java new file mode 100644 index 000000000..2c9aac42f --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/storagemonitor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.storagemonitor; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/util/AmountFormatting.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/AmountFormatting.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/util/AmountFormatting.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/AmountFormatting.java index 9d88e3f8f..3b9dabee7 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/util/AmountFormatting.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/AmountFormatting.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.util; +package com.refinedmods.refinedstorage2.platform.api.support; import java.math.RoundingMode; import java.text.DecimalFormat; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/HelpTooltipComponent.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/HelpTooltipComponent.java similarity index 88% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/HelpTooltipComponent.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/HelpTooltipComponent.java index 85a79cf66..9cbe3e7a2 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/HelpTooltipComponent.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/HelpTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support; import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.tooltip.TooltipComponent; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractEnergyBlockItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractEnergyBlockItem.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractEnergyBlockItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractEnergyBlockItem.java index 52870ecec..f89cf8afd 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractEnergyBlockItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractEnergyBlockItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.energy; import java.util.List; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractEnergyItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractEnergyItem.java similarity index 95% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractEnergyItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractEnergyItem.java index e4dbd9b95..98ec52e94 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractEnergyItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractEnergyItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.energy; import java.util.List; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractNetworkBoundEnergyItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java similarity index 88% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractNetworkBoundEnergyItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java index 28d0c49e2..16770c32c 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractNetworkBoundEnergyItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/AbstractNetworkBoundEnergyItem.java @@ -1,6 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.energy; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/EnergyBlockEntity.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyBlockEntity.java similarity index 85% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/EnergyBlockEntity.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyBlockEntity.java index a95e857de..c231e5006 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/EnergyBlockEntity.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity; +package com.refinedmods.refinedstorage2.platform.api.support.energy; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/EnergyItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyItem.java similarity index 88% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/EnergyItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyItem.java index fb7b3c7d8..6c0901f3a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/EnergyItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.energy; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/EnergyItemHelper.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyItemHelper.java similarity index 90% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/EnergyItemHelper.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyItemHelper.java index 7d7160f0f..e13ec3cfd 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/EnergyItemHelper.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/EnergyItemHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.energy; import java.util.List; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/package-info.java new file mode 100644 index 000000000..1fc4d620d --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.support.energy; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/AbstractNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java similarity index 68% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/AbstractNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java index c0c5ed9af..3de6c3be6 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/AbstractNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/AbstractNetworkNodeContainerBlockEntity.java @@ -1,19 +1,18 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity; +package com.refinedmods.refinedstorage2.platform.api.support.network; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; - -import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.world.level.Level; +import net.minecraft.core.GlobalPos; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import org.apiguardian.api.API; +import static java.util.Objects.requireNonNull; + @API(status = API.Status.STABLE, since = "2.0.0-milestone.1.2") public abstract class AbstractNetworkNodeContainerBlockEntity extends BlockEntity implements PlatformNetworkNodeContainer { @@ -48,28 +47,20 @@ public void setRemoved() { PlatformApi.INSTANCE.requestNetworkNodeRemoval(this, level); } - @Override - @SuppressWarnings("deprecation") - public void setBlockState(final BlockState newBlockState) { - super.setBlockState(newBlockState); - if (level == null || level.isClientSide || node.getNetwork() == null) { - return; - } - PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); - } - @Override public T getNode() { return node; } @Override - public boolean canPerformOutgoingConnection(final Direction direction) { - return true; + public void addOutgoingConnections(final ConnectionSink sink) { + for (final Direction direction : Direction.values()) { + sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); + } } @Override - public boolean canAcceptIncomingConnection(final Direction direction, final BlockState other) { + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { return true; } @@ -78,15 +69,9 @@ public BlockState getContainerBlockState() { return getBlockState(); } - @Nullable - @Override - public Level getContainerLevel() { - return getLevel(); - } - @Override - public BlockPos getContainerPosition() { - return getBlockPos(); + public GlobalPos getContainerPosition() { + return GlobalPos.of(requireNonNull(level).dimension(), worldPosition); } @Override diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java new file mode 100644 index 000000000..b8094e38f --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage2.platform.api.support.network; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.GlobalPos; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.2") +public interface ConnectionSink { + void tryConnect(GlobalPos pos); + + void tryConnectInSameDimension(BlockPos pos, Direction incomingDirection); +} diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/PlatformNetworkNodeContainer.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/PlatformNetworkNodeContainer.java similarity index 51% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/PlatformNetworkNodeContainer.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/PlatformNetworkNodeContainer.java index b16b61837..5ce90b0b2 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/network/node/PlatformNetworkNodeContainer.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/PlatformNetworkNodeContainer.java @@ -1,11 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.api.network.node; +package com.refinedmods.refinedstorage2.platform.api.support.network; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.GlobalPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; import org.apiguardian.api.API; @@ -13,32 +11,28 @@ @API(status = API.Status.STABLE, since = "2.0.0-milestone.2.1") public interface PlatformNetworkNodeContainer extends NetworkNodeContainer { /** - * Returns whether the already discovered node can perform an outgoing connection. - * Changes to this return value won't cause a rebuild of the network state. - * If the return value ever changes, call {@link + * Called when a node is about to be added into the network graph. + * Add outgoing connections here. + * If the outgoing connections ever change, call {@link * com.refinedmods.refinedstorage2.platform.api.PlatformApi#requestNetworkNodeUpdate(NetworkNodeContainer, Level)}. * - * @param direction the outgoing direction - * @return whether the node can perform an outgoing connection + * @param sink the sink that accepts outgoing connections */ - boolean canPerformOutgoingConnection(Direction direction); + void addOutgoingConnections(ConnectionSink sink); /** - * Returns whether the not yet discovered node can accept an incoming connection. + * Returns whether the (not yet discovered) node can accept an incoming connection. * Changes to this return value won't cause a rebuild of the network state. * If the return value ever changes, call {@link * com.refinedmods.refinedstorage2.platform.api.PlatformApi#requestNetworkNodeUpdate(NetworkNodeContainer, Level)}. * - * @param direction the incoming direction - * @param other the state wanting to connect + * @param incomingDirection the incoming direction + * @param connectingState the state wanting to connect * @return whether the node can accept an incoming connection */ - boolean canAcceptIncomingConnection(Direction direction, BlockState other); + boolean canAcceptIncomingConnection(Direction incomingDirection, BlockState connectingState); BlockState getContainerBlockState(); - @Nullable - Level getContainerLevel(); - - BlockPos getContainerPosition(); + GlobalPos getContainerPosition(); } diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/NetworkBoundItemHelper.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemHelper.java similarity index 91% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/NetworkBoundItemHelper.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemHelper.java index 9d08fad52..04221f338 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/NetworkBoundItemHelper.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/NetworkBoundItemSession.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemSession.java similarity index 80% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/NetworkBoundItemSession.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemSession.java index 4ecf4618a..65508a695 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/NetworkBoundItemSession.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/NetworkBoundItemSession.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import com.refinedmods.refinedstorage2.api.network.Network; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReference.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReference.java similarity index 85% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReference.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReference.java index c1f4541d7..2affc8478 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReference.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReference.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReferenceFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceFactory.java similarity index 74% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReferenceFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceFactory.java index d29200b50..3bd695536 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReferenceFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import net.minecraft.network.FriendlyByteBuf; import org.apiguardian.api.API; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReferenceProvider.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceProvider.java similarity index 80% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReferenceProvider.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceProvider.java index ebe5ede52..52bd50a69 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/SlotReferenceProvider.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/SlotReferenceProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; import java.util.List; import java.util.Set; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/package-info.java new file mode 100644 index 000000000..37fef92f0 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/bounditem/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.support.network.bounditem; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/package-info.java new file mode 100644 index 000000000..ae0088977 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.support.network; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/util/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/package-info.java similarity index 77% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/util/package-info.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/package-info.java index accc64647..03921a727 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/util/package-info.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.util; +package com.refinedmods.refinedstorage2.platform.api.support; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/registry/PlatformRegistry.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/registry/PlatformRegistry.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/registry/PlatformRegistry.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/registry/PlatformRegistry.java index 54f3e6745..1e179ce6e 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/registry/PlatformRegistry.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/registry/PlatformRegistry.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.registry; +package com.refinedmods.refinedstorage2.platform.api.support.registry; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/registry/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/registry/package-info.java new file mode 100644 index 000000000..14281e814 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/registry/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.support.registry; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/FluidResource.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FluidResource.java similarity index 97% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/FluidResource.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FluidResource.java index 41555465c..e71622db8 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/FluidResource.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FluidResource.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import com.refinedmods.refinedstorage2.api.core.CoreValidations; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/FuzzyModeNormalizer.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FuzzyModeNormalizer.java similarity index 69% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/FuzzyModeNormalizer.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FuzzyModeNormalizer.java index e868a00d0..eb6bbc642 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/FuzzyModeNormalizer.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FuzzyModeNormalizer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import org.apiguardian.api.API; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ItemResource.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ItemResource.java similarity index 97% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ItemResource.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ItemResource.java index b73ea051c..8fd372aae 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ItemResource.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ItemResource.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import com.refinedmods.refinedstorage2.api.core.CoreValidations; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceAmountTemplate.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceAmountTemplate.java similarity index 97% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceAmountTemplate.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceAmountTemplate.java index 0abf50b7c..b131d7d3a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceAmountTemplate.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceAmountTemplate.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainer.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceContainer.java similarity index 96% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainer.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceContainer.java index be85261a0..c9f65c5f8 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainer.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceContainer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainerType.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceContainerType.java similarity index 55% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainerType.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceContainerType.java index 83ed7a93f..b19ce7980 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceContainerType.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceContainerType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; public enum ResourceContainerType { FILTER, diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceFactory.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceFactory.java similarity index 81% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceFactory.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceFactory.java index 65230cb58..c1ac32c0c 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceFactory.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceFactory.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import java.util.Optional; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceRendering.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceRendering.java similarity index 91% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceRendering.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceRendering.java index 87bc86a42..f85937be1 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/ResourceRendering.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ResourceRendering.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import java.util.List; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceList.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceList.java similarity index 80% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceList.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceList.java index 9f7d436fe..e624bbf1b 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceList.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceList.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.api.resource.list; +package com.refinedmods.refinedstorage2.platform.api.support.resource.list; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FuzzyModeNormalizer; import java.util.Collection; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceListImpl.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceListImpl.java similarity index 93% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceListImpl.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceListImpl.java index 4e554edf3..a19a293aa 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceListImpl.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceListImpl.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.api.resource.list; +package com.refinedmods.refinedstorage2.platform.api.support.resource.list; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.resource.list.AbstractProxyResourceList; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; import com.refinedmods.refinedstorage2.api.resource.list.ResourceListOperationResult; -import com.refinedmods.refinedstorage2.platform.api.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FuzzyModeNormalizer; import java.util.Collection; import java.util.Collections; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/package-info.java new file mode 100644 index 000000000..0da3ef37c --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.support.resource.list; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/package-info.java new file mode 100644 index 000000000..9e1292653 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.support.resource; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractUpgradeItem.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/AbstractUpgradeItem.java similarity index 78% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractUpgradeItem.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/AbstractUpgradeItem.java index b5b6c73f5..db9032560 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/AbstractUpgradeItem.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/AbstractUpgradeItem.java @@ -1,8 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.item; - -import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeItem; -import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; -import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +package com.refinedmods.refinedstorage2.platform.api.upgrade; import java.util.Optional; import java.util.Set; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/WirelessTransmitter.java similarity index 80% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/WirelessTransmitter.java index d405201a5..6cacdc33d 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/WirelessTransmitter.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.Level; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java similarity index 80% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java index d3a241f95..aa6cd8b09 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/WirelessTransmitterRangeModifier.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/package-info.java new file mode 100644 index 000000000..33089bb77 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/util/AmountFormattingTest.java b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/AmountFormattingTest.java similarity index 98% rename from refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/util/AmountFormattingTest.java rename to refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/AmountFormattingTest.java index cb66bccf1..7947fc363 100644 --- a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/util/AmountFormattingTest.java +++ b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/AmountFormattingTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.util; +package com.refinedmods.refinedstorage2.platform.api.support; import org.junit.jupiter.api.Test; diff --git a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/FluidResourceTest.java b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FluidResourceTest.java similarity index 98% rename from refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/FluidResourceTest.java rename to refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FluidResourceTest.java index a0f1fe9e8..e57fe1687 100644 --- a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/FluidResourceTest.java +++ b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/FluidResourceTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; diff --git a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/ItemResourceTest.java b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ItemResourceTest.java similarity index 98% rename from refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/ItemResourceTest.java rename to refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ItemResourceTest.java index 58e650ceb..47dbf56ff 100644 --- a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/ItemResourceTest.java +++ b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/ItemResourceTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.api.resource; +package com.refinedmods.refinedstorage2.platform.api.support.resource; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; diff --git a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceListImplTest.java b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceListImplTest.java similarity index 98% rename from refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceListImplTest.java rename to refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceListImplTest.java index f36fafcfb..54873b215 100644 --- a/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/resource/list/FuzzyResourceListImplTest.java +++ b/refinedstorage2-platform-api/src/test/java/com/refinedmods/refinedstorage2/platform/api/support/resource/list/FuzzyResourceListImplTest.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.api.resource.list; +package com.refinedmods.refinedstorage2.platform.api.support.resource.list; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; import java.util.Collection; diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_receiver.json new file mode 100644 index 000000000..7c3d97c33 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/black" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json new file mode 100644 index 000000000..c85efd707 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/black" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_receiver.json new file mode 100644 index 000000000..f86cea069 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/blue" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json new file mode 100644 index 000000000..26d0a4788 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/blue" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_receiver.json new file mode 100644 index 000000000..272697d4f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/brown" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json new file mode 100644 index 000000000..7308e85d6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/brown" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_receiver.json new file mode 100644 index 000000000..03ed7c3b1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/cyan" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json new file mode 100644 index 000000000..7c93cab21 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/cyan" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_receiver.json new file mode 100644 index 000000000..6bbc9fb00 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/gray" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json new file mode 100644 index 000000000..004f915c9 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/gray" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_receiver.json new file mode 100644 index 000000000..86e310337 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/green" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json new file mode 100644 index 000000000..ed8ae4451 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/green" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_receiver.json new file mode 100644 index 000000000..80e4ab4db --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/light_gray" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json new file mode 100644 index 000000000..6bef823bb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/light_gray" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_receiver.json new file mode 100644 index 000000000..1c06161a2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/lime" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json new file mode 100644 index 000000000..6962c78ff --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/lime" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_receiver.json new file mode 100644 index 000000000..0496045b1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/magenta" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json new file mode 100644 index 000000000..a9cfe5a30 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/magenta" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_receiver.json new file mode 100644 index 000000000..6fd106527 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/light_blue" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json new file mode 100644 index 000000000..49484a53f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/light_blue" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_receiver.json new file mode 100644 index 000000000..f42263881 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/orange" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json new file mode 100644 index 000000000..46030998b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/orange" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_receiver.json new file mode 100644 index 000000000..f72f2d31c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/pink" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json new file mode 100644 index 000000000..5c7009994 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/pink" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_receiver.json new file mode 100644 index 000000000..f62a02452 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/purple" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json new file mode 100644 index 000000000..d1def1e5b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/purple" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_receiver.json new file mode 100644 index 000000000..a4db02c72 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/red" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json new file mode 100644 index 000000000..efaf94767 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/red" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_receiver.json new file mode 100644 index 000000000..9d47582c7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/white" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json new file mode 100644 index 000000000..3019869df --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/white" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_receiver.json new file mode 100644 index 000000000..f553637ea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_receiver.json @@ -0,0 +1,10 @@ +{ + "variants": { + "active=false": { + "model": "refinedstorage2:block/network_receiver/inactive" + }, + "active=true": { + "model": "refinedstorage2:block/network_receiver/yellow" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json new file mode 100644 index 000000000..e18ebc477 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/yellow" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/black.json new file mode 100644 index 000000000..b353d302b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/black.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/black", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/blue.json new file mode 100644 index 000000000..e37eb0248 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/blue", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/brown.json new file mode 100644 index 000000000..a7068e51e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/brown.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/brown", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/cyan.json new file mode 100644 index 000000000..c48b00fc0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/cyan.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/cyan", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/gray.json new file mode 100644 index 000000000..5bf2981bd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/gray", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/green.json new file mode 100644 index 000000000..552c8d37c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/green.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/green", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json new file mode 100644 index 000000000..c89d61d94 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/inactive.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/inactive", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/light_blue.json new file mode 100644 index 000000000..44b9e35b1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/light_blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/light_blue", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/light_gray.json new file mode 100644 index 000000000..f19ff741c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/light_gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/light_gray", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/lime.json new file mode 100644 index 000000000..bbfdb16ee --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/lime.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/lime", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/magenta.json new file mode 100644 index 000000000..daf1629ed --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/magenta.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/magenta", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/orange.json new file mode 100644 index 000000000..57808fc14 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/orange.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/orange", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/pink.json new file mode 100644 index 000000000..b7ac3a556 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/pink.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/pink", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/purple.json new file mode 100644 index 000000000..aa8f409de --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/purple.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/purple", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/red.json new file mode 100644 index 000000000..c8c0c9d00 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/red.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/red", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/white.json new file mode 100644 index 000000000..5643b7496 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/white.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/white", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/yellow.json new file mode 100644 index 000000000..6ad1d45b0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_receiver/yellow.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_receiver/base", + "cutout": "refinedstorage2:block/network_receiver/cutouts/yellow", + "particle": "refinedstorage2:block/network_receiver/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json new file mode 100644 index 000000000..0f8886928 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/black", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json new file mode 100644 index 000000000..6ce433dea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/blue", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json new file mode 100644 index 000000000..d59d72fe1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/brown", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json new file mode 100644 index 000000000..edb07ae19 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/cyan", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json new file mode 100644 index 000000000..bde24ffc1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/error", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json new file mode 100644 index 000000000..e2a9d7adb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/gray", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json new file mode 100644 index 000000000..2a02cc52e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/green", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json new file mode 100644 index 000000000..3d57239b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/inactive", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json new file mode 100644 index 000000000..af0723908 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_blue", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json new file mode 100644 index 000000000..b6c0f2ad4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_gray", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json new file mode 100644 index 000000000..40dcbaff2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/lime", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json new file mode 100644 index 000000000..6026f8131 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/magenta", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json new file mode 100644 index 000000000..4a982bb88 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/orange", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json new file mode 100644 index 000000000..6789f6949 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/pink", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json new file mode 100644 index 000000000..7963ee4fc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/purple", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json new file mode 100644 index 000000000..47c6d2a06 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/red", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json new file mode 100644 index 000000000..c534f78e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/white", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json new file mode 100644 index 000000000..3054b74fd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/yellow", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json index e1ff55758..5f82d9540 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/black" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json index 65cfb5050..f0a7c7890 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/blue" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json index c025eb4ca..d80fa6195 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/brown" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json index 09e3a6d52..bb5ce8442 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/cyan" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json index 22092dae1..4cb0eb53e 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/gray" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json index fcf5eb934..97c627421 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/green" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json index 4d994ede4..25b97783f 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_blue" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json index 79d7f8f33..1f3dfe616 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_gray" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json index 18066c311..8a3df2c1c 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/lime" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json index 55e545d09..709cf5525 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/magenta" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json index 3d53d67e2..f359f9aca 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/orange" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json index 2f33a8fe5..f4752b655 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/pink" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json index 80c889144..f37c313db 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/purple" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json index ddd8adffa..6b171dab0 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/red" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json index fa1e3b66d..6da437453 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/white" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json index fa82c3620..c688136cf 100644 --- a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "parent": "refinedstorage2:block/wireless_transmitter/active", "textures": { "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/yellow" } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_receiver.json new file mode 100644 index 000000000..ade596183 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json new file mode 100644 index 000000000..8a95bdad0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_receiver.json new file mode 100644 index 000000000..bcf3097c7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json new file mode 100644 index 000000000..5d4bcba6f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_receiver.json new file mode 100644 index 000000000..249d08271 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json new file mode 100644 index 000000000..b4b236ff4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_receiver.json new file mode 100644 index 000000000..be8369e76 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json new file mode 100644 index 000000000..b6d2d901e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_receiver.json new file mode 100644 index 000000000..e91a0cbb1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json new file mode 100644 index 000000000..044b5ed1e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_receiver.json new file mode 100644 index 000000000..509ec28ad --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json new file mode 100644 index 000000000..7def81806 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_receiver.json new file mode 100644 index 000000000..cf103c918 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json new file mode 100644 index 000000000..79961be77 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_receiver.json new file mode 100644 index 000000000..7acce74fa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json new file mode 100644 index 000000000..d82a2cba6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_receiver.json new file mode 100644 index 000000000..c1952d7e5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json new file mode 100644 index 000000000..f3f93d427 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_receiver.json new file mode 100644 index 000000000..c237c3d55 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json new file mode 100644 index 000000000..a81a65c0f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_receiver.json new file mode 100644 index 000000000..8ef759ae0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json new file mode 100644 index 000000000..5272d4ab9 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_receiver.json new file mode 100644 index 000000000..c9d5ae064 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json new file mode 100644 index 000000000..d78d47f94 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_receiver.json new file mode 100644 index 000000000..df74529c0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json new file mode 100644 index 000000000..ddad1fd12 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_receiver.json new file mode 100644 index 000000000..24e8dff77 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json new file mode 100644 index 000000000..969a2ee85 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_receiver.json new file mode 100644 index 000000000..5654fa20c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json new file mode 100644 index 000000000..8596e093f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_receiver.json new file mode 100644 index 000000000..cb901d1bd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_receiver.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_receiver/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_receiver/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json new file mode 100644 index 000000000..6c4c3dcfd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_receiver.json new file mode 100644 index 000000000..c7b33755b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/black_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/black_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json new file mode 100644 index 000000000..d62881c05 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/black_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/black_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_receiver.json new file mode 100644 index 000000000..22f8c8709 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/blue_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/blue_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json new file mode 100644 index 000000000..5fb93f8d0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/blue_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/blue_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_receiver.json new file mode 100644 index 000000000..2dcce70a1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/brown_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/brown_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json new file mode 100644 index 000000000..f8472f93e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/brown_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/brown_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_receiver.json new file mode 100644 index 000000000..5579db0c2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/cyan_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/cyan_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json new file mode 100644 index 000000000..212262dfe --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/cyan_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/cyan_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_receiver.json new file mode 100644 index 000000000..f91f93326 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/gray_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/gray_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json new file mode 100644 index 000000000..003794319 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/gray_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/gray_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_receiver.json new file mode 100644 index 000000000..4213a221a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/green_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/green_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json new file mode 100644 index 000000000..5944c16a4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/green_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/green_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_receiver.json new file mode 100644 index 000000000..d1053d126 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_blue_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_blue_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json new file mode 100644 index 000000000..f194d254d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_blue_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_blue_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_receiver.json new file mode 100644 index 000000000..3ddba8f5d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_gray_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_gray_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json new file mode 100644 index 000000000..691df5431 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_gray_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_gray_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_receiver.json new file mode 100644 index 000000000..4304825b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/lime_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/lime_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json new file mode 100644 index 000000000..27e675c29 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/lime_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/lime_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_receiver.json new file mode 100644 index 000000000..6eac125ee --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/magenta_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/magenta_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json new file mode 100644 index 000000000..6cdba8303 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/magenta_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/magenta_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_receiver.json new file mode 100644 index 000000000..a68106768 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/orange_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/orange_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json new file mode 100644 index 000000000..bcf7a5a24 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/orange_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/orange_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_receiver.json new file mode 100644 index 000000000..3d4551d03 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/pink_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/pink_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json new file mode 100644 index 000000000..cbb5dbab7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/pink_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/pink_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_receiver.json new file mode 100644 index 000000000..cf37cb575 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/purple_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/purple_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json new file mode 100644 index 000000000..aba85fa45 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/purple_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/purple_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_receiver.json new file mode 100644 index 000000000..7a0d917dd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/red_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/red_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json new file mode 100644 index 000000000..178e31944 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/red_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/red_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_receiver.json new file mode 100644 index 000000000..c0d7cf997 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/white_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/white_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json new file mode 100644 index 000000000..e173f3582 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/white_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/white_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_receiver.json new file mode 100644 index 000000000..28300c863 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_receiver.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_receivers": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_receivers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/yellow_network_receiver" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_receivers", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/yellow_network_receiver" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json new file mode 100644 index 000000000..68a1b2078 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/yellow_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/yellow_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_receiver.json new file mode 100644 index 000000000..0ffff7793 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:black_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/black_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json new file mode 100644 index 000000000..f925deda4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:black_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/black_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_receiver.json new file mode 100644 index 000000000..dd9a16080 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:blue_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/blue_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json new file mode 100644 index 000000000..44656ecfa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:blue_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/blue_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_receiver.json new file mode 100644 index 000000000..126e8020a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:brown_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/brown_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json new file mode 100644 index 000000000..4e548e328 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:brown_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/brown_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_receiver.json new file mode 100644 index 000000000..09b99f3ff --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:cyan_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/cyan_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json new file mode 100644 index 000000000..f92f09225 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:cyan_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/cyan_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_receiver.json new file mode 100644 index 000000000..0b6fa43d1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:gray_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/gray_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json new file mode 100644 index 000000000..b4ad2b8f3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:gray_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/gray_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_receiver.json new file mode 100644 index 000000000..db633f063 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:green_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/green_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json new file mode 100644 index 000000000..954149bde --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:green_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/green_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_receiver.json new file mode 100644 index 000000000..3e81cc321 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:light_gray_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/light_gray_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json new file mode 100644 index 000000000..48e4801ea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:light_gray_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/light_gray_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_receiver.json new file mode 100644 index 000000000..7e2244265 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:lime_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/lime_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json new file mode 100644 index 000000000..eed497cfa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:lime_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/lime_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_receiver.json new file mode 100644 index 000000000..eda8e2384 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:magenta_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/magenta_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json new file mode 100644 index 000000000..15777c802 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:magenta_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/magenta_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_receiver.json new file mode 100644 index 000000000..34a5d8900 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json new file mode 100644 index 000000000..80d86c15b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_receiver.json new file mode 100644 index 000000000..f61f350bd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:orange_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/orange_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json new file mode 100644 index 000000000..5bab22f68 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:orange_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/orange_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_receiver.json new file mode 100644 index 000000000..962eea8de --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:pink_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/pink_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json new file mode 100644 index 000000000..70c0580c8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:pink_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/pink_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_receiver.json new file mode 100644 index 000000000..59612d49b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:purple_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/purple_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json new file mode 100644 index 000000000..71e632a40 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:purple_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/purple_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_receiver.json new file mode 100644 index 000000000..9019cb58b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:red_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/red_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json new file mode 100644 index 000000000..d891359c3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:red_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/red_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_receiver.json new file mode 100644 index 000000000..cccc597dc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:white_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/white_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json new file mode 100644 index 000000000..4c1bdc48a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:white_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/white_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_receiver.json new file mode 100644 index 000000000..9aa605850 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_receiver.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:yellow_network_receiver" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/yellow_network_receiver" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json new file mode 100644 index 000000000..14549c329 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:yellow_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/yellow_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_receiver.json new file mode 100644 index 000000000..10adc17ab --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:black_dye" + } + ], + "result": { + "item": "refinedstorage2:black_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json new file mode 100644 index 000000000..36b859db6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:black_dye" + } + ], + "result": { + "item": "refinedstorage2:black_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_receiver.json new file mode 100644 index 000000000..2cf78ae46 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:blue_dye" + } + ], + "result": { + "item": "refinedstorage2:blue_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json new file mode 100644 index 000000000..a4e2bd0a0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:blue_dye" + } + ], + "result": { + "item": "refinedstorage2:blue_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_receiver.json new file mode 100644 index 000000000..8f315166a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:brown_dye" + } + ], + "result": { + "item": "refinedstorage2:brown_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json new file mode 100644 index 000000000..e7c68912d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:brown_dye" + } + ], + "result": { + "item": "refinedstorage2:brown_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_receiver.json new file mode 100644 index 000000000..1740e8a1b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:cyan_dye" + } + ], + "result": { + "item": "refinedstorage2:cyan_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json new file mode 100644 index 000000000..f84a9cfba --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:cyan_dye" + } + ], + "result": { + "item": "refinedstorage2:cyan_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_receiver.json new file mode 100644 index 000000000..d81adf188 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:gray_dye" + } + ], + "result": { + "item": "refinedstorage2:gray_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json new file mode 100644 index 000000000..70a07df91 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:gray_dye" + } + ], + "result": { + "item": "refinedstorage2:gray_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_receiver.json new file mode 100644 index 000000000..17bebbdbc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:green_dye" + } + ], + "result": { + "item": "refinedstorage2:green_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json new file mode 100644 index 000000000..df1b74eb0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:green_dye" + } + ], + "result": { + "item": "refinedstorage2:green_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_receiver.json new file mode 100644 index 000000000..76b5e6fc4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:light_blue_dye" + } + ], + "result": { + "item": "refinedstorage2:network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json new file mode 100644 index 000000000..b1479d3a7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:light_blue_dye" + } + ], + "result": { + "item": "refinedstorage2:network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_receiver.json new file mode 100644 index 000000000..0e08e1676 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:light_gray_dye" + } + ], + "result": { + "item": "refinedstorage2:light_gray_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json new file mode 100644 index 000000000..f47ee6865 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:light_gray_dye" + } + ], + "result": { + "item": "refinedstorage2:light_gray_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_receiver.json new file mode 100644 index 000000000..cc0ae467a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:lime_dye" + } + ], + "result": { + "item": "refinedstorage2:lime_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json new file mode 100644 index 000000000..695ac7837 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:lime_dye" + } + ], + "result": { + "item": "refinedstorage2:lime_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_receiver.json new file mode 100644 index 000000000..3a51f49ad --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:magenta_dye" + } + ], + "result": { + "item": "refinedstorage2:magenta_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json new file mode 100644 index 000000000..83e87448e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:magenta_dye" + } + ], + "result": { + "item": "refinedstorage2:magenta_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_receiver.json new file mode 100644 index 000000000..7f5f93995 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:orange_dye" + } + ], + "result": { + "item": "refinedstorage2:orange_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json new file mode 100644 index 000000000..2a883881c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:orange_dye" + } + ], + "result": { + "item": "refinedstorage2:orange_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_receiver.json new file mode 100644 index 000000000..8108f41b8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:pink_dye" + } + ], + "result": { + "item": "refinedstorage2:pink_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json new file mode 100644 index 000000000..45cca06c1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:pink_dye" + } + ], + "result": { + "item": "refinedstorage2:pink_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_receiver.json new file mode 100644 index 000000000..e62460fb2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:purple_dye" + } + ], + "result": { + "item": "refinedstorage2:purple_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json new file mode 100644 index 000000000..936c7bb9a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:purple_dye" + } + ], + "result": { + "item": "refinedstorage2:purple_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_receiver.json new file mode 100644 index 000000000..9648c407a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:red_dye" + } + ], + "result": { + "item": "refinedstorage2:red_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json new file mode 100644 index 000000000..c0640bffb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:red_dye" + } + ], + "result": { + "item": "refinedstorage2:red_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_receiver.json new file mode 100644 index 000000000..c8250b9ae --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:white_dye" + } + ], + "result": { + "item": "refinedstorage2:white_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json new file mode 100644 index 000000000..c793b5352 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:white_dye" + } + ], + "result": { + "item": "refinedstorage2:white_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_receiver.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_receiver.json new file mode 100644 index 000000000..1c9a4ce3e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_receiver.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_receivers" + }, + { + "item": "minecraft:yellow_dye" + } + ], + "result": { + "item": "refinedstorage2:yellow_network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json new file mode 100644 index 000000000..6b0da48b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:yellow_dye" + } + ], + "result": { + "item": "refinedstorage2:yellow_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_receivers.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_receivers.json new file mode 100644 index 000000000..2e1d18612 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_receivers.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage2:white_network_receiver", + "refinedstorage2:orange_network_receiver", + "refinedstorage2:magenta_network_receiver", + "refinedstorage2:network_receiver", + "refinedstorage2:yellow_network_receiver", + "refinedstorage2:lime_network_receiver", + "refinedstorage2:pink_network_receiver", + "refinedstorage2:gray_network_receiver", + "refinedstorage2:light_gray_network_receiver", + "refinedstorage2:cyan_network_receiver", + "refinedstorage2:purple_network_receiver", + "refinedstorage2:blue_network_receiver", + "refinedstorage2:brown_network_receiver", + "refinedstorage2:green_network_receiver", + "refinedstorage2:red_network_receiver", + "refinedstorage2:black_network_receiver" + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json new file mode 100644 index 000000000..5e6f46c32 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage2:white_network_transmitter", + "refinedstorage2:orange_network_transmitter", + "refinedstorage2:magenta_network_transmitter", + "refinedstorage2:network_transmitter", + "refinedstorage2:yellow_network_transmitter", + "refinedstorage2:lime_network_transmitter", + "refinedstorage2:pink_network_transmitter", + "refinedstorage2:gray_network_transmitter", + "refinedstorage2:light_gray_network_transmitter", + "refinedstorage2:cyan_network_transmitter", + "refinedstorage2:purple_network_transmitter", + "refinedstorage2:blue_network_transmitter", + "refinedstorage2:brown_network_transmitter", + "refinedstorage2:green_network_transmitter", + "refinedstorage2:red_network_transmitter", + "refinedstorage2:black_network_transmitter" + ] +} \ 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 8fb4b7f45..1cbb0567b 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 @@ -1,32 +1,33 @@ package com.refinedmods.refinedstorage2.platform.common; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.GridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorScreen; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorScreen; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.FluidResourceRendering; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ItemResourceRendering; -import com.refinedmods.refinedstorage2.platform.common.screen.ConstructorScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.ControllerScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.DestructorScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.DiskDriveScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.ExporterScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.ExternalStorageScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.FluidStorageBlockScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.ImporterScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.InterfaceScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.ItemStorageBlockScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.RegulatorUpgradeScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.StorageMonitorScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.WirelessTransmitterScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.amount.DetectorScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.CraftingGridScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.GridScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.hint.FluidGridInsertionHint; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerScreen; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorScreen; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterScreen; +import com.refinedmods.refinedstorage2.platform.common.grid.GridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.CraftingGridScreen; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.GridScreen; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.hint.FluidGridInsertionHint; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceScreen; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterScreen; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterScreen; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveScreen; +import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageScreen; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockScreen; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockScreen; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorScreen; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResourceRendering; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeScreen; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterScreen; import net.minecraft.client.KeyMapping; import net.minecraft.client.Minecraft; @@ -57,6 +58,7 @@ protected static void registerScreens(final ScreenRegistration registration) { registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::new); registration.register(Menus.INSTANCE.getStorageMonitor(), StorageMonitorScreen::new); + registration.register(Menus.INSTANCE.getNetworkTransmitter(), NetworkTransmitterScreen::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 161c294ef..a7db7f229 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 @@ -1,66 +1,26 @@ package com.refinedmods.refinedstorage2.platform.common; import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.network.impl.component.EnergyNetworkComponentImpl; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponentImpl; import com.refinedmods.refinedstorage2.api.network.impl.component.StorageNetworkComponentImpl; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.PlatformApiProxy; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerType; -import com.refinedmods.refinedstorage2.platform.common.block.DiskDriveBlock; -import com.refinedmods.refinedstorage2.platform.common.block.FluidStorageBlock; -import com.refinedmods.refinedstorage2.platform.common.block.InterfaceBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ItemStorageBlock; -import com.refinedmods.refinedstorage2.platform.common.block.SimpleBlock; -import com.refinedmods.refinedstorage2.platform.common.block.StorageMonitorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.CableBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ImporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.ItemDropConstructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.PlaceBlockConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.PlaceFireworksConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.PlaceFluidConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.BlockBreakDestructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.DestructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.FluidBreakDestructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.ItemPickupDestructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.common.block.entity.detector.DetectorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.exporter.ExporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage.ExternalStorageBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.GridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.FluidStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.ItemStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.FluidStorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.FluidStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.ItemStorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.ItemStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.CreativeRangeUpgradeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.RangeUpgradeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ConstructorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.DestructorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ExporterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ImporterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.InterfaceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.RegulatorUpgradeContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.StorageMonitorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.detector.DetectorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.GridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.WirelessGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.ExternalStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.FluidStorageBlockContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.ItemStorageBlockContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive.DiskDriveContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.configurationcard.ConfigurationCardItem; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.BlockBreakDestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.FluidBreakDestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ItemDropConstructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ItemPickupDestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.PlaceBlockConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.PlaceFireworksConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.PlaceFluidConstructorStrategy; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntityTypeFactory; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; @@ -71,28 +31,75 @@ import com.refinedmods.refinedstorage2.platform.common.content.Menus; import com.refinedmods.refinedstorage2.platform.common.content.RegistryCallback; import com.refinedmods.refinedstorage2.platform.common.content.Sounds; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.FluidResourceFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.item.FluidStorageDiskItem; -import com.refinedmods.refinedstorage2.platform.common.item.FortuneUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.item.ItemStorageDiskItem; -import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem; -import com.refinedmods.refinedstorage2.platform.common.item.RangeUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.item.SimpleItem; -import com.refinedmods.refinedstorage2.platform.common.item.SimpleUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.item.WirelessGridItem; -import com.refinedmods.refinedstorage2.platform.common.item.WrenchItem; -import com.refinedmods.refinedstorage2.platform.common.item.block.FluidStorageBlockBlockItem; -import com.refinedmods.refinedstorage2.platform.common.item.block.ItemStorageBlockBlockItem; -import com.refinedmods.refinedstorage2.platform.common.item.block.SimpleBlockItem; -import com.refinedmods.refinedstorage2.platform.common.loot.EnergyLootItemFunctionSerializer; -import com.refinedmods.refinedstorage2.platform.common.loot.StorageBlockLootItemFunctionSerializer; -import com.refinedmods.refinedstorage2.platform.common.recipe.UpgradeWithEnchantedBookRecipeSerializer; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerType; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.GridBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.grid.GridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlock; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.misc.WrenchItem; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItem; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +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.externalstorage.ExternalStorageBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlock; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockBlockItem; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlock; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockBlockItem; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.StorageBlockLootItemFunctionSerializer; +import com.refinedmods.refinedstorage2.platform.common.storage.storagedisk.FluidStorageDiskItem; +import com.refinedmods.refinedstorage2.platform.common.storage.storagedisk.ItemStorageDiskItem; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.FluidStorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.FluidStorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.ItemStorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.ItemStorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlock; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlock; +import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.SimpleItem; +import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyLootItemFunctionSerializer; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.upgrade.FortuneUpgradeItem; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RangeUpgradeItem; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeItem; +import com.refinedmods.refinedstorage2.platform.common.upgrade.SimpleUpgradeItem; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeWithEnchantedBookRecipeSerializer; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.CreativeRangeUpgradeWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.RangeUpgradeWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import java.util.Optional; import java.util.function.BiFunction; @@ -128,6 +135,8 @@ import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.INTERFACE; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.ITEM_STORAGE_BLOCK; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.MACHINE_CASING; +import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.NETWORK_RECEIVER; +import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.NETWORK_TRANSMITTER; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.PROCESSOR_BINDING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON_BLOCK; @@ -151,10 +160,6 @@ public abstract class AbstractModInitializer { private static final String FLUID_REGISTRY_KEY = "fluid"; - protected final void initializePlatform(final Platform platform) { - ((PlatformProxy) Platform.INSTANCE).setPlatform(platform); - } - protected final void initializePlatformApi() { ((PlatformApiProxy) PlatformApi.INSTANCE).setDelegate(new PlatformApiImpl()); registerAdditionalStorageTypes(); @@ -219,7 +224,7 @@ private void registerNetworkComponents() { ); PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( GraphNetworkComponent.class, - GraphNetworkComponent::new + GraphNetworkComponentImpl::new ); PlatformApi.INSTANCE.getNetworkComponentMapFactory().addFactory( StorageNetworkComponent.class, @@ -272,6 +277,8 @@ protected final void registerBlocks( Blocks.INSTANCE.setInterface(callback.register(INTERFACE, InterfaceBlock::new)); Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); Blocks.INSTANCE.setStorageMonitor(callback.register(STORAGE_MONITOR, StorageMonitorBlock::new)); + Blocks.INSTANCE.getNetworkReceiver().registerBlocks(callback); + Blocks.INSTANCE.getNetworkTransmitter().registerBlocks(callback); } protected final void registerItems( @@ -293,6 +300,8 @@ protected final void registerItems( Blocks.INSTANCE.getConstructor().registerItems(callback, Items.INSTANCE::addConstructor); Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); + Blocks.INSTANCE.getNetworkReceiver().registerItems(callback, Items.INSTANCE::addNetworkReceiver); + Blocks.INSTANCE.getNetworkTransmitter().registerItems(callback, Items.INSTANCE::addNetworkTransmitter); registerStorageItems(callback); registerUpgrades(callback, regulatorUpgradeItemSupplier); Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, wirelessGridItemSupplier)); @@ -321,6 +330,11 @@ private void registerSimpleItems(final RegistryCallback callback) { for (final ProcessorItem.Type type : ProcessorItem.Type.values()) { registerProcessor(callback, type); } + Items.INSTANCE.setConfigurationCard(callback.register( + ContentIds.CONFIGURATION_CARD, + ConfigurationCardItem::new + )); + Items.INSTANCE.setNetworkCard(callback.register(ContentIds.NETWORK_CARD, NetworkCardItem::new)); } private void registerProcessor(final RegistryCallback callback, final ProcessorItem.Type type) { @@ -471,7 +485,12 @@ protected final void registerBlockEntities( ) { BlockEntities.INSTANCE.setCable(callback.register( CABLE, - () -> typeFactory.create(CableBlockEntity::new, Blocks.INSTANCE.getCable().toArray()) + () -> typeFactory.create((pos, state) -> new NetworkNodeContainerBlockEntityImpl<>( + BlockEntities.INSTANCE.getCable(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getCable().getEnergyUsage()) + ), Blocks.INSTANCE.getCable().toArray()) )); BlockEntities.INSTANCE.setController(callback.register( CONTROLLER, @@ -558,6 +577,17 @@ protected final void registerBlockEntities( STORAGE_MONITOR, () -> typeFactory.create(StorageMonitorBlockEntity::new, Blocks.INSTANCE.getStorageMonitor()) )); + BlockEntities.INSTANCE.setNetworkReceiver(callback.register( + NETWORK_RECEIVER, + () -> typeFactory.create(NetworkReceiverBlockEntity::new, Blocks.INSTANCE.getNetworkReceiver().toArray()) + )); + BlockEntities.INSTANCE.setNetworkTransmitter(callback.register( + NETWORK_TRANSMITTER, + () -> typeFactory.create( + NetworkTransmitterBlockEntity::new, + Blocks.INSTANCE.getNetworkTransmitter().toArray() + ) + )); } protected final void registerMenus(final RegistryCallback> callback, @@ -630,6 +660,10 @@ protected final void registerMenus(final RegistryCallback> callback, STORAGE_MONITOR, () -> menuTypeFactory.create(StorageMonitorContainerMenu::new) )); + Menus.INSTANCE.setNetworkTransmitter(callback.register( + NETWORK_TRANSMITTER, + () -> menuTypeFactory.create(NetworkTransmitterContainerMenu::new) + )); } protected final void registerLootFunctions(final RegistryCallback callback) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java index 282796396..6f84b85a8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractPlatform.java @@ -1,30 +1,26 @@ package com.refinedmods.refinedstorage2.platform.common; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage2.platform.common.menu.MenuOpener; -import com.refinedmods.refinedstorage2.platform.common.packet.ClientToServerCommunications; -import com.refinedmods.refinedstorage2.platform.common.packet.ServerToClientCommunications; -import com.refinedmods.refinedstorage2.platform.common.render.FluidRenderer; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; public abstract class AbstractPlatform implements Platform { private final ServerToClientCommunications serverToClientCommunications; private final ClientToServerCommunications clientToServerCommunications; private final MenuOpener menuOpener; - private final BucketAmountFormatting bucketAmountFormatting; private final FluidRenderer fluidRenderer; private final GridInsertionStrategyFactory defaultGridInsertionStrategyFactory; protected AbstractPlatform(final ServerToClientCommunications serverToClientCommunications, final ClientToServerCommunications clientToServerCommunications, final MenuOpener menuOpener, - final BucketAmountFormatting bucketAmountFormatting, final FluidRenderer fluidRenderer, final GridInsertionStrategyFactory defaultGridInsertionStrategyFactory) { this.serverToClientCommunications = serverToClientCommunications; this.clientToServerCommunications = clientToServerCommunications; this.menuOpener = menuOpener; - this.bucketAmountFormatting = bucketAmountFormatting; this.fluidRenderer = fluidRenderer; this.defaultGridInsertionStrategyFactory = defaultGridInsertionStrategyFactory; } @@ -44,11 +40,6 @@ public MenuOpener getMenuOpener() { return menuOpener; } - @Override - public BucketAmountFormatting getBucketAmountFormatter() { - return bucketAmountFormatting; - } - @Override public FluidRenderer getFluidRenderer() { return fluidRenderer; 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 7f89c1abb..8e20884c5 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 @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.common; import com.refinedmods.refinedstorage2.api.grid.view.GridSortingDirection; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSize; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSortingTypes; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSize; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSortingTypes; import java.util.Optional; @@ -46,6 +46,10 @@ public interface Config { SimpleEnergyUsageEntry getStorageMonitor(); + SimpleEnergyUsageEntry getNetworkReceiver(); + + SimpleEnergyUsageEntry getNetworkTransmitter(); + interface SimpleEnergyUsageEntry { long getEnergyUsage(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/ContainedFluid.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/ContainedFluid.java deleted file mode 100644 index f5d161b7c..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/ContainedFluid.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common; - -import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; - -import net.minecraft.world.item.ItemStack; - -public record ContainedFluid(ItemStack remainderContainer, ResourceAmount fluid) { -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java index 4368389a8..3e332eae3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Platform.java @@ -3,15 +3,15 @@ import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferManager; -import com.refinedmods.refinedstorage2.platform.common.menu.MenuOpener; -import com.refinedmods.refinedstorage2.platform.common.packet.ClientToServerCommunications; -import com.refinedmods.refinedstorage2.platform.common.packet.ServerToClientCommunications; -import com.refinedmods.refinedstorage2.platform.common.render.FluidRenderer; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; +import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; import java.util.List; import java.util.Optional; @@ -57,8 +57,6 @@ public interface Platform { TagKey getWrenchTag(); - BucketAmountFormatting getBucketAmountFormatter(); - Config getConfig(); boolean canEditBoxLoseFocus(EditBox editBox); @@ -119,4 +117,7 @@ List processTooltipComponents( void renderTooltip(GuiGraphics graphics, List components, int x, int y); Optional getEnergyStorage(ItemStack stack); + + record ContainedFluid(ItemStack remainderContainer, ResourceAmount fluid) { + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java index ccd58f6ad..442204f50 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java @@ -9,71 +9,71 @@ import com.refinedmods.refinedstorage2.api.network.impl.NetworkFactory; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHints; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.item.EnergyItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItemHelper; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.CompositeStorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.CompositeStorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; -import com.refinedmods.refinedstorage2.platform.common.integration.recipemod.CompositeIngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.internal.energy.ItemEnergyStorage; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.NoOpGridSynchronizer; -import com.refinedmods.refinedstorage2.platform.common.internal.item.CompositeSlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.common.internal.item.EnergyItemHelperImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.item.InventorySlotReference; -import com.refinedmods.refinedstorage2.platform.common.internal.item.InventorySlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.item.NetworkBoundItemHelperImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.item.StorageContainerItemHelperImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.network.LevelConnectionProvider; -import com.refinedmods.refinedstorage2.platform.common.internal.registry.PlatformRegistryImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.FluidResourceFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ItemResourceFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.ClientStorageRepository; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.StorageRepositoryImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.BuiltinUpgradeDestinationsImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeRegistryImpl; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.hint.GridInsertionHintsImpl; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.hint.ItemGridInsertionHint; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.hint.SingleItemGridInsertionHint; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.grid.NoOpGridSynchronizer; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.hint.GridInsertionHintsImpl; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.hint.ItemGridInsertionHint; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.hint.SingleItemGridInsertionHint; +import com.refinedmods.refinedstorage2.platform.common.grid.strategy.CompositeGridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.common.grid.strategy.CompositeGridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.common.grid.strategy.CompositeGridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.common.recipemod.CompositeIngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.storage.ClientStorageRepository; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageContainerItemHelperImpl; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageRepositoryImpl; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.CompositeStorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.CompositeStorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyItemHelperImpl; +import com.refinedmods.refinedstorage2.platform.common.support.energy.ItemEnergyStorage; +import com.refinedmods.refinedstorage2.platform.common.support.network.ConnectionProviderImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.CompositeSlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.InventorySlotReference; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.InventorySlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.NetworkBoundItemHelperImpl; +import com.refinedmods.refinedstorage2.platform.common.support.registry.PlatformRegistryImpl; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ItemResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.upgrade.BuiltinUpgradeDestinationsImpl; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeRegistryImpl; import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; -import com.refinedmods.refinedstorage2.platform.common.util.TickHandler; +import com.refinedmods.refinedstorage2.platform.common.util.ServerEventQueue; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; import java.util.ArrayList; import java.util.Arrays; @@ -291,8 +291,8 @@ public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { public void requestNetworkNodeInitialization(final NetworkNodeContainer container, final Level level, final Runnable callback) { - final LevelConnectionProvider connectionProvider = new LevelConnectionProvider(level); - TickHandler.runWhenReady(() -> { + final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); + ServerEventQueue.queue(() -> { networkBuilder.initialize(container, connectionProvider); callback.run(); }); @@ -300,13 +300,13 @@ public void requestNetworkNodeInitialization(final NetworkNodeContainer containe @Override public void requestNetworkNodeRemoval(final NetworkNodeContainer container, final Level level) { - final LevelConnectionProvider connectionProvider = new LevelConnectionProvider(level); + final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); networkBuilder.remove(container, connectionProvider); } @Override public void requestNetworkNodeUpdate(final NetworkNodeContainer container, final Level level) { - final LevelConnectionProvider connectionProvider = new LevelConnectionProvider(level); + final ConnectionProviderImpl connectionProvider = new ConnectionProviderImpl(level); networkBuilder.update(container, connectionProvider); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java index 9867803af..e70c7e17f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformProxy.java @@ -3,15 +3,14 @@ import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferManager; -import com.refinedmods.refinedstorage2.platform.common.menu.MenuOpener; -import com.refinedmods.refinedstorage2.platform.common.packet.ClientToServerCommunications; -import com.refinedmods.refinedstorage2.platform.common.packet.ServerToClientCommunications; -import com.refinedmods.refinedstorage2.platform.common.render.FluidRenderer; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; import java.util.List; import java.util.Optional; @@ -48,11 +47,12 @@ public class PlatformProxy implements Platform { @Nullable private Platform platform; - public void setPlatform(final Platform platform) { - if (this.platform != null) { + public static void loadPlatform(final Platform platform) { + final PlatformProxy proxy = (PlatformProxy) Platform.INSTANCE; + if (proxy.platform != null) { throw new IllegalStateException("Platform already set"); } - this.platform = platform; + proxy.platform = platform; } @Override @@ -80,11 +80,6 @@ public TagKey getWrenchTag() { return ensureLoaded().getWrenchTag(); } - @Override - public BucketAmountFormatting getBucketAmountFormatter() { - return ensureLoaded().getBucketAmountFormatter(); - } - @Override public Config getConfig() { return ensureLoaded().getConfig(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableShapeCacheKey.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableShapeCacheKey.java deleted file mode 100644 index 26a9c5b36..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableShapeCacheKey.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.block; - -import net.minecraft.world.level.block.state.BlockState; - -import static com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport.DOWN; -import static com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport.EAST; -import static com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport.NORTH; -import static com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport.SOUTH; -import static com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport.UP; -import static com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport.WEST; - -public record CableShapeCacheKey(boolean north, boolean east, boolean south, boolean west, boolean up, boolean down) { - static CableShapeCacheKey of(final BlockState state) { - return new CableShapeCacheKey( - state.getValue(NORTH), - state.getValue(EAST), - state.getValue(SOUTH), - state.getValue(WEST), - state.getValue(UP), - state.getValue(DOWN) - ); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerType.java deleted file mode 100644 index ffa70e415..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.block; - -public enum ControllerType { - NORMAL, - CREATIVE -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/package-info.java deleted file mode 100644 index 95548756b..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.direction; - -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/block/entity/AbstractInternalNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractInternalNetworkNodeContainerBlockEntity.java deleted file mode 100644 index 7c32c3318..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractInternalNetworkNodeContainerBlockEntity.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; - -import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; -import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage2.platform.api.blockentity.AbstractNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ColorableBlock; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; - -import java.util.UUID; -import javax.annotation.Nullable; - -import com.google.common.util.concurrent.RateLimiter; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; -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; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class AbstractInternalNetworkNodeContainerBlockEntity - extends AbstractNetworkNodeContainerBlockEntity - implements PlayerAware { - private static final Logger LOGGER = LoggerFactory.getLogger(AbstractInternalNetworkNodeContainerBlockEntity.class); - - private static final String TAG_REDSTONE_MODE = "rm"; - private static final String TAG_PLACED_BY_PLAYER_ID = "pbpid"; - - private final RateLimiter activenessChangeRateLimiter = RateLimiter.create(1); - private boolean lastActive; - private RedstoneMode redstoneMode = RedstoneMode.IGNORE; - @Nullable - private UUID placedByPlayerId; - - protected AbstractInternalNetworkNodeContainerBlockEntity(final BlockEntityType type, - final BlockPos pos, - final BlockState state, - final T node) { - super(type, pos, state, node); - } - - private boolean isActive() { - final long energyUsage = getNode().getEnergyUsage(); - final boolean hasLevel = level != null && level.isLoaded(worldPosition); - return hasLevel - && redstoneMode.isActive(level.hasNeighborSignal(worldPosition)) - && getNode().getNetwork() != null - && getNode().getNetwork().getComponent(EnergyNetworkComponent.class).getStored() >= energyUsage; - } - - @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); - tag.putInt(TAG_REDSTONE_MODE, RedstoneModeSettings.getRedstoneMode(getRedstoneMode())); - if (placedByPlayerId != null) { - tag.putUUID(TAG_PLACED_BY_PLAYER_ID, placedByPlayerId); - } - } - - @Override - public void load(final CompoundTag tag) { - super.load(tag); - if (tag.contains(TAG_REDSTONE_MODE)) { - redstoneMode = RedstoneModeSettings.getRedstoneMode(tag.getInt(TAG_REDSTONE_MODE)); - } - if (tag.hasUUID(TAG_PLACED_BY_PLAYER_ID)) { - placedByPlayerId = tag.getUUID(TAG_PLACED_BY_PLAYER_ID); - } - } - - public void updateActiveness(final BlockState state, - @Nullable final BooleanProperty activenessProperty) { - final boolean newActive = isActive(); - if (newActive != lastActive && activenessChangeRateLimiter.tryAcquire()) { - LOGGER.debug("Activeness change for node at {}: {} -> {}", getBlockPos(), lastActive, newActive); - this.lastActive = newActive; - activenessChanged(state, newActive, activenessProperty); - } - } - - protected void activenessChanged(final BlockState state, - final boolean newActive, - @Nullable final BooleanProperty activenessProperty) { - getNode().setActive(newActive); - - final boolean needToUpdateBlockState = activenessProperty != null - && state.getValue(activenessProperty) != newActive; - - if (needToUpdateBlockState) { - LOGGER.debug("Sending block update for block at {} due to state change to {}", getBlockPos(), newActive); - updateActivenessState(state, activenessProperty, newActive); - } - } - - private void updateActivenessState(final BlockState state, - final BooleanProperty activenessProperty, - final boolean active) { - if (level != null) { - level.setBlockAndUpdate(getBlockPos(), state.setValue(activenessProperty, active)); - } - } - - public RedstoneMode getRedstoneMode() { - return redstoneMode; - } - - public void setRedstoneMode(final RedstoneMode redstoneMode) { - this.redstoneMode = redstoneMode; - setChanged(); - } - - public void doWork() { - getNode().doWork(); - } - - @Override - public boolean canPerformOutgoingConnection(final Direction direction) { - final Direction myDirection = getDirection(); - if (myDirection == null) { - return true; - } - return myDirection != direction; - } - - @Override - public boolean canAcceptIncomingConnection(final Direction direction, final BlockState other) { - if (!colorsAllowConnecting(other)) { - return false; - } - final Direction myDirection = getDirection(); - if (myDirection != null) { - return myDirection != direction.getOpposite(); - } - return true; - } - - protected final boolean colorsAllowConnecting(final BlockState other) { - if (!(other.getBlock() instanceof ColorableBlock otherColorableBlock)) { - return true; - } - final ColorableBlock colorableBlock = getColor(); - if (colorableBlock == null) { - return true; - } - return otherColorableBlock.getColor() == colorableBlock.getColor() - || colorableBlock.canAlwaysConnect() - || otherColorableBlock.canAlwaysConnect(); - } - - @Nullable - private ColorableBlock getColor() { - if (!(getBlockState().getBlock() instanceof ColorableBlock colorableBlock)) { - return null; - } - return colorableBlock; - } - - @Nullable - protected final Direction getDirection() { - final BlockState blockState = getBlockState(); - if (!(blockState.getBlock() instanceof AbstractDirectionalBlock directionalBlock)) { - return null; - } - return directionalBlock.extractDirection(blockState); - } - - @Override - public void setPlacedBy(final UUID playerId) { - this.placedByPlayerId = playerId; - setChanged(); - } - - protected final Player getFakePlayer(final ServerLevel serverLevel) { - return Platform.INSTANCE.getFakePlayer(serverLevel, placedByPlayerId); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/CableBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/CableBlockEntity.java deleted file mode 100644 index 7594f24bb..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/CableBlockEntity.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; - -import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.block.state.BlockState; - -public class CableBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity { - public CableBlockEntity(final BlockPos pos, final BlockState state) { - super( - BlockEntities.INSTANCE.getCable(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getCable().getEnergyUsage()) - ); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/PlayerAware.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/PlayerAware.java deleted file mode 100644 index 0ba6c42e0..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/PlayerAware.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; - -import java.util.UUID; - -public interface PlayerAware { - void setPlacedBy(UUID playerId); -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/package-info.java deleted file mode 100644 index 4b3c1e0ee..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; - -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/block/entity/destructor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/package-info.java deleted file mode 100644 index 722fc4c9b..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; - -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/block/entity/detector/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/package-info.java deleted file mode 100644 index 9a01ce159..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.detector; - -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/block/entity/diskdrive/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/package-info.java deleted file mode 100644 index 4781627de..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive; - -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/block/entity/exporter/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/package-info.java deleted file mode 100644 index c7c03d927..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.exporter; - -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/block/entity/externalstorage/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/package-info.java deleted file mode 100644 index 54005274b..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage; - -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/block/entity/grid/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/package-info.java deleted file mode 100644 index ac8ae526c..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.grid; - -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/block/entity/iface/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/package-info.java deleted file mode 100644 index 72943d835..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.iface; - -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/block/entity/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/package-info.java deleted file mode 100644 index 2fa61e508..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity; - -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/block/entity/storage/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/package-info.java deleted file mode 100644 index 4c4a038db..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.storage; - -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/block/entity/storagemonitor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/package-info.java deleted file mode 100644 index acaf1c2fe..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; - -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/block/entity/wirelesstransmitter/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java deleted file mode 100644 index feb736764..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; - -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/block/grid/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/package-info.java deleted file mode 100644 index 0518428e0..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.grid; - -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/block/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/package-info.java deleted file mode 100644 index b68a15e67..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block; - -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/block/ticker/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/package-info.java deleted file mode 100644 index 48aa23dc4..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.block.ticker; - -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/configurationcard/ConfigurationCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItem.java new file mode 100644 index 000000000..c61da30ab --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItem.java @@ -0,0 +1,205 @@ +package com.refinedmods.refinedstorage2.platform.common.configurationcard; + +import com.refinedmods.refinedstorage2.platform.api.configurationcard.ConfigurationCardTarget; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; + +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.ChatFormatting; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.StringTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; +import static java.util.Objects.requireNonNull; + +// TODO: textures +public class ConfigurationCardItem extends Item { + private static final Component EMPTY_HELP = createTranslation("item", "configuration_card.empty_help"); + private static final Component CONFIGURED_HELP = createTranslation("item", "configuration_card.configured_help"); + + private static final Component EMPTY = createTranslation("item", "configuration_card.empty") + .withStyle(ChatFormatting.GRAY); + + private static final String TAG_TYPE = "type"; + private static final String TAG_CONFIG = "config"; + private static final String TAG_UPGRADES = "upgrades"; + + public ConfigurationCardItem() { + super(new Item.Properties().stacksTo(1)); + } + + @Override + public InteractionResult useOn(final UseOnContext ctx) { + if (ctx.getLevel().isClientSide() || ctx.getPlayer() == null) { + return InteractionResult.CONSUME; + } + final BlockEntity blockEntity = ctx.getLevel().getBlockEntity(ctx.getClickedPos()); + if (!(blockEntity instanceof ConfigurationCardTarget target)) { + return InteractionResult.CONSUME; + } + final ItemStack stack = ctx.getItemInHand(); + if (stack.getTag() == null) { + writeConfiguration(stack, ctx.getPlayer(), target, blockEntity.getType()); + return InteractionResult.CONSUME; + } + return applyConfiguration(ctx.getPlayer(), blockEntity, target, stack.getTag()); + } + + private InteractionResult applyConfiguration( + final Player player, + final BlockEntity targetBlockEntity, + final ConfigurationCardTarget target, + final CompoundTag tag + ) { + final BlockEntityType existingConfiguredType = getConfiguredType(tag); + if (existingConfiguredType != targetBlockEntity.getType()) { + return configurationCardIsConfiguredForDifferentType(player, existingConfiguredType); + } + target.readConfiguration(tag.getCompound(TAG_CONFIG)); + tryTransferUpgrades(player, target, tag); + targetBlockEntity.setChanged(); + player.sendSystemMessage(createTranslation("item", "configuration_card.applied_configuration")); + return InteractionResult.SUCCESS; + } + + private void tryTransferUpgrades(final Player player, final ConfigurationCardTarget target, final CompoundTag tag) { + final ListTag upgradesTag = tag.getList(TAG_UPGRADES, Tag.TAG_STRING); + for (final Tag upgradeItemTag : upgradesTag) { + final ResourceLocation upgradeItemKey = new ResourceLocation(upgradeItemTag.getAsString()); + final Item upgradeItem = BuiltInRegistries.ITEM.get(upgradeItemKey); + final int upgradeIndexInPlayerInventory = player.getInventory().findSlotMatchingItem( + new ItemStack(upgradeItem) + ); + if (upgradeIndexInPlayerInventory >= 0 && target.addUpgradeItem(upgradeItem)) { + player.getInventory().removeItem(upgradeIndexInPlayerInventory, 1); + } + } + } + + private InteractionResult configurationCardIsConfiguredForDifferentType( + final Player player, + @Nullable final BlockEntityType existingConfiguredType + ) { + if (existingConfiguredType != null) { + player.sendSystemMessage(createTranslation( + "item", + "configuration_card.cannot_apply_configuration", + getConfiguredTypeTranslation(existingConfiguredType).withStyle(ChatFormatting.YELLOW) + )); + } + return InteractionResult.CONSUME; + } + + private void writeConfiguration(final ItemStack stack, + final Player player, + final ConfigurationCardTarget target, + final BlockEntityType type) { + final CompoundTag tag = new CompoundTag(); + tag.putString(TAG_TYPE, requireNonNull(BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(type)).toString()); + tag.put(TAG_CONFIG, createConfigTag(target)); + tag.put(TAG_UPGRADES, createUpgradesTag(target)); + stack.setTag(tag); + sendCopiedConfigurationMessage(player, type); + } + + private CompoundTag createConfigTag(final ConfigurationCardTarget target) { + final CompoundTag tag = new CompoundTag(); + target.writeConfiguration(tag); + return tag; + } + + private ListTag createUpgradesTag(final ConfigurationCardTarget target) { + final ListTag tag = new ListTag(); + target.getUpgradeItems().forEach(item -> { + final ResourceLocation itemKey = BuiltInRegistries.ITEM.getKey(item); + tag.add(StringTag.valueOf(itemKey.toString())); + }); + return tag; + } + + private void sendCopiedConfigurationMessage(final Player player, final BlockEntityType configuredType) { + if (player.level().isClientSide()) { + return; + } + player.sendSystemMessage(createTranslation( + "item", + "configuration_card.copied_configuration", + getConfiguredTypeTranslation(configuredType).withStyle(ChatFormatting.YELLOW) + )); + } + + @Override + public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { + if (player.isCrouching()) { + if (!level.isClientSide()) { + player.sendSystemMessage(createTranslation("item", "configuration_card.cleared_configuration")); + } + return new InteractionResultHolder<>(InteractionResult.CONSUME, new ItemStack(this)); + } + return super.use(level, player, hand); + } + + @Override + public void appendHoverText(final ItemStack stack, + @Nullable final Level level, + final List lines, + final TooltipFlag flag) { + super.appendHoverText(stack, level, lines, flag); + if (stack.getTag() == null) { + lines.add(EMPTY); + return; + } + final BlockEntityType configuredType = getConfiguredType(stack.getTag()); + if (configuredType == null) { + return; + } + lines.add(createTranslation( + "item", + "configuration_card.configured", + getConfiguredTypeTranslation(configuredType).withStyle(ChatFormatting.WHITE) + ).withStyle(ChatFormatting.GRAY)); + } + + @Nullable + private BlockEntityType getConfiguredType(final CompoundTag tag) { + final ResourceLocation type = new ResourceLocation(tag.getString(TAG_TYPE)); + return BuiltInRegistries.BLOCK_ENTITY_TYPE.get(type); + } + + private MutableComponent getConfiguredTypeTranslation(final BlockEntityType type) { + final ResourceLocation typeId = BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(type); + if (typeId == null) { + return Component.empty(); + } + return Component.translatable("block." + typeId.getNamespace() + "." + typeId.getPath()); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(isActive(stack) ? CONFIGURED_HELP : EMPTY_HELP)); + } + + boolean isActive(final ItemStack stack) { + return stack.getTag() != null && stack.getTag().contains(TAG_TYPE); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItemPropertyFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItemPropertyFunction.java new file mode 100644 index 000000000..0da16a8f9 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/ConfigurationCardItemPropertyFunction.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage2.platform.common.configurationcard; + +import javax.annotation.Nullable; + +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; + +public class ConfigurationCardItemPropertyFunction implements ClampedItemPropertyFunction { + public static final ResourceLocation NAME = new ResourceLocation("active"); + + @Override + public float unclampedCall(final ItemStack itemStack, + @Nullable final ClientLevel clientLevel, + @Nullable final LivingEntity livingEntity, + final int i) { + if (itemStack.getItem() instanceof ConfigurationCardItem cardItem) { + return cardItem.isActive(itemStack) ? 1 : 0; + } + return 0; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/package-info.java new file mode 100644 index 000000000..a3c44929c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/configurationcard/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.configurationcard; + +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/block/AbstractConstructorDestructorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/AbstractConstructorDestructorBlock.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractConstructorDestructorBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/AbstractConstructorDestructorBlock.java index 90c819494..9144a29a4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractConstructorDestructorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/AbstractConstructorDestructorBlock.java @@ -1,6 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/AbstractItemConstructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/AbstractItemConstructorStrategy.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/AbstractItemConstructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/AbstractItemConstructorStrategy.java index 5ba56635d..fe58bd497 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/AbstractItemConstructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/AbstractItemConstructorStrategy.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -15,12 +15,12 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public abstract class AbstractItemConstructorStrategy implements ConstructorStrategy { +abstract class AbstractItemConstructorStrategy implements ConstructorStrategy { protected final ServerLevel level; protected final BlockPos pos; protected final Direction direction; - protected AbstractItemConstructorStrategy(final ServerLevel level, final BlockPos pos, final Direction direction) { + AbstractItemConstructorStrategy(final ServerLevel level, final BlockPos pos, final Direction direction) { this.level = level; this.pos = pos; this.direction = direction; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/BlockBreakDestructorStrategy.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/BlockBreakDestructorStrategy.java index d93383b3a..b5c9d79c2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/BlockBreakDestructorStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.core.filter.Filter; @@ -6,10 +6,10 @@ import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.List; import java.util.function.Supplier; @@ -24,13 +24,13 @@ import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockState; -public class BlockBreakDestructorStrategy implements DestructorStrategy { +class BlockBreakDestructorStrategy implements DestructorStrategy { private final ServerLevel level; private final BlockPos pos; private final Direction direction; private final ItemStack tool; - public BlockBreakDestructorStrategy( + BlockBreakDestructorStrategy( final ServerLevel level, final BlockPos pos, final Direction direction, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/BlockBreakDestructorStrategyFactory.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/BlockBreakDestructorStrategyFactory.java index df66a81f9..a6f0c4927 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/BlockBreakDestructorStrategyFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/CompositeConstructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/CompositeConstructorStrategy.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/CompositeConstructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/CompositeConstructorStrategy.java index 170a58150..0b6ef3b36 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/CompositeConstructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/CompositeConstructorStrategy.java @@ -1,18 +1,18 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategy; import java.util.Collections; import java.util.List; import net.minecraft.world.entity.player.Player; -public class CompositeConstructorStrategy implements ConstructorStrategy { +class CompositeConstructorStrategy implements ConstructorStrategy { private final List strategies; - public CompositeConstructorStrategy(final List strategies) { + CompositeConstructorStrategy(final List strategies) { this.strategies = Collections.unmodifiableList(strategies); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/CompositeDestructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/CompositeDestructorStrategy.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/CompositeDestructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/CompositeDestructorStrategy.java index 198467463..1bc13264c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/CompositeDestructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/CompositeDestructorStrategy.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.filter.Filter; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; import java.util.Collections; import java.util.List; @@ -11,10 +11,10 @@ import net.minecraft.world.entity.player.Player; -public class CompositeDestructorStrategy implements DestructorStrategy { +class CompositeDestructorStrategy implements DestructorStrategy { private final List strategies; - public CompositeDestructorStrategy(final List strategies) { + CompositeDestructorStrategy(final List strategies) { this.strategies = Collections.unmodifiableList(strategies); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ConstructorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ConstructorBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java index 0efabbdfb..571c67293 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ConstructorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlock.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java index 104736dc4..335595124 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; @@ -7,14 +7,14 @@ import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractSchedulingNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ConstructorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.ArrayList; import java.util.Collection; @@ -99,24 +99,24 @@ public void postDoWork() { } @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); tag.putBoolean(TAG_DROP_ITEMS, dropItems); } @Override - public void load(final CompoundTag tag) { + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); if (tag.contains(TAG_DROP_ITEMS)) { dropItems = tag.getBoolean(TAG_DROP_ITEMS); } - super.load(tag); } - public boolean isDropItems() { + boolean isDropItems() { return dropItems; } - public void setDropItems(final boolean dropItems) { + void setDropItems(final boolean dropItems) { this.dropItems = dropItems; setChanged(); if (level instanceof ServerLevel serverLevel) { @@ -146,7 +146,13 @@ protected void setTaskExecutor(final TaskExecutor taskExecutor) { this.taskExecutor = taskExecutor; } - public record TaskContext(Network network, Player player) { + @Override + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + return AbstractDirectionalBlock.doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState); + } + + protected record TaskContext(Network network, Player player) { } private class TaskImpl implements Task { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ConstructorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java similarity index 56% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ConstructorContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java index 4430587ba..f27575351 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ConstructorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorContainerMenu.java @@ -1,13 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSchedulingContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.MutableComponent; @@ -30,11 +29,11 @@ public ConstructorContainerMenu(final int syncId, final Inventory playerInventor ); } - public ConstructorContainerMenu(final int syncId, - final Player player, - final ConstructorBlockEntity constructor, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + ConstructorContainerMenu(final int syncId, + final Player player, + final ConstructorBlockEntity constructor, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getConstructor(), syncId, @@ -49,14 +48,14 @@ public ConstructorContainerMenu(final int syncId, @Override protected void registerClientProperties() { super.registerClientProperties(); - registerProperty(new ClientProperty<>(PropertyTypes.CONSTRUCTOR_DROP_ITEMS, false)); + registerProperty(new ClientProperty<>(ConstructorDestructorPropertyTypes.DROP_ITEMS, false)); } @Override protected void registerServerProperties(final ConstructorBlockEntity blockEntity) { super.registerServerProperties(blockEntity); registerProperty(new ServerProperty<>( - PropertyTypes.CONSTRUCTOR_DROP_ITEMS, + ConstructorDestructorPropertyTypes.DROP_ITEMS, blockEntity::isDropItems, blockEntity::setDropItems )); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorDestructorPropertyTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorDestructorPropertyTypes.java new file mode 100644 index 000000000..916ddb1bc --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorDestructorPropertyTypes.java @@ -0,0 +1,18 @@ +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +final class ConstructorDestructorPropertyTypes { + static final PropertyType PICKUP_ITEMS = PropertyTypes.createBooleanProperty( + createIdentifier("pickup_items") + ); + static final PropertyType DROP_ITEMS = PropertyTypes.createBooleanProperty( + createIdentifier("drop_items") + ); + + private ConstructorDestructorPropertyTypes() { + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java new file mode 100644 index 000000000..7efb78943 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorDropItemsSideButtonWidget.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractYesNoSideButtonWidget; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +class ConstructorDropItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { + ConstructorDropItemsSideButtonWidget(final ClientProperty property) { + super(property, createTranslation("gui", "constructor.drop_items")); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 80 : 64; + } + + @Override + protected int getYTexture() { + return 16; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ConstructorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java similarity index 58% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ConstructorScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java index db41127ab..ece31fd5d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ConstructorScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ConstructorScreen.java @@ -1,10 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ConstructorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.ConstructorDropItemsSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.SchedulingModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractFilterScreen; +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.SchedulingModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -25,7 +24,7 @@ protected void init() { )); addSideButton(new SchedulingModeSideButtonWidget(getMenu().getProperty(PropertyTypes.SCHEDULING_MODE))); addSideButton(new ConstructorDropItemsSideButtonWidget( - getMenu().getProperty(PropertyTypes.CONSTRUCTOR_DROP_ITEMS) + getMenu().getProperty(ConstructorDestructorPropertyTypes.DROP_ITEMS) )); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DestructorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DestructorBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java index e60dbdb31..87f40f864 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DestructorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlock.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.DestructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java index f9e4f9aa9..61ed09d6f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.filter.Filter; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; @@ -6,17 +6,17 @@ import com.refinedmods.refinedstorage2.api.network.node.NetworkNodeActor; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractUpgradeableNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterModeSettings; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.DestructorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; import javax.annotation.Nullable; @@ -83,15 +83,16 @@ public void setFilterMode(final FilterMode mode) { } @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(filter.getMode())); tag.putBoolean(TAG_PICKUP_ITEMS, pickupItems); filterWithFuzzyMode.save(tag); } @Override - public void load(final CompoundTag tag) { + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); filterWithFuzzyMode.load(tag); if (tag.contains(TAG_FILTER_MODE)) { filter.setMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE))); @@ -99,7 +100,6 @@ public void load(final CompoundTag tag) { if (tag.contains(TAG_PICKUP_ITEMS)) { pickupItems = tag.getBoolean(TAG_PICKUP_ITEMS); } - super.load(tag); } @Override @@ -152,4 +152,10 @@ public void postDoWork() { final Player fakePlayer = getFakePlayer(serverLevel); strategy.apply(filter, actor, getNode()::getNetwork, fakePlayer); } + + @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/containermenu/DestructorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java similarity index 62% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/DestructorContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java index 0ef3973b4..847c8af6e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/DestructorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorContainerMenu.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.DestructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSimpleFilterContainerMenu; +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; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.MutableComponent; @@ -32,11 +32,11 @@ public DestructorContainerMenu(final int syncId, final Inventory playerInventory ); } - public DestructorContainerMenu(final int syncId, - final Player player, - final DestructorBlockEntity destructor, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + DestructorContainerMenu(final int syncId, + final Player player, + final DestructorBlockEntity destructor, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getDestructor(), syncId, @@ -52,7 +52,7 @@ public DestructorContainerMenu(final int syncId, protected void registerClientProperties() { registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); - registerProperty(new ClientProperty<>(PropertyTypes.DESTRUCTOR_PICKUP_ITEMS, false)); + registerProperty(new ClientProperty<>(ConstructorDestructorPropertyTypes.PICKUP_ITEMS, false)); } @Override @@ -68,7 +68,7 @@ protected void registerServerProperties(final DestructorBlockEntity blockEntity) blockEntity::setFilterMode )); registerProperty(new ServerProperty<>( - PropertyTypes.DESTRUCTOR_PICKUP_ITEMS, + ConstructorDestructorPropertyTypes.PICKUP_ITEMS, blockEntity::isPickupItems, blockEntity::setPickupItems )); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java new file mode 100644 index 000000000..e46532f87 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorPickupItemsSideButtonWidget.java @@ -0,0 +1,22 @@ +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractYesNoSideButtonWidget; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +class DestructorPickupItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { + DestructorPickupItemsSideButtonWidget(final ClientProperty property) { + super(property, createTranslation("gui", "destructor.pickup_items")); + } + + @Override + protected int getXTexture() { + return Boolean.TRUE.equals(property.getValue()) ? 64 : 80; + } + + @Override + protected int getYTexture() { + return 0; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/DestructorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorScreen.java similarity index 62% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/DestructorScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorScreen.java index fa4e8d9ec..c2accdb21 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/DestructorScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/DestructorScreen.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.common.containermenu.DestructorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.DestructorPickupItemsSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FilterModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -24,7 +23,7 @@ protected void init() { createTranslation("gui", "destructor.filter_mode.block.help") )); addSideButton(new DestructorPickupItemsSideButtonWidget( - getMenu().getProperty(PropertyTypes.DESTRUCTOR_PICKUP_ITEMS) + getMenu().getProperty(ConstructorDestructorPropertyTypes.PICKUP_ITEMS) )); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/FluidBreakDestructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/FluidBreakDestructorStrategy.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/FluidBreakDestructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/FluidBreakDestructorStrategy.java index 74f7ec688..5472817f0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/FluidBreakDestructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/FluidBreakDestructorStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.core.filter.Filter; @@ -6,10 +6,10 @@ import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.function.Supplier; @@ -23,11 +23,11 @@ import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.level.material.Fluid; -public class FluidBreakDestructorStrategy implements DestructorStrategy { +class FluidBreakDestructorStrategy implements DestructorStrategy { private final ServerLevel level; private final BlockPos pos; - public FluidBreakDestructorStrategy(final ServerLevel level, final BlockPos pos) { + FluidBreakDestructorStrategy(final ServerLevel level, final BlockPos pos) { this.level = level; this.pos = pos; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/FluidBreakDestructorStrategyFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/FluidBreakDestructorStrategyFactory.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/FluidBreakDestructorStrategyFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/FluidBreakDestructorStrategyFactory.java index b210e9d98..61a70b149 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/FluidBreakDestructorStrategyFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/FluidBreakDestructorStrategyFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemDropConstructorStrategy.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemDropConstructorStrategy.java index c0d23a4d4..d80763679 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemDropConstructorStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -11,10 +11,10 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public class ItemDropConstructorStrategy extends AbstractItemConstructorStrategy { +class ItemDropConstructorStrategy extends AbstractItemConstructorStrategy { private final long amount; - public ItemDropConstructorStrategy( + ItemDropConstructorStrategy( final ServerLevel level, final BlockPos pos, final Direction direction, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemDropConstructorStrategyFactory.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemDropConstructorStrategyFactory.java index 849711b6d..fb4644a0a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemDropConstructorStrategyFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/ItemPickupDestructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemPickupDestructorStrategy.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/ItemPickupDestructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemPickupDestructorStrategy.java index 81eb35d1b..5eb87f603 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/ItemPickupDestructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemPickupDestructorStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.core.filter.Filter; @@ -6,9 +6,9 @@ import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.List; import java.util.function.Supplier; @@ -20,11 +20,11 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.AABB; -public class ItemPickupDestructorStrategy implements DestructorStrategy { +class ItemPickupDestructorStrategy implements DestructorStrategy { private final ServerLevel level; private final BlockPos pos; - public ItemPickupDestructorStrategy(final ServerLevel level, final BlockPos pos) { + ItemPickupDestructorStrategy(final ServerLevel level, final BlockPos pos) { this.level = level; this.pos = pos; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/ItemPickupDestructorStrategyFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemPickupDestructorStrategyFactory.java similarity index 76% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/ItemPickupDestructorStrategyFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemPickupDestructorStrategyFactory.java index b478e0bc8..36b9bc027 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/ItemPickupDestructorStrategyFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/ItemPickupDestructorStrategyFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.destructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.DestructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceBlockConstructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceBlockConstructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java index 78e8bd9c7..b2dd9717f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceBlockConstructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceBlockConstructorStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; import net.minecraft.core.BlockPos; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceFireworksConstructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceFireworksConstructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java index 8f8a4f3b1..98a804750 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceFireworksConstructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceFireworksConstructorStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceFluidConstructorStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceFluidConstructorStrategy.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceFluidConstructorStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceFluidConstructorStrategy.java index a438d72a3..3987a67e1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/PlaceFluidConstructorStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/PlaceFluidConstructorStrategy.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.constructor; +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.constructordestructor.ConstructorStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/package-info.java new file mode 100644 index 000000000..2ea0fb378 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/constructordestructor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.constructordestructor; + +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/containermenu/detector/DetectorAmount.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/DetectorAmount.java deleted file mode 100644 index bfd3a2155..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/DetectorAmount.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.detector; - -public interface DetectorAmount { - long getAmount(); - - void setAmount(long amount); - - void changeAmount(long amount); -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/package-info.java deleted file mode 100644 index 98c102cfb..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.detector; - -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/containermenu/grid/CraftingGridRefillContext.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridRefillContext.java deleted file mode 100644 index 117832b78..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridRefillContext.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; - -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; - -import net.minecraft.world.entity.player.Player; - -public interface CraftingGridRefillContext extends AutoCloseable { - boolean extract(ItemResource resource, Player player); - - @Override - void close(); -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridRefillContextImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridRefillContextImpl.java deleted file mode 100644 index 984af4fc8..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridRefillContextImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; - -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; - -import net.minecraft.world.entity.player.Player; - -public class CraftingGridRefillContextImpl implements CraftingGridRefillContext { - private final CraftingGridBlockEntity blockEntity; - - public CraftingGridRefillContextImpl(final CraftingGridBlockEntity blockEntity) { - this.blockEntity = blockEntity; - } - - @Override - public boolean extract(final ItemResource resource, final Player player) { - return blockEntity.extract(resource, 1, player) == 1; - } - - @Override - public void close() { - // no op - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/package-info.java deleted file mode 100644 index 91ebe8cad..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; - -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/containermenu/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/package-info.java deleted file mode 100644 index d70deab8c..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu; - -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/containermenu/property/PropertyTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/PropertyTypes.java deleted file mode 100644 index 8c2fb5317..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/PropertyTypes.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.property; - -import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; -import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage2.api.storage.AccessMode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AccessModeSettings; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterModeSettings; -import com.refinedmods.refinedstorage2.platform.common.block.entity.RedstoneModeSettings; -import com.refinedmods.refinedstorage2.platform.common.block.entity.SchedulingModeType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.detector.DetectorModeSettings; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; - -import net.minecraft.resources.ResourceLocation; - -import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; - -public final class PropertyTypes { - public static final PropertyType REDSTONE_MODE = new PropertyType<>( - createIdentifier("redstone_mode"), - RedstoneModeSettings::getRedstoneMode, - RedstoneModeSettings::getRedstoneMode - ); - - public static final PropertyType FILTER_MODE = new PropertyType<>( - createIdentifier("filter_mode"), - FilterModeSettings::getFilterMode, - FilterModeSettings::getFilterMode - ); - - public static final PropertyType PRIORITY = integer(createIdentifier("priority")); - - public static final PropertyType ACCESS_MODE = new PropertyType<>( - createIdentifier("access_mode"), - AccessModeSettings::getAccessMode, - AccessModeSettings::getAccessMode - ); - - public static final PropertyType SCHEDULING_MODE = new PropertyType<>( - createIdentifier("scheduling_mode"), - SchedulingModeType::getId, - SchedulingModeType::getById - ); - - public static final PropertyType FUZZY_MODE = bool(createIdentifier("fuzzy_mode")); - - public static final PropertyType DETECTOR_MODE = new PropertyType<>( - createIdentifier("detector_mode"), - DetectorModeSettings::getDetectorMode, - DetectorModeSettings::getDetectorMode - ); - - public static final PropertyType DESTRUCTOR_PICKUP_ITEMS = bool(createIdentifier("pickup_items")); - public static final PropertyType CONSTRUCTOR_DROP_ITEMS = bool(createIdentifier("drop_items")); - - private PropertyTypes() { - } - - private static PropertyType bool(final ResourceLocation id) { - return new PropertyType<>( - id, - value -> Boolean.TRUE.equals(value) ? 1 : 0, - value -> value == 1 - ); - } - - private static PropertyType integer(final ResourceLocation id) { - return new PropertyType<>( - id, - value -> value, - value -> value - ); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/package-info.java deleted file mode 100644 index c1a0e9ed7..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.property; - -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/containermenu/slot/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/package-info.java deleted file mode 100644 index 9565d25b4..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.slot; - -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/containermenu/storage/block/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/package-info.java deleted file mode 100644 index eec7d4ee8..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block; - -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/containermenu/storage/diskdrive/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/package-info.java deleted file mode 100644 index fbb8aeb9d..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive; - -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/containermenu/storage/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/package-info.java deleted file mode 100644 index 7b5605d89..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage; - -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/containermenu/transfer/ResourceInventoryDestination.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/ResourceInventoryDestination.java deleted file mode 100644 index d30945ed6..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/ResourceInventoryDestination.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.transfer; - -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; - -import net.minecraft.world.item.ItemStack; - -public record ResourceInventoryDestination(AbstractResourceContainerMenu destination) - implements TransferDestination { - @Override - public ItemStack transfer(final ItemStack stack) { - destination.addToResourceSlotIfNotExisting(stack); - return null; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/package-info.java deleted file mode 100644 index 7da7737fa..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.containermenu.transfer; - -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/content/BlockColorMap.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockColorMap.java index ccb05c8f0..2d52bb6d0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockColorMap.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockColorMap.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.common.block.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/BlockConstants.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockConstants.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/BlockConstants.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockConstants.java index 661f965f8..8a5daa3aa 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/BlockConstants.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockConstants.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.content; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockBehaviour; 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 2a0bee746..e6ba28b83 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 @@ -1,23 +1,26 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.common.block.entity.CableBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ImporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.constructor.ConstructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.destructor.DestructorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.detector.DetectorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.exporter.ExporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage.ExternalStorageBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.GridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.FluidStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.ItemStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.grid.GridBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlockEntity; +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.externalstorage.ExternalStorageBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlockEntity; import java.util.EnumMap; import java.util.Map; @@ -31,7 +34,7 @@ public final class BlockEntities { public static final BlockEntities INSTANCE = new BlockEntities(); @Nullable - private Supplier> cable; + private Supplier>> cable; @Nullable private Supplier> diskDrive; @Nullable @@ -64,15 +67,21 @@ public final class BlockEntities { private Supplier> wirelessTransmitter; @Nullable private Supplier> storageMonitor; + @Nullable + private Supplier> networkReceiver; + @Nullable + private Supplier> networkTransmitter; private BlockEntities() { } - public BlockEntityType getCable() { + public BlockEntityType> getCable() { return Objects.requireNonNull(cable).get(); } - public void setCable(final Supplier> supplier) { + public void setCable( + final Supplier>> supplier + ) { this.cable = supplier; } @@ -205,4 +214,22 @@ public BlockEntityType getStorageMonitor() { public void setStorageMonitor(final Supplier> supplier) { this.storageMonitor = supplier; } + + public BlockEntityType getNetworkReceiver() { + return Objects.requireNonNull(networkReceiver).get(); + } + + public void setNetworkReceiver(final Supplier> supplier) { + this.networkReceiver = supplier; + } + + public BlockEntityType getNetworkTransmitter() { + return Objects.requireNonNull(networkTransmitter).get(); + } + + public void setNetworkTransmitter( + final Supplier> supplier + ) { + this.networkTransmitter = 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 18c5e28d4..a4697c046 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 @@ -1,26 +1,28 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.common.block.CableBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ConstructorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerType; -import com.refinedmods.refinedstorage2.platform.common.block.DestructorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.DetectorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.DiskDriveBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ExporterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ExternalStorageBlock; -import com.refinedmods.refinedstorage2.platform.common.block.FluidStorageBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ImporterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.InterfaceBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ItemStorageBlock; -import com.refinedmods.refinedstorage2.platform.common.block.SimpleBlock; -import com.refinedmods.refinedstorage2.platform.common.block.StorageMonitorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.WirelessTransmitterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.grid.CraftingGridBlock; -import com.refinedmods.refinedstorage2.platform.common.block.grid.GridBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.ControllerBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlock; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorBlock; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlock; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerType; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlock; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterBlock; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridBlock; +import com.refinedmods.refinedstorage2.platform.common.grid.GridBlock; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlock; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.CableBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; +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.externalstorage.ExternalStorageBlock; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlock; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlock; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlock; +import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlock; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlock; import java.util.EnumMap; import java.util.Map; @@ -117,6 +119,18 @@ public final class Blocks { ContentNames.WIRELESS_TRANSMITTER, COLOR ); + private final BlockColorMap networkReceiver = new BlockColorMap<>( + NetworkReceiverBlock::new, + ContentIds.NETWORK_RECEIVER, + ContentNames.NETWORK_RECEIVER, + COLOR + ); + private final BlockColorMap networkTransmitter = new BlockColorMap<>( + NetworkTransmitterBlock::new, + ContentIds.NETWORK_TRANSMITTER, + ContentNames.NETWORK_TRANSMITTER, + COLOR + ); @Nullable private Supplier quartzEnrichedIronBlock; @@ -240,4 +254,12 @@ public void setStorageMonitor(final Supplier supplier) { public StorageMonitorBlock getStorageMonitor() { return Objects.requireNonNull(storageMonitor).get(); } + + public BlockColorMap getNetworkReceiver() { + return networkReceiver; + } + + public BlockColorMap getNetworkTransmitter() { + return networkTransmitter; + } } 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 cd3f251c8..60a9b1567 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 @@ -1,8 +1,8 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import net.minecraft.resources.ResourceLocation; @@ -48,6 +48,10 @@ public final class ContentIds { public static final ResourceLocation RANGE_UPGRADE = createIdentifier("range_upgrade"); public static final ResourceLocation CREATIVE_RANGE_UPGRADE = createIdentifier("creative_range_upgrade"); public static final ResourceLocation STORAGE_MONITOR = createIdentifier("storage_monitor"); + public static final ResourceLocation CONFIGURATION_CARD = createIdentifier("configuration_card"); + public static final ResourceLocation NETWORK_RECEIVER = createIdentifier("network_receiver"); + public static final ResourceLocation NETWORK_CARD = createIdentifier("network_card"); + public static final ResourceLocation NETWORK_TRANSMITTER = createIdentifier("network_transmitter"); 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 b1ac504ec..f5a5b4e1a 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 @@ -22,6 +22,8 @@ public final class ContentNames { public static final MutableComponent STORAGE_MONITOR = createTranslation("block", "storage_monitor"); public static final MutableComponent INTERFACE = createTranslation("block", "interface"); public static final MutableComponent DISK_DRIVE = createTranslation("block", "disk_drive"); + public static final MutableComponent NETWORK_RECEIVER = createTranslation("block", "network_receiver"); + public static final MutableComponent NETWORK_TRANSMITTER = createTranslation("block", "network_transmitter"); 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 5af4cd217..cce630748 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 @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.common.internal.item.EnergyItemHelperImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyItemHelperImpl; import java.util.Arrays; import java.util.function.Consumer; @@ -47,6 +47,8 @@ private static void appendBlocks(final Consumer consumer) { itemConsumer.accept(Blocks.INSTANCE.getMachineCasing()); itemConsumer.accept(Blocks.INSTANCE.getQuartzEnrichedIronBlock()); itemConsumer.accept(Blocks.INSTANCE.getStorageMonitor()); + Items.INSTANCE.getNetworkTransmitters().stream().map(Supplier::get).forEach(itemConsumer); + Items.INSTANCE.getNetworkReceivers().stream().map(Supplier::get).forEach(itemConsumer); } private static void appendBlockColors(final Consumer consumer, final BlockColorMap map) { @@ -95,5 +97,7 @@ private static void appendItems(final Consumer consumer) { itemConsumer.accept(Items.INSTANCE.getWirelessGrid()); consumer.accept(Items.INSTANCE.getWirelessGrid().createAtEnergyCapacity()); itemConsumer.accept(Items.INSTANCE.getCreativeWirelessGrid()); + itemConsumer.accept(Items.INSTANCE.getConfigurationCard()); + itemConsumer.accept(Items.INSTANCE.getNetworkCard()); } } 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 ba04bd65e..041f44474 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 @@ -14,6 +14,8 @@ public final class DefaultEnergyUsage { 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; public static final long CONTROLLER_CAPACITY = 1000; 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 6734b231a..019ed46b0 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 @@ -1,10 +1,10 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem; -import com.refinedmods.refinedstorage2.platform.common.item.WirelessGridItem; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import java.util.ArrayList; import java.util.Collections; @@ -39,6 +39,8 @@ public final class Items { private final List> allDestructors = new ArrayList<>(); private final List> allConstructors = new ArrayList<>(); private final List> allWirelessTransmitters = new ArrayList<>(); + private final List> allNetworkReceivers = new ArrayList<>(); + private final List> allNetworkTransmitters = new ArrayList<>(); @Nullable private Supplier quartzEnrichedIron; @Nullable @@ -78,6 +80,10 @@ public final class Items { private Supplier wirelessGrid; @Nullable private Supplier creativeWirelessGrid; + @Nullable + private Supplier configurationCard; + @Nullable + private Supplier networkCard; private Items() { } @@ -353,4 +359,36 @@ public WirelessGridItem getCreativeWirelessGrid() { public void setCreativeWirelessGrid(final Supplier supplier) { this.creativeWirelessGrid = supplier; } + + public Item getConfigurationCard() { + return Objects.requireNonNull(configurationCard).get(); + } + + public void setConfigurationCard(final Supplier supplier) { + this.configurationCard = supplier; + } + + public void addNetworkReceiver(final Supplier supplier) { + allNetworkReceivers.add(supplier); + } + + public List> getNetworkReceivers() { + return Collections.unmodifiableList(allNetworkReceivers); + } + + public void addNetworkTransmitter(final Supplier supplier) { + allNetworkTransmitters.add(supplier); + } + + public List> getNetworkTransmitters() { + return Collections.unmodifiableList(allNetworkTransmitters); + } + + public Item getNetworkCard() { + return Objects.requireNonNull(networkCard).get(); + } + + public void setNetworkCard(final Supplier supplier) { + this.networkCard = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java index 4cc4029e7..901b772ec 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java @@ -9,6 +9,7 @@ public interface MenuTypeFactory { MenuType create(MenuSupplier supplier); + @FunctionalInterface interface MenuSupplier { T create(int syncId, Inventory playerInventory, FriendlyByteBuf data); } 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 671b2ba41..d737dcb21 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 @@ -1,22 +1,23 @@ package com.refinedmods.refinedstorage2.platform.common.content; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ConstructorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.DestructorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ExporterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ImporterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.InterfaceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.RegulatorUpgradeContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.StorageMonitorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.detector.DetectorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.GridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.WirelessGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.ExternalStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.FluidStorageBlockContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.ItemStorageBlockContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive.DiskDriveContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.GridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.ItemStorageBlockContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import java.util.Objects; import java.util.function.Supplier; @@ -61,6 +62,8 @@ public final class Menus { private Supplier> wirelessTransmitter; @Nullable private Supplier> storageMonitor; + @Nullable + private Supplier> networkTransmitter; private Menus() { } @@ -200,4 +203,12 @@ public MenuType getStorageMonitor() { public void setStorageMonitor(final Supplier> supplier) { this.storageMonitor = supplier; } + + public MenuType getNetworkTransmitter() { + return Objects.requireNonNull(networkTransmitter).get(); + } + + public void setNetworkTransmitter(final Supplier> supplier) { + this.networkTransmitter = supplier; + } } 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 658435383..be33cae1e 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 @@ -21,6 +21,8 @@ public final class Tags { public static final TagKey CONSTRUCTORS = createTag("constructors"); public static final TagKey DESTRUCTORS = createTag("destructors"); public static final TagKey WIRELESS_TRANSMITTERS = createTag("wireless_transmitters"); + public static final TagKey NETWORK_RECEIVERS = createTag("network_receivers"); + public static final TagKey NETWORK_TRANSMITTERS = createTag("network_transmitters"); private Tags() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlock.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlock.java index c07cf8318..be41270c2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlock.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.controller; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.ControllerBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.ControllerBlockItem; -import com.refinedmods.refinedstorage2.platform.common.item.block.CreativeControllerBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java index f45ad0545..b7e8d79ed 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java @@ -1,18 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage2.platform.api.blockentity.EnergyBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyBlockEntity; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerEnergyType; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.energy.CreativeEnergyStorage; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.energy.BlockEntityEnergyStorage; +import com.refinedmods.refinedstorage2.platform.common.support.energy.CreativeEnergyStorage; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; @@ -29,7 +27,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ControllerBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity +public class ControllerBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements ExtendedMenuProvider, EnergyBlockEntity { private static final Logger LOGGER = LoggerFactory.getLogger(ControllerBlockEntity.class); @@ -64,23 +62,16 @@ private static BlockEntityType getBlockEntityType(final C } public void updateEnergyTypeInLevel(final BlockState state) { - final ControllerEnergyType currentEnergyType = ControllerEnergyType.ofState(getNode().getState()); - final ControllerEnergyType inLevelEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); - - if (currentEnergyType != inLevelEnergyType && energyStateChangeRateLimiter.tryAcquire()) { + final ControllerEnergyType currentEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); + final ControllerEnergyType newEnergyType = ControllerEnergyType.ofState(getNode().getState()); + if (newEnergyType != currentEnergyType && level != null && energyStateChangeRateLimiter.tryAcquire()) { LOGGER.debug( "Energy type state change for controller at {}: {} -> {}", getBlockPos(), - inLevelEnergyType, - currentEnergyType + currentEnergyType, + newEnergyType ); - updateEnergyTypeInLevel(state, currentEnergyType); - } - } - - private void updateEnergyTypeInLevel(final BlockState state, final ControllerEnergyType energyType) { - if (level != null) { - level.setBlockAndUpdate(getBlockPos(), state.setValue(ControllerBlock.ENERGY_TYPE, energyType)); + level.setBlockAndUpdate(getBlockPos(), state.setValue(ControllerBlock.ENERGY_TYPE, newEnergyType)); } } @@ -119,11 +110,11 @@ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByte buf.writeLong(getActualCapacity()); } - public long getActualStored() { + long getActualStored() { return getNode().getActualStored(); } - public long getActualCapacity() { + long getActualCapacity() { return getNode().getActualCapacity(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/ControllerBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/ControllerBlockEntityTicker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java index fc386bf8f..dfdba5164 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/ControllerBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntityTicker.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.ticker; +package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.api.network.impl.node.controller.ControllerNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockItem.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockItem.java index c03d60f9d..034a7f446 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockItem.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.item.block; +package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.network.impl.energy.EnergyStorageImpl; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractEnergyBlockItem; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractEnergyBlockItem; import com.refinedmods.refinedstorage2.platform.common.Platform; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ControllerContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ControllerContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java index 571c184a5..dd6f8497a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ControllerContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerContainerMenu.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +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; import javax.annotation.Nullable; @@ -38,10 +38,10 @@ public ControllerContainerMenu(final int syncId, final Inventory playerInventory registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } - public ControllerContainerMenu(final int syncId, - final Inventory playerInventory, - final ControllerBlockEntity controller, - final Player playerEntity) { + ControllerContainerMenu(final int syncId, + final Inventory playerInventory, + final ControllerBlockEntity controller, + final Player playerEntity) { super(Menus.INSTANCE.getController(), syncId); this.controller = controller; @@ -80,11 +80,11 @@ public void setEnergyInfo(final long newStored, final long newCapacity) { this.capacity = newCapacity; } - public long getStored() { + long getStored() { return stored; } - public long getCapacity() { + long getCapacity() { return capacity; } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerEnergyType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerEnergyType.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerEnergyType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerEnergyType.java index ccd5c7044..bf11163a6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ControllerEnergyType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerEnergyType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.api.network.impl.node.controller.ControllerEnergyState; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/ControllerModelPredicateProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerModelPredicateProvider.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/ControllerModelPredicateProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerModelPredicateProvider.java index 550c33368..bcf8ceaa8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/ControllerModelPredicateProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerModelPredicateProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.render.model; +package com.refinedmods.refinedstorage2.platform.common.controller; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ControllerScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerScreen.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ControllerScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerScreen.java index e7b023401..424a3624c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ControllerScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerScreen.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.controller; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.ProgressWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; +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.ProgressWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; import java.util.Collections; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerType.java new file mode 100644 index 000000000..42f02035e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerType.java @@ -0,0 +1,6 @@ +package com.refinedmods.refinedstorage2.platform.common.controller; + +public enum ControllerType { + NORMAL, + CREATIVE +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/CreativeControllerBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/CreativeControllerBlockItem.java similarity index 56% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/CreativeControllerBlockItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/CreativeControllerBlockItem.java index 5277f6c32..6315648cf 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/CreativeControllerBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/CreativeControllerBlockItem.java @@ -1,4 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item.block; +package com.refinedmods.refinedstorage2.platform.common.controller; + +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; import net.minecraft.network.chat.Component; import net.minecraft.world.item.Item; @@ -6,8 +8,8 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class CreativeControllerBlockItem extends NamedBlockItem { - public CreativeControllerBlockItem(final Block block, final Component name) { +class CreativeControllerBlockItem extends NamedBlockItem { + CreativeControllerBlockItem(final Block block, final Component name) { super(block, new Item.Properties().stacksTo(1), name, createTranslation("item", "creative_controller.help")); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/package-info.java new file mode 100644 index 000000000..2b5a97d76 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.controller; + +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/block/DetectorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DetectorBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java index 62673529b..bfd2e98d8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DetectorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlock.java @@ -1,14 +1,17 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.detector; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionTypeImpl; -import com.refinedmods.refinedstorage2.platform.common.block.entity.detector.DetectorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; 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.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/DetectorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java similarity index 69% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/DetectorBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java index 98afeed4f..1605f68dd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/DetectorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorBlockEntity.java @@ -1,21 +1,21 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.detector; +package com.refinedmods.refinedstorage2.platform.common.detector; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorAmountStrategy; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorAmountStrategyImpl; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorMode; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorNetworkNode; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.DetectorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractSingleAmountContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.detector.DetectorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class DetectorBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity +public class DetectorBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements ExtendedMenuProvider { private static final Logger LOGGER = LoggerFactory.getLogger(DetectorBlockEntity.class); @@ -64,17 +64,17 @@ public DetectorBlockEntity(final BlockPos pos, final BlockState state) { initialize(); } - @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); filter.save(tag); tag.putDouble(TAG_AMOUNT, amount); tag.putInt(TAG_MODE, DetectorModeSettings.getDetectorMode(getNode().getMode())); } @Override - public void load(final CompoundTag tag) { + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); filter.load(tag); if (tag.contains(TAG_AMOUNT)) { this.amount = tag.getDouble(TAG_AMOUNT); @@ -84,10 +84,9 @@ public void load(final CompoundTag tag) { } initialize(); propagateAmount(); - super.load(tag); } - public void setAmount(final double amount) { + void setAmount(final double amount) { this.amount = amount; propagateAmount(); setChanged(); @@ -102,25 +101,21 @@ private void propagateAmount() { getNode().setAmount(normalizedAmount); } - public double getAmount() { - return amount; - } - - public boolean isFuzzyMode() { + boolean isFuzzyMode() { return filter.isFuzzyMode(); } - public void setFuzzyMode(final boolean fuzzyMode) { + void setFuzzyMode(final boolean fuzzyMode) { filter.setFuzzyMode(fuzzyMode); initialize(); } - public void setMode(final DetectorMode mode) { + void setMode(final DetectorMode mode) { getNode().setMode(mode); setChanged(); } - public DetectorMode getMode() { + DetectorMode getMode() { return getNode().getMode(); } @@ -159,23 +154,34 @@ public void updateActiveness(final BlockState state, @Nullable final BooleanProp } @Override - public boolean canAcceptIncomingConnection(final Direction direction, final BlockState other) { - if (!colorsAllowConnecting(other)) { + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction myDirection = getDirection(); + if (myDirection == null) { + return; + } + for (final Direction direction : Direction.values()) { + if (direction == myDirection.getOpposite()) { + continue; + } + sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { return false; } final Direction myDirection = getDirection(); if (myDirection != null) { - return myDirection != direction; + return myDirection != incomingDirection.getOpposite(); } return true; } @Override - public boolean canPerformOutgoingConnection(final Direction direction) { - final Direction myDirection = getDirection(); - if (myDirection == null) { - return true; - } - return myDirection != direction.getOpposite(); + 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/containermenu/detector/DetectorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java similarity index 61% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/DetectorContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java index 973507fde..b223acf9f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/detector/DetectorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorContainerMenu.java @@ -1,13 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.detector; +package com.refinedmods.refinedstorage2.platform.common.detector; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.detector.DetectorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractSingleAmountContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; +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; import javax.annotation.Nullable; @@ -27,13 +26,13 @@ public class DetectorContainerMenu extends AbstractSingleAmountContainerMenu { public DetectorContainerMenu(final int syncId, final Inventory playerInventory, final FriendlyByteBuf buf) { super(Menus.INSTANCE.getDetector(), syncId, playerInventory, buf, FILTER_HELP); registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); - registerProperty(new ClientProperty<>(PropertyTypes.DETECTOR_MODE, DetectorMode.EQUAL)); + registerProperty(new ClientProperty<>(DetectorPropertyTypes.MODE, DetectorMode.EQUAL)); } - public DetectorContainerMenu(final int syncId, - final Player player, - final DetectorBlockEntity detector, - final ResourceContainer resourceContainer) { + DetectorContainerMenu(final int syncId, + final Player player, + final DetectorBlockEntity detector, + final ResourceContainer resourceContainer) { super(Menus.INSTANCE.getDetector(), syncId, player, resourceContainer, FILTER_HELP, null); this.detector = detector; registerProperty(new ServerProperty<>( @@ -42,7 +41,7 @@ public DetectorContainerMenu(final int syncId, detector::setFuzzyMode )); registerProperty(new ServerProperty<>( - PropertyTypes.DETECTOR_MODE, + DetectorPropertyTypes.MODE, detector::getMode, detector::setMode )); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/DetectorModeSettings.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/DetectorModeSettings.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java index 773a768d6..424d61285 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/DetectorModeSettings.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSettings.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.detector; +package com.refinedmods.refinedstorage2.platform.common.detector; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorMode; -public final class DetectorModeSettings { +final class DetectorModeSettings { private static final int UNDER = 0; private static final int EQUAL = 1; private static final int ABOVE = 2; @@ -10,7 +10,7 @@ public final class DetectorModeSettings { private DetectorModeSettings() { } - public static DetectorMode getDetectorMode(final int detectorMode) { + static DetectorMode getDetectorMode(final int detectorMode) { return switch (detectorMode) { case UNDER -> DetectorMode.UNDER; case EQUAL -> DetectorMode.EQUAL; @@ -19,7 +19,7 @@ public static DetectorMode getDetectorMode(final int detectorMode) { }; } - public static int getDetectorMode(final DetectorMode detectorMode) { + static int getDetectorMode(final DetectorMode detectorMode) { return switch (detectorMode) { case UNDER -> UNDER; case EQUAL -> EQUAL; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/DetectorModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSideButtonWidget.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/DetectorModeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSideButtonWidget.java index 58559075b..d2dd7292f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/DetectorModeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorModeSideButtonWidget.java @@ -1,13 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.detector; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class DetectorModeSideButtonWidget extends AbstractSideButtonWidget { +class DetectorModeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "detector.mode"); private static final MutableComponent SUBTEXT_EQUAL = createTranslation("gui", "detector.mode.equal"); private static final MutableComponent SUBTEXT_ABOVE = createTranslation("gui", "detector.mode.above"); @@ -15,7 +16,7 @@ public class DetectorModeSideButtonWidget extends AbstractSideButtonWidget { private final ClientProperty property; - public DetectorModeSideButtonWidget(final ClientProperty property) { + DetectorModeSideButtonWidget(final ClientProperty property) { super(createPressAction(property)); this.property = property; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorPropertyTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorPropertyTypes.java new file mode 100644 index 000000000..e38d66f83 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorPropertyTypes.java @@ -0,0 +1,17 @@ +package com.refinedmods.refinedstorage2.platform.common.detector; + +import com.refinedmods.refinedstorage2.api.network.impl.node.detector.DetectorMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +final class DetectorPropertyTypes { + static final PropertyType MODE = new PropertyType<>( + createIdentifier("detector_mode"), + DetectorModeSettings::getDetectorMode, + DetectorModeSettings::getDetectorMode + ); + + private DetectorPropertyTypes() { + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/DetectorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java similarity index 57% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/DetectorScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java index f631c035f..b58ac5c46 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/DetectorScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/DetectorScreen.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.detector; -import com.refinedmods.refinedstorage2.platform.common.containermenu.detector.DetectorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.DetectorModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.amount.AbstractSingleAmountScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FuzzyModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -20,6 +19,6 @@ protected void init() { getMenu().getProperty(PropertyTypes.FUZZY_MODE), FuzzyModeSideButtonWidget.Type.GENERIC )); - addSideButton(new DetectorModeSideButtonWidget(getMenu().getProperty(PropertyTypes.DETECTOR_MODE))); + addSideButton(new DetectorModeSideButtonWidget(getMenu().getProperty(DetectorPropertyTypes.MODE))); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/FuzzyDetectorAmountStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/FuzzyDetectorAmountStrategy.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/FuzzyDetectorAmountStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/FuzzyDetectorAmountStrategy.java index 49ce60812..9372be618 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/detector/FuzzyDetectorAmountStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/FuzzyDetectorAmountStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.detector; +package com.refinedmods.refinedstorage2.platform.common.detector; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.impl.node.detector.AbstractDetectorAmountStrategy; @@ -8,10 +8,10 @@ import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; import com.refinedmods.refinedstorage2.platform.api.storage.channel.FuzzyStorageChannel; -public class FuzzyDetectorAmountStrategy extends AbstractDetectorAmountStrategy { +class FuzzyDetectorAmountStrategy extends AbstractDetectorAmountStrategy { private final DetectorAmountStrategy fallback; - public FuzzyDetectorAmountStrategy(final DetectorAmountStrategy fallback) { + FuzzyDetectorAmountStrategy(final DetectorAmountStrategy fallback) { this.fallback = fallback; } diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/package-info.java similarity index 76% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/package-info.java index a43fa36d6..661d9457a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/detector/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.blockentity; +package com.refinedmods.refinedstorage2.platform.common.detector; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/AbstractFuzzyExporterTransferStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/AbstractFuzzyExporterTransferStrategy.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/AbstractFuzzyExporterTransferStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/AbstractFuzzyExporterTransferStrategy.java index f3f6401fb..b2ec80ad9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/AbstractFuzzyExporterTransferStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/AbstractFuzzyExporterTransferStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.network.node; +package com.refinedmods.refinedstorage2.platform.common.exporter; import com.refinedmods.refinedstorage2.api.network.impl.node.exporter.AbstractExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ExporterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ExporterBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java index 3377851ea..2d16dcafd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ExporterBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlock.java @@ -1,12 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.exporter; -import com.refinedmods.refinedstorage2.platform.common.block.entity.exporter.ExporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java index 1dd5071d4..6c8f755dd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterBlockEntity.java @@ -1,19 +1,19 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.exporter; +package com.refinedmods.refinedstorage2.platform.common.exporter; import com.refinedmods.refinedstorage2.api.network.impl.node.exporter.CompositeExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.impl.node.exporter.ExporterNetworkNode; import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractSchedulingNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ExporterContainerMenu; 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.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; import java.util.function.LongSupplier; @@ -117,4 +117,10 @@ private long getAmountStillNeeded(final long amount, final long currentAmount, f } return Math.min(stillNeeding, amount); } + + @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/containermenu/ExporterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java similarity index 59% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ExporterContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java index d2855e04a..072995098 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ExporterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterContainerMenu.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.exporter; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.exporter.ExporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSchedulingContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.MutableComponent; @@ -27,11 +27,11 @@ public ExporterContainerMenu(final int syncId, final Inventory playerInventory, ); } - public ExporterContainerMenu(final int syncId, - final Player player, - final ExporterBlockEntity exporter, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + ExporterContainerMenu(final int syncId, + final Player player, + final ExporterBlockEntity exporter, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getExporter(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ExporterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java similarity index 62% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ExporterScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java index 3b1f0056a..16bd5ea65 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ExporterScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/ExporterScreen.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.exporter; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ExporterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.SchedulingModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractFilterScreen; +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.SchedulingModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/package-info.java similarity index 76% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/package-info.java index 0161aed3b..9765c7b93 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/integration/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/exporter/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.integration; +package com.refinedmods.refinedstorage2.platform.common.exporter; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/AbstractGridBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/AbstractGridBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java index 27aa3852c..e1747fe9c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/AbstractGridBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlock.java @@ -1,16 +1,14 @@ - -package com.refinedmods.refinedstorage2.platform.common.block.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.common.block.AbstractDirectionalBlock; -import com.refinedmods.refinedstorage2.platform.common.block.BlockConstants; -import com.refinedmods.refinedstorage2.platform.common.block.BlockItemProvider; -import com.refinedmods.refinedstorage2.platform.common.block.ColorableBlock; -import com.refinedmods.refinedstorage2.platform.common.block.direction.BiDirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; -import com.refinedmods.refinedstorage2.platform.common.menu.GridExtendedMenuProvider; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +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; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/AbstractGridBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/AbstractGridBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java index 0c252a86d..ff94c75b5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/AbstractGridBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.grid.GridWatcher; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; @@ -12,10 +12,11 @@ import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; import java.util.List; import java.util.Objects; @@ -25,7 +26,8 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -public abstract class AbstractGridBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity +public abstract class AbstractGridBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements Grid, MenuProvider { protected AbstractGridBlockEntity(final BlockEntityType type, final BlockPos pos, @@ -55,7 +57,7 @@ public GridOperations createOperations(final PlatformStorageChannelType boolean onExtract(final PlatformStorageChannelType storageChannelT final T resource, final GridExtractMode extractMode, final boolean cursor) { - if (grid != null && !grid.isActive()) { + if (grid != null && !grid.isGridActive()) { return false; } return extractionStrategy.onExtract(storageChannelType, resource, extractMode, cursor); @@ -411,7 +408,7 @@ public boolean onScroll(final PlatformStorageChannelType storageChannelTy final T resource, final GridScrollMode scrollMode, final int slotIndex) { - if (grid != null && !grid.isActive()) { + if (grid != null && !grid.isGridActive()) { return false; } return scrollingStrategy.onScroll(storageChannelType, resource, scrollMode, slotIndex); @@ -424,7 +421,7 @@ public boolean onTransfer(final int slotIndex) { @Override public ItemStack quickMoveStack(final Player playerEntity, final int slotIndex) { - if (!playerEntity.level().isClientSide() && grid != null && grid.isActive()) { + if (!playerEntity.level().isClientSide() && grid != null && grid.isGridActive()) { final Slot slot = getSlot(slotIndex); if (slot.hasItem()) { insertionStrategy.onTransfer(slot.index); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/AbstractGridSynchronizer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridSynchronizer.java similarity index 72% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/AbstractGridSynchronizer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridSynchronizer.java index 0363fd554..9aa55136a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/AbstractGridSynchronizer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/AbstractGridSynchronizer.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/ClientCraftingGridSource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/ClientCraftingGridSource.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/ClientCraftingGridSource.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/ClientCraftingGridSource.java index c2f7e17ad..00e270207 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/ClientCraftingGridSource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/ClientCraftingGridSource.java @@ -1,8 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingMatrix; import java.util.List; @@ -11,11 +10,11 @@ import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.item.ItemStack; -public class ClientCraftingGridSource implements CraftingGridSource { +class ClientCraftingGridSource implements CraftingGridSource { private final CraftingMatrix craftingMatrix; private final ResultContainer craftingResult; - public ClientCraftingGridSource() { + ClientCraftingGridSource() { this.craftingMatrix = new CraftingMatrix(null); this.craftingResult = new ResultContainer(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/CraftingGridBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/CraftingGridBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java index 3b6765ba4..a22c8e193 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/CraftingGridBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlock.java @@ -1,13 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.block.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; -import com.refinedmods.refinedstorage2.platform.common.block.BlockItemProvider; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingGridBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingGridBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java index 54900e49e..bc2381b2f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingGridBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridBlockEntity.java @@ -1,18 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridNetworkNode; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import com.refinedmods.refinedstorage2.platform.common.util.ContainerUtil; import java.util.Optional; @@ -83,15 +81,15 @@ private CraftingRecipe loadRecipe(final Level level) { .orElse(null); } - public CraftingMatrix getCraftingMatrix() { + CraftingMatrix getCraftingMatrix() { return craftingMatrix; } - public ResultContainer getCraftingResult() { + ResultContainer getCraftingResult() { return craftingResult; } - public NonNullList getRemainingItems(final Player player) { + NonNullList getRemainingItems(final Player player) { if (level == null || currentRecipe == null) { return NonNullList.create(); } @@ -129,7 +127,7 @@ public void setLevel(final Level level) { setOutputSilently(level); } - public Optional getNetwork() { + Optional getNetwork() { final GridNetworkNode node = getNode(); if (!node.isActive()) { return Optional.empty(); @@ -137,13 +135,13 @@ public Optional getNetwork() { return Optional.ofNullable(node.getNetwork()); } - public Optional> getStorageChannel() { + Optional> getStorageChannel() { return getNetwork().map(network -> network .getComponent(StorageNetworkComponent.class) .getStorageChannel(StorageChannelTypes.ITEM)); } - public ItemStack insert(final ItemStack stack, final Player player) { + ItemStack insert(final ItemStack stack, final Player player) { return getStorageChannel().map(storageChannel -> doInsert(stack, player, storageChannel)).orElse(stack); } @@ -163,10 +161,10 @@ private ItemStack doInsert(final ItemStack stack, return stack.copyWithCount((int) remainder); } - public long extract(final ItemResource resource, final long amount, final Player player) { + long extract(final ItemResource resource, final Player player) { return getStorageChannel().map(storageChannel -> storageChannel.extract( resource, - amount, + 1, Action.EXECUTE, new PlayerActor(player) )).orElse(0L); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java index d7bec2098..1c9b31ba5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridContainerMenu.java @@ -1,15 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.ItemGridResource; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +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; import java.util.ArrayList; import java.util.HashSet; @@ -46,9 +45,9 @@ public CraftingGridContainerMenu(final int syncId, final Inventory playerInvento registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } - public CraftingGridContainerMenu(final int syncId, - final Inventory playerInventory, - final CraftingGridBlockEntity grid) { + CraftingGridContainerMenu(final int syncId, + final Inventory playerInventory, + final CraftingGridBlockEntity grid) { super(Menus.INSTANCE.getCraftingGrid(), syncId, playerInventory, grid); this.source = new CraftingGridSourceImpl(grid); this.player = playerInventory.player; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CraftingGridMatrixCloseBehavior.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridMatrixCloseBehavior.java similarity index 59% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CraftingGridMatrixCloseBehavior.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridMatrixCloseBehavior.java index 4ea51c0d9..f1d9649b0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CraftingGridMatrixCloseBehavior.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridMatrixCloseBehavior.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; public enum CraftingGridMatrixCloseBehavior { NONE, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContext.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContext.java new file mode 100644 index 000000000..58cf18369 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContext.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage2.platform.common.grid; + +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; + +import net.minecraft.world.entity.player.Player; + +interface CraftingGridRefillContext extends AutoCloseable { + boolean extract(ItemResource resource, Player player); + + @Override + void close(); +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java new file mode 100644 index 000000000..e3461da2a --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridRefillContextImpl.java @@ -0,0 +1,23 @@ +package com.refinedmods.refinedstorage2.platform.common.grid; + +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; + +import net.minecraft.world.entity.player.Player; + +class CraftingGridRefillContextImpl implements CraftingGridRefillContext { + private final CraftingGridBlockEntity blockEntity; + + CraftingGridRefillContextImpl(final CraftingGridBlockEntity blockEntity) { + this.blockEntity = blockEntity; + } + + @Override + public boolean extract(final ItemResource resource, final Player player) { + return blockEntity.extract(resource, player) == 1; + } + + @Override + public void close() { + // no op + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridResultSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridResultSlot.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java index 4fcae14dd..f229f191b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridResultSlot.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridResultSlot.java @@ -1,8 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingMatrix; import java.util.List; @@ -12,13 +11,13 @@ import net.minecraft.world.inventory.ResultSlot; import net.minecraft.world.item.ItemStack; -public class CraftingGridResultSlot extends ResultSlot { +class CraftingGridResultSlot extends ResultSlot { private final CraftingGridSource source; - public CraftingGridResultSlot(final Player player, - final CraftingGridSource source, - final int x, - final int y) { + CraftingGridResultSlot(final Player player, + final CraftingGridSource source, + final int x, + final int y) { super(player, source.getCraftingMatrix(), source.getCraftingResult(), 0, x, y); this.source = source; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridSource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSource.java similarity index 71% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridSource.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSource.java index 5ba2331b1..9b463fa97 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridSource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSource.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingMatrix; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import java.util.List; @@ -10,7 +9,7 @@ import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.item.ItemStack; -public interface CraftingGridSource { +interface CraftingGridSource { CraftingMatrix getCraftingMatrix(); ResultContainer getCraftingResult(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridSourceImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridSourceImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java index 20375687a..f98f16e78 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/CraftingGridSourceImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingGridSourceImpl.java @@ -1,13 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingMatrix; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Comparator; import java.util.List; @@ -17,10 +15,10 @@ import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.item.ItemStack; -public class CraftingGridSourceImpl implements CraftingGridSource { +class CraftingGridSourceImpl implements CraftingGridSource { private final CraftingGridBlockEntity blockEntity; - public CraftingGridSourceImpl(final CraftingGridBlockEntity blockEntity) { + CraftingGridSourceImpl(final CraftingGridBlockEntity blockEntity) { this.blockEntity = blockEntity; } @@ -105,7 +103,7 @@ public void transferRecipe(final Player player, final List> r private void doTransferRecipe(final int index, final List sortedPossibilities, final Player player) { for (final ItemResource possibility : sortedPossibilities) { - boolean extracted = blockEntity.extract(possibility, 1, player) == 1; + boolean extracted = blockEntity.extract(possibility, player) == 1; if (!extracted) { extracted = extractFromPlayerInventory(player, possibility); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingMatrix.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingMatrix.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java index c6ec81cdc..c314072f2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingMatrix.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrix.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import javax.annotation.Nullable; @@ -13,7 +13,7 @@ public CraftingMatrix(@Nullable final Runnable listener) { this.listener = listener; } - public void changed() { + void changed() { if (listener != null) { listener.run(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingMatrixContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrixContainerMenu.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingMatrixContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrixContainerMenu.java index 52534f587..ee2f926d1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/CraftingMatrixContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/CraftingMatrixContainerMenu.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/GridBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/GridBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java index 90cdff0fb..55a7c9ca8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/grid/GridBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlock.java @@ -1,13 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.block.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; -import com.refinedmods.refinedstorage2.platform.common.block.BlockItemProvider; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.GridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/GridBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlockEntity.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/GridBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlockEntity.java index 5a31f7b21..4f51fb385 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/grid/GridBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridBlockEntity.java @@ -1,8 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.GridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/GridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java similarity index 56% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/GridContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java index f51e0d5b6..e2d5eb918 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/GridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridContainerMenu.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.GridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +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; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Inventory; @@ -17,7 +16,7 @@ public GridContainerMenu(final int syncId, final Inventory playerInventory, fina registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } - public GridContainerMenu(final int syncId, final Inventory playerInventory, final GridBlockEntity grid) { + GridContainerMenu(final int syncId, final Inventory playerInventory, final GridBlockEntity grid) { super(Menus.INSTANCE.getGrid(), syncId, playerInventory, grid); addSlots(0); registerProperty(new ServerProperty<>( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/GridExtendedMenuProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridExtendedMenuProvider.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/GridExtendedMenuProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridExtendedMenuProvider.java index 364ec831b..c29c3e4d0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/GridExtendedMenuProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridExtendedMenuProvider.java @@ -1,10 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.menu; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.storage.TrackedResourceAmount; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.List; @@ -19,14 +20,14 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -public class GridExtendedMenuProvider implements ExtendedMenuProvider { +class GridExtendedMenuProvider implements ExtendedMenuProvider { private final Grid grid; private final PlatformRegistry> storageChannelTypeRegistry; private final MenuProvider menuProvider; - public GridExtendedMenuProvider(final Grid grid, - final PlatformRegistry> storageChannelTypeRegistry, - final MenuProvider menuProvider) { + GridExtendedMenuProvider(final Grid grid, + final PlatformRegistry> storageChannelTypeRegistry, + final MenuProvider menuProvider) { this.grid = grid; this.storageChannelTypeRegistry = storageChannelTypeRegistry; this.menuProvider = menuProvider; @@ -34,7 +35,7 @@ public GridExtendedMenuProvider(final Grid grid, @Override public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { - buf.writeBoolean(grid.isActive()); + buf.writeBoolean(grid.isGridActive()); final List> types = storageChannelTypeRegistry.getAll(); buf.writeInt(types.size()); types.forEach(type -> writeStorageChannel(type, buf)); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridSearchBox.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSearchBox.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridSearchBox.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSearchBox.java index b91b3a9f9..b056cd3be 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridSearchBox.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSearchBox.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import java.util.function.Consumer; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSize.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSize.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSize.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSize.java index 12ed6c0fa..f045e4881 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSize.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSize.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; public enum GridSize { STRETCH, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSortingTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSortingTypes.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSortingTypes.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSortingTypes.java index 1b08553ba..97cfd835d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSortingTypes.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSortingTypes.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; import com.refinedmods.refinedstorage2.api.grid.view.GridSortingType; import com.refinedmods.refinedstorage2.api.grid.view.GridView; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage2.platform.api.grid.PlatformGridResource; +import com.refinedmods.refinedstorage2.platform.api.grid.view.PlatformGridResource; import java.util.Comparator; import java.util.function.Function; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/NoOpGridSynchronizer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/NoOpGridSynchronizer.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/NoOpGridSynchronizer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/NoOpGridSynchronizer.java index 9dbfd0af3..e7915548d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/NoOpGridSynchronizer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/NoOpGridSynchronizer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/SnapshotCraftingGridRefillContext.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/SnapshotCraftingGridRefillContext.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/SnapshotCraftingGridRefillContext.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/SnapshotCraftingGridRefillContext.java index 2d0e597a2..63a260e41 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/SnapshotCraftingGridRefillContext.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/SnapshotCraftingGridRefillContext.java @@ -1,24 +1,22 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingGridBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.grid.CraftingMatrix; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public class SnapshotCraftingGridRefillContext implements CraftingGridRefillContext { +class SnapshotCraftingGridRefillContext implements CraftingGridRefillContext { private final PlayerActor playerActor; private final CraftingGridBlockEntity blockEntity; private final ResourceList available = new ResourceListImpl<>(); private final ResourceList used = new ResourceListImpl<>(); - public SnapshotCraftingGridRefillContext( + SnapshotCraftingGridRefillContext( final Player player, final CraftingGridBlockEntity blockEntity, final CraftingMatrix craftingMatrix diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java index c624df9ba..4a0dde26b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGrid.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.GridWatcher; @@ -17,21 +17,21 @@ import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Optional; -public class WirelessGrid implements Grid { +class WirelessGrid implements Grid { private final NetworkBoundItemSession session; private final GridWatchers watchers; - public WirelessGrid(final NetworkBoundItemSession session) { + WirelessGrid(final NetworkBoundItemSession session) { this.session = session; this.watchers = new GridWatchers(PlatformApi.INSTANCE.getStorageChannelTypeRegistry().getAll()); } @@ -57,7 +57,7 @@ public Storage getItemStorage() { } @Override - public boolean isActive() { + public boolean isGridActive() { final boolean networkActive = session.resolveNetwork().map( network -> network.getComponent(EnergyNetworkComponent.class).getStored() > 0 ).orElse(false); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/WirelessGridContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/WirelessGridContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java index f2b3adab6..7ecfa7dfa 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/grid/WirelessGridContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridContainerMenu.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.common.content.Menus; import net.minecraft.network.FriendlyByteBuf; @@ -15,10 +15,10 @@ public WirelessGridContainerMenu(final int syncId, final Inventory playerInvento addSlots(0); } - public WirelessGridContainerMenu(final int syncId, - final Inventory playerInventory, - final Grid grid, - final SlotReference slotReference) { + WirelessGridContainerMenu(final int syncId, + final Inventory playerInventory, + final Grid grid, + final SlotReference slotReference) { super(Menus.INSTANCE.getWirelessGrid(), syncId, playerInventory, grid); this.disabledSlot = slotReference; addSlots(0); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/WirelessGridExtendedMenuProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/WirelessGridExtendedMenuProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java index a938057ae..eb7c93a64 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/WirelessGridExtendedMenuProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridExtendedMenuProvider.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.menu; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.WirelessGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; import net.minecraft.network.FriendlyByteBuf; @@ -16,13 +15,13 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -public class WirelessGridExtendedMenuProvider extends GridExtendedMenuProvider { +class WirelessGridExtendedMenuProvider extends GridExtendedMenuProvider { private final SlotReference slotReference; - public WirelessGridExtendedMenuProvider(final Grid grid, - final PlatformRegistry> - storageChannelTypeRegistry, - final SlotReference slotReference) { + WirelessGridExtendedMenuProvider(final Grid grid, + final PlatformRegistry> + storageChannelTypeRegistry, + final SlotReference slotReference) { super(grid, storageChannelTypeRegistry, new MenuProvider() { @Override public Component getDisplayName() { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/WirelessGridItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/WirelessGridItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java index c32068be4..9ceb7db11 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/WirelessGridItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridItem.java @@ -1,15 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.network.impl.energy.EnergyStorageImpl; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.WirelessGrid; -import com.refinedmods.refinedstorage2.platform.common.menu.WirelessGridExtendedMenuProvider; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGridOperations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGridOperations.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java index 4b239a038..791eddd4d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGridOperations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/WirelessGridOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; @@ -6,17 +6,17 @@ import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridWatchers; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; import com.refinedmods.refinedstorage2.platform.common.Platform; -public class WirelessGridOperations implements GridOperations { +class WirelessGridOperations implements GridOperations { private final GridOperations delegate; private final NetworkBoundItemSession session; private final GridWatchers watchers; - public WirelessGridOperations(final GridOperations delegate, - final NetworkBoundItemSession session, - final GridWatchers watchers) { + WirelessGridOperations(final GridOperations delegate, + final NetworkBoundItemSession session, + final GridWatchers watchers) { this.delegate = delegate; this.session = session; this.watchers = watchers; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/package-info.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/package-info.java index fd85eb48f..978b34830 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/AbstractGridScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/AbstractGridScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java index 6b295bda9..1a7cdb2de 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/AbstractGridScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AbstractGridScreen.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; @@ -8,20 +8,20 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; import com.refinedmods.refinedstorage2.platform.api.grid.GridSynchronizer; -import com.refinedmods.refinedstorage2.platform.api.grid.PlatformGridResource; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.view.PlatformGridResource; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.DisabledSlot; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.ItemGridResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.SmallTextClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.History; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.ScrollbarWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.DisabledSlot; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.SmallTextClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.widget.History; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.ScrollbarWidget; import com.refinedmods.refinedstorage2.query.lexer.SyntaxHighlighter; import com.refinedmods.refinedstorage2.query.lexer.SyntaxHighlighterColors; @@ -61,7 +61,7 @@ public abstract class AbstractGridScreen ex protected final int bottomHeight; @Nullable - protected GridSearchBoxWidget searchField; + GridSearchBoxWidget searchField; @Nullable private ScrollbarWidget scrollbar; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/AutoSelectedSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AutoSelectedSideButtonWidget.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/AutoSelectedSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AutoSelectedSideButtonWidget.java index e299b9500..22111201f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/AutoSelectedSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/AutoSelectedSideButtonWidget.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -10,13 +10,13 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.YES; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class AutoSelectedSideButtonWidget extends AbstractSideButtonWidget { +class AutoSelectedSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.auto_selected"); private static final Component HELP = createTranslation("gui", "grid.auto_selected.help"); private final AbstractGridContainerMenu menu; - public AutoSelectedSideButtonWidget(final AbstractGridContainerMenu menu) { + AutoSelectedSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/CraftingGridScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/CraftingGridScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java index 6c9209490..247831d43 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/CraftingGridScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/CraftingGridScreen.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridResultSlot; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import javax.annotation.Nullable; @@ -16,6 +15,7 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.inventory.ResultContainer; import net.minecraft.world.inventory.Slot; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; @@ -75,7 +75,8 @@ private void renderCraftingMatrixFilteringHighlight(final GuiGraphics graphics, @Override protected void containerTick() { super.containerTick(); - final boolean mayFilterOnCraftingMatrixItems = hoveredSlot instanceof CraftingGridResultSlot + final boolean mayFilterOnCraftingMatrixItems = hoveredSlot != null + && hoveredSlot.container instanceof ResultContainer && hasShiftDown() && hasControlDown(); if (mayFilterOnCraftingMatrixItems && !filteringBasedOnCraftingMatrixItems) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridScreen.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridScreen.java index 27c23f6a9..2a5ca09ca 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridSearchBoxWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridSearchBoxWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java index ef18e46e7..2cc65805c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/GridSearchBoxWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/GridSearchBoxWidget.java @@ -1,7 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.History; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.SearchFieldWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSearchBox; +import com.refinedmods.refinedstorage2.platform.common.support.widget.History; +import com.refinedmods.refinedstorage2.platform.common.support.widget.SearchFieldWidget; import com.refinedmods.refinedstorage2.query.lexer.Lexer; import com.refinedmods.refinedstorage2.query.lexer.LexerException; import com.refinedmods.refinedstorage2.query.lexer.LexerTokenMappings; @@ -20,16 +21,16 @@ import net.minecraft.network.chat.Style; import net.minecraft.util.FormattedCharSequence; -public class GridSearchBoxWidget extends SearchFieldWidget implements GridSearchBox { +class GridSearchBoxWidget extends SearchFieldWidget implements GridSearchBox { private final Set> listeners = new HashSet<>(); private boolean valid = true; - public GridSearchBoxWidget(final Font textRenderer, - final int x, - final int y, - final int width, - final SyntaxHighlighter syntaxHighlighter, - final History history) { + GridSearchBoxWidget(final Font textRenderer, + final int x, + final int y, + final int width, + final SyntaxHighlighter syntaxHighlighter, + final History history) { super(textRenderer, x, y, width, history); setFormatter((text, firstCharacterIndex) -> format(syntaxHighlighter, text)); setResponder(text -> listeners.forEach(l -> l.accept(text))); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/LastModified.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/LastModified.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/LastModified.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/LastModified.java index 4f6e481e0..21f7f5e54 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/LastModified.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/LastModified.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; record LastModified(Type type, long amount) { private static final long SECOND = 1000; @@ -8,7 +8,7 @@ record LastModified(Type type, long amount) { private static final long WEEK = DAY * 7; private static final long YEAR = DAY * 365; - public enum Type { + enum Type { SECOND, MINUTE, HOUR, @@ -17,7 +17,7 @@ public enum Type { YEAR } - public static LastModified calculate(final long time, final long now) { + static LastModified calculate(final long time, final long now) { final long diff = now - time; final LastModified lastModified; if (diff < MINUTE) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SizeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SizeSideButtonWidget.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SizeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SizeSideButtonWidget.java index dc74f41da..957c0b467 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SizeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SizeSideButtonWidget.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class SizeSideButtonWidget extends AbstractSideButtonWidget { +class SizeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.size"); private static final MutableComponent SUBTEXT_STRETCH = createTranslation("gui", "grid.size.stretch"); @@ -18,7 +18,7 @@ public class SizeSideButtonWidget extends AbstractSideButtonWidget { private final AbstractGridContainerMenu menu; - public SizeSideButtonWidget(final AbstractGridContainerMenu menu) { + SizeSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SortingDirectionSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SortingDirectionSideButtonWidget.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SortingDirectionSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SortingDirectionSideButtonWidget.java index 58d091f4b..64f266587 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SortingDirectionSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SortingDirectionSideButtonWidget.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; import com.refinedmods.refinedstorage2.api.grid.view.GridSortingDirection; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class SortingDirectionSideButtonWidget extends AbstractSideButtonWidget { +class SortingDirectionSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.sorting.direction"); private static final MutableComponent SUBTEXT_ASCENDING = createTranslation("gui", "grid.sorting.direction.ascending"); @@ -17,7 +17,7 @@ public class SortingDirectionSideButtonWidget extends AbstractSideButtonWidget { private final AbstractGridContainerMenu menu; - public SortingDirectionSideButtonWidget(final AbstractGridContainerMenu menu) { + SortingDirectionSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SortingTypeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SortingTypeSideButtonWidget.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SortingTypeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SortingTypeSideButtonWidget.java index 53f6b99b6..6a033271a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SortingTypeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SortingTypeSideButtonWidget.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSortingTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSortingTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.MutableComponent; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class SortingTypeSideButtonWidget extends AbstractSideButtonWidget { +class SortingTypeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.sorting.type"); private static final MutableComponent SUBTEXT_QUANTITY = createTranslation("gui", "grid.sorting.type.quantity"); private static final MutableComponent SUBTEXT_NAME = createTranslation("gui", "grid.sorting.type.name"); @@ -18,7 +18,7 @@ public class SortingTypeSideButtonWidget extends AbstractSideButtonWidget { private final AbstractGridContainerMenu menu; - public SortingTypeSideButtonWidget(final AbstractGridContainerMenu menu) { + SortingTypeSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/StorageChannelTypeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/StorageChannelTypeSideButtonWidget.java similarity index 81% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/StorageChannelTypeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/StorageChannelTypeSideButtonWidget.java index a6b1e8873..9b07d055f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/StorageChannelTypeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/StorageChannelTypeSideButtonWidget.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -11,14 +11,14 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class StorageChannelTypeSideButtonWidget extends AbstractSideButtonWidget { +class StorageChannelTypeSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.storage_channel_type"); private static final MutableComponent SUBTEXT_ALL = createTranslation("gui", "grid.storage_channel_type.all"); private static final Component HELP = createTranslation("gui", "grid.storage_channel_type.help"); private final AbstractGridContainerMenu menu; - public StorageChannelTypeSideButtonWidget(final AbstractGridContainerMenu menu) { + StorageChannelTypeSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SynchronizationSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SynchronizationSideButtonWidget.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SynchronizationSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SynchronizationSideButtonWidget.java index 48c4d71f4..08fb36f9b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/SynchronizationSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/SynchronizationSideButtonWidget.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -9,12 +9,12 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class SynchronizationSideButtonWidget extends AbstractSideButtonWidget { +class SynchronizationSideButtonWidget extends AbstractSideButtonWidget { private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronizer"); private final AbstractGridContainerMenu menu; - public SynchronizationSideButtonWidget(final AbstractGridContainerMenu menu) { + SynchronizationSideButtonWidget(final AbstractGridContainerMenu menu) { super(createPressAction(menu)); this.menu = menu; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/FluidGridInsertionHint.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java similarity index 72% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/FluidGridInsertionHint.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java index a2f806c31..df3771a15 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/FluidGridInsertionHint.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/FluidGridInsertionHint.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid.hint; +package com.refinedmods.refinedstorage2.platform.common.grid.screen.hint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage2.platform.common.ContainedFluid; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.Optional; @@ -16,7 +16,7 @@ public Optional getHint(final ItemStack carried) { return Platform.INSTANCE.getContainedFluid(carried).map(this::createComponent); } - private MouseWithIconClientTooltipComponent createComponent(final ContainedFluid result) { + private MouseWithIconClientTooltipComponent createComponent(final Platform.ContainedFluid result) { return new MouseWithIconClientTooltipComponent( MouseWithIconClientTooltipComponent.Type.RIGHT, (graphics, x, y) -> Platform.INSTANCE.getFluidRenderer().render( @@ -27,7 +27,7 @@ private MouseWithIconClientTooltipComponent createComponent(final ContainedFluid ), result.fluid().getAmount() == Platform.INSTANCE.getBucketAmount() ? null - : Platform.INSTANCE.getBucketAmountFormatter().format(result.fluid().getAmount()) + : FluidResourceRendering.format(result.fluid().getAmount()) ); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/GridInsertionHintsImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/GridInsertionHintsImpl.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/GridInsertionHintsImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/GridInsertionHintsImpl.java index d4a8a8308..c4b258e3b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/GridInsertionHintsImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/GridInsertionHintsImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid.hint; +package com.refinedmods.refinedstorage2.platform.common.grid.screen.hint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHints; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/ItemGridInsertionHint.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/ItemGridInsertionHint.java similarity index 72% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/ItemGridInsertionHint.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/ItemGridInsertionHint.java index 1be792b0f..47173ff65 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/ItemGridInsertionHint.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/ItemGridInsertionHint.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid.hint; +package com.refinedmods.refinedstorage2.platform.common.grid.screen.hint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/SingleItemGridInsertionHint.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/SingleItemGridInsertionHint.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/SingleItemGridInsertionHint.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/SingleItemGridInsertionHint.java index 84207b482..7a4a514b5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/SingleItemGridInsertionHint.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/SingleItemGridInsertionHint.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid.hint; +package com.refinedmods.refinedstorage2.platform.common.grid.screen.hint; import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionHint; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/package-info.java new file mode 100644 index 000000000..65a19a5e0 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/hint/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.grid.screen.hint; + +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/grid/screen/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/package-info.java new file mode 100644 index 000000000..ab8127760 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.grid.screen; + +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/internal/grid/ClientGridExtractionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridExtractionStrategy.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridExtractionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridExtractionStrategy.java index 11898dbf8..4c0dd60f7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridExtractionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridExtractionStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.common.Platform; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridInsertionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridInsertionStrategy.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridInsertionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridInsertionStrategy.java index 5024aa0c2..8a005135c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridInsertionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridInsertionStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.common.Platform; public class ClientGridInsertionStrategy implements GridInsertionStrategy { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridScrollingStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridScrollingStrategy.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridScrollingStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridScrollingStrategy.java index 35411f0a2..4596a90c0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/ClientGridScrollingStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/ClientGridScrollingStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.common.Platform; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridExtractionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridExtractionStrategy.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridExtractionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridExtractionStrategy.java index 2a44a9a78..fe3f068a7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridExtractionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridExtractionStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import java.util.Collections; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridInsertionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridInsertionStrategy.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridInsertionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridInsertionStrategy.java index ee726499f..4abc1d8c6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridInsertionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridInsertionStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import java.util.Collections; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridScrollingStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridScrollingStrategy.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridScrollingStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridScrollingStrategy.java index f3c5d5c7f..51ba457d8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/CompositeGridScrollingStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/CompositeGridScrollingStrategy.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import java.util.Collections; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/package-info.java new file mode 100644 index 000000000..0d503cef2 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.grid.strategy; + +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/internal/grid/view/AbstractFluidGridResourceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/AbstractFluidGridResourceFactory.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractFluidGridResourceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/AbstractFluidGridResourceFactory.java index 537d7fadb..bf38d4884 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractFluidGridResourceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/AbstractFluidGridResourceFactory.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.common.grid.view; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import java.util.Optional; import java.util.Set; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractItemGridResourceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/AbstractItemGridResourceFactory.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractItemGridResourceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/AbstractItemGridResourceFactory.java index 1acf07e20..10dd7cf6d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractItemGridResourceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/AbstractItemGridResourceFactory.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.common.grid.view; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import java.util.Optional; import java.util.Set; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/CompositeGridResourceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/CompositeGridResourceFactory.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/CompositeGridResourceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/CompositeGridResourceFactory.java index 7c2c7e23e..90526370b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/CompositeGridResourceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/CompositeGridResourceFactory.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.common.grid.view; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java index ac68dd07b..5d9be6361 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/FluidGridResource.java @@ -1,16 +1,17 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.common.grid.view; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.grid.AbstractPlatformGridResource; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridResourceAttributeKeys; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.view.AbstractPlatformGridResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.List; import java.util.Map; @@ -84,12 +85,12 @@ public void render(final GuiGraphics graphics, final int x, final int y) { @Override public String getDisplayedAmount() { - return Platform.INSTANCE.getBucketAmountFormatter().formatWithUnits(getAmount()); + return FluidResourceRendering.formatWithUnits(getAmount()); } @Override public String getAmountInTooltip() { - return Platform.INSTANCE.getBucketAmountFormatter().format(getAmount()); + return FluidResourceRendering.format(getAmount()); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/ItemGridResource.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/ItemGridResource.java index 84729ae2c..df3aaafce 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/ItemGridResource.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.common.grid.view; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.grid.AbstractPlatformGridResource; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridResourceAttributeKeys; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.view.AbstractPlatformGridResource; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; import java.util.List; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/package-info.java new file mode 100644 index 000000000..605637003 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.grid.view; + +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/block/entity/iface/ExportedResourcesContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/ExportedResourcesContainer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java index 0ae8247dc..98606646e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/ExportedResourcesContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/ExportedResourcesContainer.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.iface; +package com.refinedmods.refinedstorage2.platform.common.iface; import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceExportState; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainerType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.FuzzyStorageChannel; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainerType; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.Collection; import java.util.Collections; @@ -21,7 +21,7 @@ public class ExportedResourcesContainer extends ResourceContainerImpl implements InterfaceExportState { private final FilterWithFuzzyMode filter; - public ExportedResourcesContainer(final int size, final FilterWithFuzzyMode filter) { + ExportedResourcesContainer(final int size, final FilterWithFuzzyMode filter) { super( size, ResourceContainerType.CONTAINER, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/InterfaceBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/InterfaceBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java index f35e537a5..80f4de506 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/InterfaceBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlock.java @@ -1,10 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.iface; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.item.block.SimpleBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/InterfaceBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/InterfaceBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java index 9edacdb05..e171acba6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/iface/InterfaceBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.iface; +package com.refinedmods.refinedstorage2.platform.common.iface; import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode; import com.refinedmods.refinedstorage2.api.network.impl.node.iface.externalstorage.InterfaceExternalStorageProvider; @@ -6,18 +6,17 @@ import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainerType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainerType; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.BlockEntityWithDrops; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.InterfaceContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.HashMap; import java.util.Map; @@ -37,7 +36,7 @@ import net.minecraft.world.level.block.state.BlockState; public class InterfaceBlockEntity - extends AbstractInternalNetworkNodeContainerBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements ExtendedMenuProvider, BlockEntityWithDrops { private static final String TAG_EXPORT_ITEMS = "ei"; private static final int EXPORT_SLOTS = 9; @@ -82,7 +81,7 @@ private InterfaceExternalStorageProviderImpl createExternalStorageProvide ); } - public static ResourceContainer createFilterContainer() { + static ResourceContainer createFilterContainer() { return new ResourceContainerImpl( EXPORT_SLOTS, ResourceContainerType.FILTER_WITH_AMOUNT, @@ -92,7 +91,7 @@ public static ResourceContainer createFilterContainer() { ); } - public static ExportedResourcesContainer createExportedResourcesContainer(final FilterWithFuzzyMode filter) { + static ExportedResourcesContainer createExportedResourcesContainer(final FilterWithFuzzyMode filter) { return new ExportedResourcesContainer(EXPORT_SLOTS, filter); } @@ -107,6 +106,11 @@ static long getTransferQuota(final ResourceTemplate resourceTemplate) { public void saveAdditional(final CompoundTag tag) { super.saveAdditional(tag); tag.put(TAG_EXPORT_ITEMS, exportedResources.toTag()); + } + + @Override + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); filter.save(tag); } @@ -115,15 +119,20 @@ public void load(final CompoundTag tag) { if (tag.contains(TAG_EXPORT_ITEMS)) { exportedResources.fromTag(tag.getCompound(TAG_EXPORT_ITEMS)); } - filter.load(tag); super.load(tag); } - public boolean isFuzzyMode() { + @Override + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); + filter.load(tag); + } + + boolean isFuzzyMode() { return filter.isFuzzyMode(); } - public void setFuzzyMode(final boolean fuzzyMode) { + void setFuzzyMode(final boolean fuzzyMode) { filter.setFuzzyMode(fuzzyMode); } @@ -169,9 +178,7 @@ public NonNullList getDrops() { } @SuppressWarnings("unchecked") - public InterfaceExternalStorageProvider getExternalStorageProvider( - final StorageChannelType storageChannelType - ) { + InterfaceExternalStorageProvider getExternalStorageProvider(final StorageChannelType storageChannelType) { return (InterfaceExternalStorageProvider) externalStorageProviders.get(storageChannelType); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/InterfaceContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/InterfaceContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java index 45691c629..5a7250740 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/InterfaceContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceContainerMenu.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.iface; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +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.ServerProperty; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; @@ -24,12 +24,12 @@ public class InterfaceContainerMenu extends AbstractResourceContainerMenu { private static final int EXPORT_CONFIG_SLOT_Y = 20; private static final int EXPORT_OUTPUT_SLOT_Y = 66; - public InterfaceContainerMenu(final int syncId, - final Player player, - final InterfaceBlockEntity blockEntity, - final ResourceContainer exportConfig, - final ResourceContainer exportedResources, - final Container exportedResourcesAsContainer) { + InterfaceContainerMenu(final int syncId, + final Player player, + final InterfaceBlockEntity blockEntity, + final ResourceContainer exportConfig, + final ResourceContainer exportedResources, + final Container exportedResourcesAsContainer) { super(Menus.INSTANCE.getInterface(), syncId, player); addSlots(player, exportConfig, exportedResources, exportedResourcesAsContainer); registerProperty(new ServerProperty<>( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/InterfacePlatformExternalStorageProviderFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfacePlatformExternalStorageProviderFactory.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/InterfacePlatformExternalStorageProviderFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfacePlatformExternalStorageProviderFactory.java index cc0a42c2a..0cc89388b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/InterfacePlatformExternalStorageProviderFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfacePlatformExternalStorageProviderFactory.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.network.node.iface.externalstorage; +package com.refinedmods.refinedstorage2.platform.common.iface; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/InterfaceProxyExternalStorageProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/InterfaceProxyExternalStorageProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java index 5b5ffeb88..0459cdd26 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/InterfaceProxyExternalStorageProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceProxyExternalStorageProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.network.node.iface.externalstorage; +package com.refinedmods.refinedstorage2.platform.common.iface; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.impl.node.iface.InterfaceNetworkNode; @@ -6,8 +6,7 @@ import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.blockentity.AbstractNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; import java.util.Collections; import java.util.Iterator; @@ -17,14 +16,14 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; -public class InterfaceProxyExternalStorageProvider implements InterfaceExternalStorageProvider { +class InterfaceProxyExternalStorageProvider implements InterfaceExternalStorageProvider { private final Level level; private final BlockPos pos; private final StorageChannelType storageChannelType; - public InterfaceProxyExternalStorageProvider(final Level level, - final BlockPos pos, - final StorageChannelType storageChannelType) { + InterfaceProxyExternalStorageProvider(final Level level, + final BlockPos pos, + final StorageChannelType storageChannelType) { this.level = level; this.pos = pos; this.storageChannelType = storageChannelType; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/InterfaceScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/InterfaceScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java index 73a72b953..fcba67225 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/InterfaceScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/InterfaceScreen.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.iface; -import com.refinedmods.refinedstorage2.platform.common.containermenu.InterfaceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; +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.network.chat.Component; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/package-info.java similarity index 76% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/package-info.java index d38c214aa..3a2baefdf 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/iface/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.item; +package com.refinedmods.refinedstorage2.platform.common.iface; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ImporterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ImporterBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java index 667088e69..06e521f87 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ImporterBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlock.java @@ -1,12 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.importer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ImporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java index 71b12cea2..3a1a6be11 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterBlockEntity.java @@ -1,20 +1,23 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.importer; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; import com.refinedmods.refinedstorage2.api.network.impl.node.importer.CompositeImporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.impl.node.importer.ImporterNetworkNode; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ImporterContainerMenu; 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.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractUpgradeableNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; import java.util.function.LongSupplier; @@ -79,36 +82,34 @@ private CompositeImporterTransferStrategy createStrategy(final ServerLevel serve } @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); tag.putInt(TAG_FILTER_MODE, FilterModeSettings.getFilterMode(getNode().getFilterMode())); filter.save(tag); } @Override - public void load(final CompoundTag tag) { + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); if (tag.contains(TAG_FILTER_MODE)) { getNode().setFilterMode(FilterModeSettings.getFilterMode(tag.getInt(TAG_FILTER_MODE))); } - filter.load(tag); - - super.load(tag); } - public boolean isFuzzyMode() { + boolean isFuzzyMode() { return filter.isFuzzyMode(); } - public void setFuzzyMode(final boolean fuzzyMode) { + void setFuzzyMode(final boolean fuzzyMode) { filter.setFuzzyMode(fuzzyMode); } - public FilterMode getFilterMode() { + FilterMode getFilterMode() { return getNode().getFilterMode(); } - public void setFilterMode(final FilterMode mode) { + void setFilterMode(final FilterMode mode) { getNode().setFilterMode(mode); setChanged(); } @@ -158,4 +159,10 @@ private long getAmountStillAvailableForImport(final long amount, } return Math.min(stillAvailableToImport, amount); } + + @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/containermenu/ImporterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java similarity index 66% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ImporterContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java index 575505068..dbe7f9abc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/ImporterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterContainerMenu.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.importer; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.ImporterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSimpleFilterContainerMenu; +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; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.MutableComponent; @@ -32,11 +32,11 @@ public ImporterContainerMenu(final int syncId, final Inventory playerInventory, ); } - public ImporterContainerMenu(final int syncId, - final Player player, - final ImporterBlockEntity importer, - final ResourceContainer resourceContainer, - final UpgradeContainer upgradeContainer) { + ImporterContainerMenu(final int syncId, + final Player player, + final ImporterBlockEntity importer, + final ResourceContainer resourceContainer, + final UpgradeContainer upgradeContainer) { super( Menus.INSTANCE.getImporter(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ImporterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java similarity index 69% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ImporterScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java index cfd251938..e77a4766b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ImporterScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/ImporterScreen.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.importer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ImporterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FuzzyModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/package-info.java new file mode 100644 index 000000000..451566b79 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.importer; + +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/integration/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/package-info.java deleted file mode 100644 index d101874c8..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.integration; - -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/integration/recipemod/jei/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/package-info.java deleted file mode 100644 index ea15fc24a..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; - -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/integration/recipemod/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/package-info.java deleted file mode 100644 index 59e9f845a..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod; - -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/internal/energy/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/package-info.java deleted file mode 100644 index bac26d372..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.energy; - -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/internal/grid/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/package-info.java deleted file mode 100644 index 4ced6e450..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.grid; - -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/internal/grid/view/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/package-info.java deleted file mode 100644 index fc6f12ad8..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; - -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/internal/item/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/package-info.java deleted file mode 100644 index c7e7486bc..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.item; - -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/internal/network/node/iface/externalstorage/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/package-info.java deleted file mode 100644 index ab2aeab3a..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/iface/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.network.node.iface.externalstorage; - -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/internal/network/node/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/package-info.java deleted file mode 100644 index 5aea8532a..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/node/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.network.node; - -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/internal/network/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/package-info.java deleted file mode 100644 index 2723c7662..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.network; - -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/internal/registry/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/package-info.java deleted file mode 100644 index f2a37e56b..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.registry; - -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/internal/resource/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/package-info.java deleted file mode 100644 index 4d1afd1b1..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.resource; - -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/internal/storage/LimitedPlatformStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/LimitedPlatformStorage.java deleted file mode 100644 index 1dcbcbb3e..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/LimitedPlatformStorage.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; - -import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorage; -import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl; -import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; - -public class LimitedPlatformStorage extends PlatformStorage implements LimitedStorage { - private final LimitedStorageImpl limitedStorage; - - public LimitedPlatformStorage(final LimitedStorageImpl delegate, - final StorageType type, - final TrackedStorageRepository trackingRepository, - final Runnable listener) { - super(delegate, type, trackingRepository, listener); - this.limitedStorage = delegate; - } - - @Override - public long getCapacity() { - return limitedStorage.getCapacity(); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/package-info.java deleted file mode 100644 index 96e3df0db..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.storage.channel; - -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/internal/storage/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/package-info.java deleted file mode 100644 index 615b22f95..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.storage; - -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/internal/storage/type/StorageTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/StorageTypes.java deleted file mode 100644 index d1700aa35..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/StorageTypes.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.type; - -public final class StorageTypes { - public static final ItemStorageType ITEM = new ItemStorageType(); - public static final FluidStorageType FLUID = new FluidStorageType(); - - private StorageTypes() { - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/package-info.java deleted file mode 100644 index b634f6ce7..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.storage.type; - -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/internal/upgrade/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/package-info.java deleted file mode 100644 index 664f955c6..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.internal.upgrade; - -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/item/block/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/package-info.java deleted file mode 100644 index 7fa2468c8..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.item.block; - -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/menu/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/package-info.java deleted file mode 100644 index b8d919aa7..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.menu; - -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/item/ProcessorItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/ProcessorItem.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/ProcessorItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/ProcessorItem.java index 14fd04787..af6e6b2f9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/ProcessorItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/ProcessorItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.misc; import net.minecraft.world.item.Item; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/WrenchItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/WrenchItem.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/WrenchItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/WrenchItem.java index 544b7fb5b..e0f2a0c76 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/WrenchItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/WrenchItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.misc; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/package-info.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/package-info.java index 32030996a..e0f528efe 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/misc/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.loot; +package com.refinedmods.refinedstorage2.platform.common.misc; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java index 2895ff79e..4932e6704 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/CableBlock.java @@ -1,21 +1,26 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.networking; -import com.refinedmods.refinedstorage2.platform.common.block.entity.CableBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.Platform; 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.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport; +import com.refinedmods.refinedstorage2.platform.common.support.CableShapeCacheKey; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.DyeColor; -import net.minecraft.world.item.Item; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; @@ -35,23 +40,13 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -public class CableBlock extends AbstractBaseBlock +public class CableBlock extends AbstractColoredBlock implements ColorableBlock, SimpleWaterloggedBlock, EntityBlock, BlockItemProvider { - private static final AbstractBlockEntityTicker TICKER = + private static final AbstractBlockEntityTicker> TICKER = new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getCable); - private final DyeColor color; - private final MutableComponent name; - public CableBlock(final DyeColor color, final MutableComponent name) { - super(BlockConstants.CABLE_PROPERTIES); - this.color = color; - this.name = name; - } - - @Override - public DyeColor getColor() { - return color; + super(BlockConstants.CABLE_PROPERTIES, color, name); } @Override @@ -115,15 +110,12 @@ public VoxelShape getShape(final BlockState state, @Override public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new CableBlockEntity(pos, state); - } - - @Nullable - @Override - public BlockEntityTicker getTicker(final Level level, - final BlockState blockState, - final BlockEntityType type) { - return TICKER.get(level, type); + return new NetworkNodeContainerBlockEntityImpl<>( + BlockEntities.INSTANCE.getCable(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getCable().getEnergyUsage()) + ); } @Override @@ -131,13 +123,11 @@ public BlockColorMap getBlockColorMap() { return Blocks.INSTANCE.getCable(); } + @Nullable @Override - public MutableComponent getName() { - return name; - } - - @Override - public BlockItem createBlockItem() { - return new NamedBlockItem(this, new Item.Properties(), name); + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); } } 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 new file mode 100644 index 000000000..60349cac6 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardInventory.java @@ -0,0 +1,30 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import java.util.Optional; + +import net.minecraft.core.GlobalPos; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.ItemStack; + +class NetworkCardInventory extends SimpleContainer { + NetworkCardInventory() { + super(1); + } + + @Override + public boolean canPlaceItem(final int slot, final ItemStack stack) { + return stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack); + } + + ItemStack getNetworkCard() { + return getItem(0); + } + + Optional getReceiverLocation() { + final ItemStack stack = getNetworkCard(); + if (stack.getItem() instanceof NetworkCardItem cardItem) { + return cardItem.getLocation(stack); + } + return Optional.empty(); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java new file mode 100644 index 000000000..825ede85c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java @@ -0,0 +1,131 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; + +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.core.registries.Registries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverKey.getDimensionName; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +// TODO: better active texture. +public class NetworkCardItem extends Item { + private static final MutableComponent UNBOUND_HELP = createTranslation("item", "network_card.unbound_help"); + private static final MutableComponent BOUND_HELP = createTranslation("item", "network_card.bound_help"); + + private static final MutableComponent UNBOUND = createTranslation("item", "network_card.unbound") + .withStyle(ChatFormatting.RED); + + private static final String TAG_POS = "pos"; + private static final String TAG_DIMENSION = "dim"; + + public NetworkCardItem() { + super(new Item.Properties().stacksTo(1)); + } + + @Override + public InteractionResult useOn(final UseOnContext ctx) { + if (ctx.getLevel().isClientSide() || ctx.getPlayer() == null) { + return InteractionResult.CONSUME; + } + final BlockPos pos = ctx.getClickedPos(); + final BlockState blockState = ctx.getLevel().getBlockState(pos); + if (!(blockState.getBlock() instanceof NetworkReceiverBlock)) { + return InteractionResult.CONSUME; + } + final CompoundTag tag = new CompoundTag(); + tag.putLong(TAG_POS, pos.asLong()); + final ResourceKey dimension = ctx.getLevel().dimension(); + tag.putString(TAG_DIMENSION, dimension.location().toString()); + ctx.getItemInHand().setTag(tag); + ctx.getPlayer().sendSystemMessage(createTranslation( + "item", + "network_card.bound", + pos.getX(), + pos.getY(), + pos.getZ(), + getDimensionName(dimension).withStyle(ChatFormatting.YELLOW) + )); + return InteractionResult.CONSUME; + } + + @Override + public InteractionResultHolder use(final Level level, final Player player, final InteractionHand hand) { + if (player.isCrouching()) { + if (!level.isClientSide()) { + player.sendSystemMessage(createTranslation("item", "network_card.unbound")); + } + return new InteractionResultHolder<>(InteractionResult.CONSUME, new ItemStack(this)); + } + return super.use(level, player, hand); + } + + @Override + public void appendHoverText(final ItemStack stack, + @Nullable final Level level, + final List lines, + final TooltipFlag flag) { + super.appendHoverText(stack, level, lines, flag); + getLocation(stack).ifPresentOrElse(location -> lines.add(createTranslation( + "item", + "network_card.bound", + location.pos().getX(), + location.pos().getY(), + location.pos().getZ(), + getDimensionName(location.dimension()).withStyle(ChatFormatting.YELLOW) + ).withStyle(ChatFormatting.GRAY)), () -> lines.add(UNBOUND)); + } + + @Nullable + private ResourceKey getDimension(final String dimensionKey) { + final ResourceLocation name = ResourceLocation.tryParse(dimensionKey); + if (name == null) { + return null; + } + return ResourceKey.create(Registries.DIMENSION, name); + } + + Optional getLocation(final ItemStack stack) { + final CompoundTag tag = stack.getTag(); + if (tag == null) { + return Optional.empty(); + } + final ResourceKey dimension = getDimension(tag.getString(TAG_DIMENSION)); + if (dimension == null) { + return Optional.empty(); + } + final BlockPos pos = BlockPos.of(tag.getLong(TAG_POS)); + return Optional.of(GlobalPos.of(dimension, pos)); + } + + @Override + public Optional getTooltipImage(final ItemStack stack) { + return Optional.of(new HelpTooltipComponent(isActive(stack) ? BOUND_HELP : UNBOUND_HELP)); + } + + boolean isActive(final ItemStack stack) { + return stack.getTag() != null && stack.getTag().contains(TAG_POS) && stack.getTag().contains(TAG_DIMENSION); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java new file mode 100644 index 000000000..f807af445 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItemPropertyFunction.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import javax.annotation.Nullable; + +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; + +public class NetworkCardItemPropertyFunction implements ClampedItemPropertyFunction { + public static final ResourceLocation NAME = new ResourceLocation("active"); + + @Override + public float unclampedCall(final ItemStack itemStack, + @Nullable final ClientLevel clientLevel, + @Nullable final LivingEntity livingEntity, + final int i) { + if (itemStack.getItem() instanceof NetworkCardItem cardItem) { + return cardItem.isActive(itemStack) ? 1 : 0; + } + return 0; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java new file mode 100644 index 000000000..4bb7ea7c3 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java @@ -0,0 +1,65 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +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.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +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 NetworkReceiverBlock extends AbstractColoredBlock implements EntityBlock { + public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getNetworkReceiver, ACTIVE); + + public NetworkReceiverBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, 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 BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getNetworkReceiver(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new NetworkReceiverBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java new file mode 100644 index 000000000..920d77dc4 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class NetworkReceiverBlockEntity extends NetworkNodeContainerBlockEntityImpl { + public NetworkReceiverBlockEntity(final BlockPos pos, final BlockState state) { + super( + BlockEntities.INSTANCE.getNetworkReceiver(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) + ); + } + + @Nullable + @Override + public Object createKey() { + return new NetworkReceiverKey(getContainerPosition()); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java new file mode 100644 index 000000000..f13eacf67 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; + +record NetworkReceiverKey(GlobalPos pos) { + int getDistance(final BlockPos from) { + return (int) Math.sqrt( + Math.pow(from.getX() - (double) pos.pos().getX(), 2) + + Math.pow(from.getY() - (double) pos.pos().getY(), 2) + + Math.pow(from.getZ() - (double) pos.pos().getZ(), 2) + ); + } + + MutableComponent getDimensionName() { + return getDimensionName(pos.dimension()); + } + + static MutableComponent getDimensionName(final ResourceKey dimension) { + if (dimension == Level.OVERWORLD) { + return Component.literal("Overworld"); + } else if (dimension == Level.END) { + return Component.literal("The End"); + } else if (dimension == Level.NETHER) { + return Component.literal("The Nether"); + } + return Component.translatable( + "dimension.%s.%s".formatted(dimension.location().getNamespace(), dimension.location().getPath()) + ); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java new file mode 100644 index 000000000..95798f579 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java @@ -0,0 +1,66 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; +import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +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.EnumProperty; + +public class NetworkTransmitterBlock extends AbstractColoredBlock implements EntityBlock { + public static final EnumProperty STATE = EnumProperty.create( + "state", + NetworkTransmitterState.class + ); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkTransmitterBlockEntityTicker(); + + public NetworkTransmitterBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected BlockState getDefaultState() { + return super.getDefaultState().setValue(STATE, NetworkTransmitterState.INACTIVE); + } + + @Override + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(STATE); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getNetworkTransmitter(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new NetworkTransmitterBlockEntity(blockPos, blockState); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java new file mode 100644 index 000000000..318f7281b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java @@ -0,0 +1,211 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.Network; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; +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.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.ChatFormatting; +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.chat.MutableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +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.ItemStack; +import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +// TODO: better error texture and better active texture with animation? Reuse controller textures? +public class NetworkTransmitterBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements ExtendedMenuProvider, BlockEntityWithDrops { + private static final Logger LOGGER = LoggerFactory.getLogger(NetworkTransmitterBlockEntity.class); + + private static final NetworkTransmitterStatus INACTIVE = NetworkTransmitterStatus.message( + createTranslation("gui", "network_transmitter.status.inactive") + ); + private static final NetworkTransmitterStatus MISSING_NETWORK_CARD = NetworkTransmitterStatus.error( + createTranslation("gui", "network_transmitter.status.missing_network_card").withStyle(ChatFormatting.DARK_RED) + ); + private static final NetworkTransmitterStatus RECEIVER_UNREACHABLE = NetworkTransmitterStatus.error( + createTranslation("gui", "network_transmitter.status.receiver_unreachable").withStyle(ChatFormatting.DARK_RED) + ); + + private static final String TAG_NETWORK_CARD_INVENTORY = "nc"; + + private final NetworkCardInventory networkCardInventory = new NetworkCardInventory(); + private final RateLimiter stateChangeRateLimiter = RateLimiter.create(1); + private final RateLimiter networkRebuildRetryRateLimiter = RateLimiter.create(1 / 5D); + + @Nullable + private NetworkReceiverKey receiverKey; + + public NetworkTransmitterBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getNetworkTransmitter(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getNetworkTransmitter().getEnergyUsage() + )); + networkCardInventory.addListener(container -> { + setChanged(); + updateReceiverLocation(); + if (level != null) { + LOGGER.info("Network card was changed at {}, sending network update", worldPosition); + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + }); + } + + @Override + protected void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + if (level == null) { + return; + } + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + + public void updateStateInLevel(final BlockState state) { + final NetworkTransmitterState currentState = state.getValue(NetworkTransmitterBlock.STATE); + final NetworkTransmitterState newState = getState(); + if (currentState != newState && level != null && stateChangeRateLimiter.tryAcquire()) { + LOGGER.info("Updating network transmitter at {} from {} to {}", worldPosition, currentState, newState); + level.setBlockAndUpdate(worldPosition, state.setValue(NetworkTransmitterBlock.STATE, newState)); + } + } + + private NetworkTransmitterState getState() { + if (!isActive()) { + return NetworkTransmitterState.INACTIVE; + } + if (receiverKey == null) { + return NetworkTransmitterState.ERROR; + } + final Network network = getNode().getNetwork(); + if (network == null) { + return NetworkTransmitterState.ERROR; + } + final boolean receiverFound = isReceiverFoundInNetwork(network, receiverKey); + return receiverFound ? NetworkTransmitterState.ACTIVE : NetworkTransmitterState.ERROR; + } + + NetworkTransmitterStatus getStatus() { + final Network network = getNode().getNetwork(); + if (!isActive() || network == null || level == null) { + return INACTIVE; + } + if (receiverKey == null) { + return MISSING_NETWORK_CARD; + } + final boolean receiverFound = isReceiverFoundInNetwork(network, receiverKey); + if (!receiverFound) { + return RECEIVER_UNREACHABLE; + } + final boolean showDistance = level.dimension() == receiverKey.pos().dimension(); + final MutableComponent message = showDistance ? createTranslation( + "gui", + "network_transmitter.status.transmitting", + receiverKey.getDistance(worldPosition)) : receiverKey.getDimensionName(); + return NetworkTransmitterStatus.message(message); + } + + @Override + public void doWork() { + super.doWork(); + if (!isActive() || getNode().getNetwork() == null || receiverKey == null) { + return; + } + final boolean receiverFound = isReceiverFoundInNetwork(getNode().getNetwork(), receiverKey); + if (!receiverFound && networkRebuildRetryRateLimiter.tryAcquire()) { + tryReconnectingWithReceiver(); + } + } + + private void tryReconnectingWithReceiver() { + if (level == null) { + return; + } + LOGGER.info( + "Receiver {} was not found in network for transmitter at {}, retrying and sending network update", + receiverKey, + worldPosition + ); + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + + private static boolean isReceiverFoundInNetwork(final Network network, final NetworkReceiverKey key) { + return network.getComponent(GraphNetworkComponent.class).getContainer(key) != null; + } + + Container getNetworkCardInventory() { + return networkCardInventory; + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + tag.put(TAG_NETWORK_CARD_INVENTORY, networkCardInventory.createTag()); + } + + @Override + public void load(final CompoundTag tag) { + super.load(tag); + if (tag.contains(TAG_NETWORK_CARD_INVENTORY)) { + networkCardInventory.fromTag(tag.getList(TAG_NETWORK_CARD_INVENTORY, Tag.TAG_COMPOUND)); + } + updateReceiverLocation(); + } + + private void updateReceiverLocation() { + receiverKey = networkCardInventory.getReceiverLocation().map(NetworkReceiverKey::new).orElse(null); + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new NetworkTransmitterContainerMenu(syncId, inventory, this); + } + + @Override + public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { + final NetworkTransmitterStatus status = getStatus(); + buf.writeBoolean(status.error()); + buf.writeComponent(status.message()); + } + + @Override + public Component getDisplayName() { + return ContentNames.NETWORK_TRANSMITTER; + } + + @Override + public NonNullList getDrops() { + return NonNullList.of(ItemStack.EMPTY, networkCardInventory.getNetworkCard()); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + super.addOutgoingConnections(sink); + if (receiverKey != null && isActive()) { + sink.tryConnect(receiverKey.pos()); + } + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java new file mode 100644 index 000000000..dde4d9e96 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +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; + +public class NetworkTransmitterBlockEntityTicker + extends NetworkNodeBlockEntityTicker { + NetworkTransmitterBlockEntityTicker() { + super(BlockEntities.INSTANCE::getNetworkTransmitter); + } + + @Override + public void tick(final Level level, + final BlockPos pos, + final BlockState state, + final NetworkTransmitterBlockEntity blockEntity) { + super.tick(level, pos, state, blockEntity); + blockEntity.updateStateInLevel(state); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java new file mode 100644 index 000000000..812c6083b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java @@ -0,0 +1,98 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +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; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class NetworkTransmitterContainerMenu extends AbstractBaseContainerMenu { + @Nullable + private final NetworkTransmitterBlockEntity blockEntity; + private final Player player; + private final RateLimiter statusUpdateRateLimiter = RateLimiter.create(2); + private NetworkTransmitterStatus status; + + NetworkTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final NetworkTransmitterBlockEntity blockEntity) { + super(Menus.INSTANCE.getNetworkTransmitter(), syncId); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + blockEntity::getRedstoneMode, + blockEntity::setRedstoneMode + )); + this.blockEntity = blockEntity; + this.player = playerInventory.player; + this.status = blockEntity.getStatus(); + addSlots(playerInventory, blockEntity.getNetworkCardInventory()); + } + + public NetworkTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final FriendlyByteBuf buf) { + super(Menus.INSTANCE.getNetworkTransmitter(), syncId); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.blockEntity = null; + this.player = playerInventory.player; + this.status = new NetworkTransmitterStatus(buf.readBoolean(), buf.readComponent()); + addSlots(playerInventory, new SimpleContainer(1)); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + if (blockEntity == null || !(player instanceof ServerPlayer serverPlayer)) { + return; + } + if (!statusUpdateRateLimiter.tryAcquire()) { + return; + } + final NetworkTransmitterStatus newStatus = blockEntity.getStatus(); + if (newStatus.message().equals(status.message())) { + return; + } + updateStatus(serverPlayer, newStatus); + } + + private void updateStatus(final ServerPlayer serverPlayer, final NetworkTransmitterStatus newStatus) { + this.status = newStatus; + Platform.INSTANCE.getServerToClientCommunications().sendNetworkTransmitterStatus( + serverPlayer, + newStatus + ); + } + + private void addSlots(final Inventory playerInventory, final Container networkCardInventory) { + addPlayerInventory(playerInventory, 8, 55); + addSlot(new ValidatedSlot( + networkCardInventory, + 0, + 8, + 20, + stack -> stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack) + )); + transferManager.addBiTransfer(playerInventory, networkCardInventory); + } + + NetworkTransmitterStatus getStatus() { + return status; + } + + public void setStatus(final NetworkTransmitterStatus status) { + this.status = status; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java new file mode 100644 index 000000000..56b42cc98 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java @@ -0,0 +1,48 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +public class NetworkTransmitterScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/network_transmitter.png"); + + public NetworkTransmitterScreen(final NetworkTransmitterContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 42; + this.imageWidth = 176; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + final NetworkTransmitterStatus status = getMenu().getStatus(); + final int displayTextX = 51; + if (status.error()) { + graphics.blit(TextureIds.ICONS, displayTextX, 23, 246, 148, 10, 10); + } + graphics.drawString(font, status.message(), displayTextX + (status.error() ? (10 + 4) : 0), 25, 4210752, false); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java new file mode 100644 index 000000000..f8ce3cc2f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.util.StringRepresentable; + +public enum NetworkTransmitterState implements StringRepresentable { + ACTIVE("active"), + ERROR("error"), + INACTIVE("inactive"); + + private final String name; + + NetworkTransmitterState(final String name) { + this.name = name; + } + + @Override + public String getSerializedName() { + return name; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java new file mode 100644 index 000000000..4fc4aa4ed --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.network.chat.Component; + +public record NetworkTransmitterStatus(boolean error, Component message) { + static NetworkTransmitterStatus error(final Component message) { + return new NetworkTransmitterStatus(true, message); + } + + static NetworkTransmitterStatus message(final Component message) { + return new NetworkTransmitterStatus(false, message); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/package-info.java new file mode 100644 index 000000000..71023c966 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.networking; + +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/packet/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/package-info.java deleted file mode 100644 index a09ff90e2..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.packet; - -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/recipe/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/package-info.java deleted file mode 100644 index ae708cfeb..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.recipe; - -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/integration/recipemod/CompositeIngredientConverter.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/CompositeIngredientConverter.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/CompositeIngredientConverter.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/CompositeIngredientConverter.java index 7d2c93148..5e266022a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/CompositeIngredientConverter.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/CompositeIngredientConverter.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod; +package com.refinedmods.refinedstorage2.platform.common.recipemod; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; import java.util.Collection; import java.util.HashSet; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ClickableIngredient.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java similarity index 65% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ClickableIngredient.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java index 4615c14ed..b686450c9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ClickableIngredient.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ClickableIngredient.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import mezz.jei.api.ingredients.ITypedIngredient; import mezz.jei.api.runtime.IClickableIngredient; import net.minecraft.client.renderer.Rect2i; -public class ClickableIngredient implements IClickableIngredient { +class ClickableIngredient implements IClickableIngredient { private final ITypedIngredient ingredient; private final Rect2i area; - public ClickableIngredient(final ITypedIngredient ingredient, final int x, final int y) { + ClickableIngredient(final ITypedIngredient ingredient, final int x, final int y) { this.ingredient = ingredient; area = new Rect2i(x, y, 16, 16); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/CraftingGridRecipeTransferHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/CraftingGridRecipeTransferHandler.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java index fbc6f3937..90fba8272 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/CraftingGridRecipeTransferHandler.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/CraftingGridRecipeTransferHandler.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import java.util.List; import java.util.Optional; @@ -22,8 +22,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; -public class CraftingGridRecipeTransferHandler - implements IRecipeTransferHandler { +class CraftingGridRecipeTransferHandler implements IRecipeTransferHandler { @Override public Class getContainerClass() { return CraftingGridContainerMenu.class; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ExclusionZonesGuiContainerHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java similarity index 50% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ExclusionZonesGuiContainerHandler.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java index ac7830d0c..4f16d153a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ExclusionZonesGuiContainerHandler.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ExclusionZonesGuiContainerHandler.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import java.util.List; import mezz.jei.api.gui.handlers.IGuiContainerHandler; import net.minecraft.client.renderer.Rect2i; -public class ExclusionZonesGuiContainerHandler implements IGuiContainerHandler> { +class ExclusionZonesGuiContainerHandler implements IGuiContainerHandler> { @Override public List getGuiExtraAreas(final AbstractBaseScreen screen) { return screen.getExclusionZones(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GhostIngredientHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GhostIngredientHandler.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java index 7e271daf8..3fc979898 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GhostIngredientHandler.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GhostIngredientHandler.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; import java.util.ArrayList; import java.util.Collections; @@ -17,10 +17,10 @@ import net.minecraft.client.renderer.Rect2i; @SuppressWarnings("rawtypes") -public class GhostIngredientHandler implements IGhostIngredientHandler { +class GhostIngredientHandler implements IGhostIngredientHandler { private final IngredientConverter ingredientConverter; - public GhostIngredientHandler(final IngredientConverter ingredientConverter) { + GhostIngredientHandler(final IngredientConverter ingredientConverter) { this.ingredientConverter = ingredientConverter; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GridGuiContainerHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GridGuiContainerHandler.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java index 2cf862cb3..8c7963508 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GridGuiContainerHandler.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridGuiContainerHandler.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.AbstractGridScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen; import java.util.Optional; @@ -12,11 +12,11 @@ import mezz.jei.api.runtime.IClickableIngredient; import mezz.jei.api.runtime.IIngredientManager; -public class GridGuiContainerHandler implements IGuiContainerHandler> { +class GridGuiContainerHandler implements IGuiContainerHandler> { private final IngredientConverter converter; private final IIngredientManager ingredientManager; - public GridGuiContainerHandler(final IngredientConverter converter, final IIngredientManager ingredientManager) { + GridGuiContainerHandler(final IngredientConverter converter, final IIngredientManager ingredientManager) { this.converter = converter; this.ingredientManager = ingredientManager; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GridResourceIngredientConverter.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridResourceIngredientConverter.java similarity index 64% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GridResourceIngredientConverter.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridResourceIngredientConverter.java index 48f12da92..3cde9afa4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/GridResourceIngredientConverter.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/GridResourceIngredientConverter.java @@ -1,18 +1,18 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.FluidGridResource; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.view.FluidGridResource; +import com.refinedmods.refinedstorage2.platform.common.grid.view.ItemGridResource; import java.util.Optional; import mezz.jei.api.helpers.IPlatformFluidHelper; -public class GridResourceIngredientConverter implements IngredientConverter { +class GridResourceIngredientConverter implements IngredientConverter { private final IPlatformFluidHelper fluidHelper; - public GridResourceIngredientConverter(final IPlatformFluidHelper fluidHelper) { + GridResourceIngredientConverter(final IPlatformFluidHelper fluidHelper) { this.fluidHelper = fluidHelper; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/JeiGridSynchronizer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/JeiGridSynchronizer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java index 816ce48a3..828bf95a6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/JeiGridSynchronizer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiGridSynchronizer.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.AbstractGridSynchronizer; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridSynchronizer; import javax.annotation.Nullable; @@ -9,7 +9,7 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -public class JeiGridSynchronizer extends AbstractGridSynchronizer { +class JeiGridSynchronizer extends AbstractGridSynchronizer { private static final MutableComponent TITLE = createTranslation("gui", "grid.synchronizer.jei"); private static final MutableComponent TITLE_TWO_WAY = createTranslation("gui", "grid.synchronizer.jei.two_way"); private static final Component HELP = createTranslation("gui", "grid.synchronizer.jei.help"); @@ -18,7 +18,7 @@ public class JeiGridSynchronizer extends AbstractGridSynchronizer { private final JeiProxy jeiProxy; private final boolean twoWay; - public JeiGridSynchronizer(final JeiProxy jeiProxy, final boolean twoWay) { + JeiGridSynchronizer(final JeiProxy jeiProxy, final boolean twoWay) { this.jeiProxy = jeiProxy; this.twoWay = twoWay; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/JeiProxy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/JeiProxy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java index a57c59bd5..fc1f40c9e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/JeiProxy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/JeiProxy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import mezz.jei.api.runtime.IJeiRuntime; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/MissingItemRecipeTransferError.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/MissingItemRecipeTransferError.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java index 114ddd75b..698f0a00e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/MissingItemRecipeTransferError.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/MissingItemRecipeTransferError.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import java.awt.Color; import java.util.List; @@ -14,7 +14,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.util.FormattedCharSequence; -public class MissingItemRecipeTransferError implements IRecipeTransferError { +class MissingItemRecipeTransferError implements IRecipeTransferError { private static final Color COLOR = new Color(1.0f, 0.0f, 0.0f, 0.4f); private static final List MISSING_MESSAGE = List.of( Component.translatable("jei.tooltip.transfer").getVisualOrderText(), @@ -24,7 +24,7 @@ public class MissingItemRecipeTransferError implements IRecipeTransferError { private final List slotsWithMissingItems; - public MissingItemRecipeTransferError(final List slotsWithMissingItems) { + MissingItemRecipeTransferError(final List slotsWithMissingItems) { this.slotsWithMissingItems = slotsWithMissingItems; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/RefinedStorageJeiModPlugin.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/RefinedStorageJeiModPlugin.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java index b3291425f..7c322fa83 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/RefinedStorageJeiModPlugin.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/RefinedStorageJeiModPlugin.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.AbstractGridScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ResourceGuiContainerHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ResourceGuiContainerHandler.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java index 428977573..5a45963ce 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ResourceGuiContainerHandler.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceGuiContainerHandler.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import java.util.Optional; import javax.annotation.Nullable; @@ -13,12 +13,12 @@ import mezz.jei.api.runtime.IClickableIngredient; import mezz.jei.api.runtime.IIngredientManager; -public class ResourceGuiContainerHandler implements IGuiContainerHandler> { +class ResourceGuiContainerHandler implements IGuiContainerHandler> { private final IngredientConverter converter; private final IIngredientManager ingredientManager; - public ResourceGuiContainerHandler(final IngredientConverter converter, - final IIngredientManager ingredientManager) { + ResourceGuiContainerHandler(final IngredientConverter converter, + final IIngredientManager ingredientManager) { this.converter = converter; this.ingredientManager = ingredientManager; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ResourceIngredientConverter.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceIngredientConverter.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ResourceIngredientConverter.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceIngredientConverter.java index d46c7c58a..c4b6fd31d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/integration/recipemod/jei/ResourceIngredientConverter.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/ResourceIngredientConverter.java @@ -1,21 +1,21 @@ -package com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei; +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; import mezz.jei.api.helpers.IPlatformFluidHelper; import net.minecraft.world.item.ItemStack; -public class ResourceIngredientConverter implements IngredientConverter { +class ResourceIngredientConverter implements IngredientConverter { private final IPlatformFluidHelper fluidHelper; - public ResourceIngredientConverter(final IPlatformFluidHelper fluidHelper) { + ResourceIngredientConverter(final IPlatformFluidHelper fluidHelper) { this.fluidHelper = fluidHelper; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java new file mode 100644 index 000000000..7d9498461 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/jei/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.recipemod.jei; + +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/recipemod/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/package-info.java new file mode 100644 index 000000000..51b4e8ecf --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipemod/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.recipemod; + +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/render/entity/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/entity/package-info.java deleted file mode 100644 index 0dde66e2a..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/entity/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.render.entity; - -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/render/model/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/package-info.java deleted file mode 100644 index 265163d45..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.render.model; - -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/render/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/package-info.java deleted file mode 100644 index ccef01fd0..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.render; - -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/screen/TooltipRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/TooltipRenderer.java deleted file mode 100644 index 602ded5ff..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/TooltipRenderer.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; - -import java.util.List; - -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.network.chat.Component; - -@FunctionalInterface -public interface TooltipRenderer { - void render(GuiGraphics graphics, List lines, int x, int y); -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/package-info.java deleted file mode 100644 index 0c5bbe0aa..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.screen.amount; - -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/screen/grid/hint/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/package-info.java deleted file mode 100644 index 839ca5cc4..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/hint/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ - -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.screen.grid.hint; - -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/screen/grid/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/package-info.java deleted file mode 100644 index a869e42dc..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.screen.grid; - -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/screen/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/package-info.java deleted file mode 100644 index ecf4395a5..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.screen; - -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/screen/tooltip/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/package-info.java deleted file mode 100644 index 3faf55777..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; - -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/screen/widget/ConstructorDropItemsSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ConstructorDropItemsSideButtonWidget.java deleted file mode 100644 index d8d900e65..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ConstructorDropItemsSideButtonWidget.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; - -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; - -import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; - -public class ConstructorDropItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { - public ConstructorDropItemsSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "constructor.drop_items")); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 80 : 64; - } - - @Override - protected int getYTexture() { - return 16; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/DestructorPickupItemsSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/DestructorPickupItemsSideButtonWidget.java deleted file mode 100644 index bc8f403d5..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/DestructorPickupItemsSideButtonWidget.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; - -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; - -import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; - -public class DestructorPickupItemsSideButtonWidget extends AbstractYesNoSideButtonWidget { - public DestructorPickupItemsSideButtonWidget(final ClientProperty property) { - super(property, createTranslation("gui", "destructor.pickup_items")); - } - - @Override - protected int getXTexture() { - return Boolean.TRUE.equals(property.getValue()) ? 64 : 80; - } - - @Override - protected int getYTexture() { - return 0; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/package-info.java deleted file mode 100644 index db748f677..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.common.screen.widget; - -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/containermenu/storage/AbstractStorageContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/AbstractStorageContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java index c4fa0e6bb..b453684b8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/AbstractStorageContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageContainerMenu.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; import com.refinedmods.refinedstorage2.api.storage.AccessMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +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.ServerProperty; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.MenuType; @@ -14,10 +14,10 @@ public abstract class AbstractStorageContainerMenu extends AbstractResourceContainerMenu { protected AbstractStorageContainerMenu(final MenuType type, final int syncId) { super(type, syncId); - registerProperty(new ClientProperty<>(PropertyTypes.PRIORITY, 0)); + registerProperty(new ClientProperty<>(StoragePropertyTypes.PRIORITY, 0)); registerProperty(new ClientProperty<>(PropertyTypes.FILTER_MODE, FilterMode.BLOCK)); registerProperty(new ClientProperty<>(PropertyTypes.FUZZY_MODE, false)); - registerProperty(new ClientProperty<>(PropertyTypes.ACCESS_MODE, AccessMode.INSERT_EXTRACT)); + registerProperty(new ClientProperty<>(StoragePropertyTypes.ACCESS_MODE, AccessMode.INSERT_EXTRACT)); registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); } @@ -27,7 +27,7 @@ protected AbstractStorageContainerMenu(final MenuType type, final StorageConfigurationContainer configContainer) { super(type, syncId, player); registerProperty(new ServerProperty<>( - PropertyTypes.PRIORITY, + StoragePropertyTypes.PRIORITY, configContainer::getPriority, configContainer::setPriority )); @@ -42,7 +42,7 @@ protected AbstractStorageContainerMenu(final MenuType type, configContainer::setFuzzyMode )); registerProperty(new ServerProperty<>( - PropertyTypes.ACCESS_MODE, + StoragePropertyTypes.ACCESS_MODE, configContainer::getAccessMode, configContainer::setAccessMode )); @@ -53,7 +53,7 @@ protected AbstractStorageContainerMenu(final MenuType type, )); } - public boolean shouldDisplayFilterModeWarning() { + boolean shouldDisplayFilterModeWarning() { return getProperty(PropertyTypes.FILTER_MODE).getValue() == FilterMode.ALLOW && areAllResourceSlotsEmpty(); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractStorageScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java similarity index 76% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractStorageScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java index e4cf2c900..63a6e7a76 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractStorageScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AbstractStorageScreen.java @@ -1,16 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; - -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.AbstractStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageAccessor; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.StorageTooltipHelper; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AccessModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.PrioritySideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.ProgressWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; +package com.refinedmods.refinedstorage2.platform.common.storage; + +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; +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.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FuzzyModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.ProgressWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; import java.util.ArrayList; import java.util.List; @@ -74,9 +70,9 @@ protected void init() { getMenu().getProperty(PropertyTypes.FUZZY_MODE), FuzzyModeSideButtonWidget.Type.STORAGE )); - addSideButton(new AccessModeSideButtonWidget(getMenu().getProperty(PropertyTypes.ACCESS_MODE))); + addSideButton(new AccessModeSideButtonWidget(getMenu().getProperty(StoragePropertyTypes.ACCESS_MODE))); addSideButton(new PrioritySideButtonWidget( - getMenu().getProperty(PropertyTypes.PRIORITY), + getMenu().getProperty(StoragePropertyTypes.PRIORITY), playerInventory, this )); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AccessModeSettings.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AccessModeSettings.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AccessModeSettings.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AccessModeSettings.java index 2b9e27d24..1672f1fe7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AccessModeSettings.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AccessModeSettings.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.storage.AccessMode; -public class AccessModeSettings { +class AccessModeSettings { private static final int INSERT_EXTRACT = 0; private static final int INSERT = 1; private static final int EXTRACT = 2; @@ -10,7 +10,7 @@ public class AccessModeSettings { private AccessModeSettings() { } - public static AccessMode getAccessMode(final int accessMode) { + static AccessMode getAccessMode(final int accessMode) { return switch (accessMode) { case INSERT_EXTRACT -> AccessMode.INSERT_EXTRACT; case INSERT -> AccessMode.INSERT; @@ -19,7 +19,7 @@ public static AccessMode getAccessMode(final int accessMode) { }; } - public static int getAccessMode(final AccessMode accessMode) { + static int getAccessMode(final AccessMode accessMode) { return switch (accessMode) { case INSERT_EXTRACT -> INSERT_EXTRACT; case INSERT -> INSERT; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AccessModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AccessModeSideButtonWidget.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AccessModeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AccessModeSideButtonWidget.java index 08e73ed44..957f45eb2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AccessModeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/AccessModeSideButtonWidget.java @@ -1,7 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.storage.AccessMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +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; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/BucketPlayerInventoryInsertableStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/BucketPlayerInventoryInsertableStorage.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/BucketPlayerInventoryInsertableStorage.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/BucketPlayerInventoryInsertableStorage.java index f102d74e2..a1f5a397b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/BucketPlayerInventoryInsertableStorage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/BucketPlayerInventoryInsertableStorage.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; import com.refinedmods.refinedstorage2.api.storage.Storage; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/ClientStorageRepository.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ClientStorageRepository.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/ClientStorageRepository.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ClientStorageRepository.java index ca2cc6854..330d2fa6a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/ClientStorageRepository.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ClientStorageRepository.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.CoreValidations; import com.refinedmods.refinedstorage2.api.storage.Storage; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/FluidStorageType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/FluidStorageType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java index d56a8d2c1..6822e780f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/FluidStorageType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.type; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl; @@ -9,12 +9,10 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.LimitedPlatformStorage; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.PlatformStorage; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/ItemStorageType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/ItemStorageType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java index f2270d09f..fbf747c35 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/ItemStorageType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.type; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl; @@ -9,11 +9,9 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.LimitedPlatformStorage; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.PlatformStorage; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/LimitedPlatformStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/LimitedPlatformStorage.java new file mode 100644 index 000000000..763883d98 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/LimitedPlatformStorage.java @@ -0,0 +1,23 @@ +package com.refinedmods.refinedstorage2.platform.common.storage; + +import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorage; +import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl; +import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; + +class LimitedPlatformStorage extends PlatformStorage implements LimitedStorage { + private final LimitedStorageImpl limitedStorage; + + LimitedPlatformStorage(final LimitedStorageImpl delegate, + final StorageType type, + final TrackedStorageRepository trackingRepository, + final Runnable listener) { + super(delegate, type, trackingRepository, listener); + this.limitedStorage = delegate; + } + + @Override + public long getCapacity() { + return limitedStorage.getCapacity(); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/PlatformStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/PlatformStorage.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java index 7dcf36f6d..33594de43 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/PlatformStorage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.AbstractProxyStorage; @@ -10,27 +10,27 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.SerializableStorage; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; import java.util.Optional; import javax.annotation.Nullable; -public class PlatformStorage extends AbstractProxyStorage implements SerializableStorage, TrackedStorage { +class PlatformStorage extends AbstractProxyStorage implements SerializableStorage, TrackedStorage { private final StorageType type; private final TrackedStorageRepository trackingRepository; private final Runnable listener; - public PlatformStorage(final Storage delegate, - final StorageType type, - final TrackedStorageRepository trackingRepository, - final Runnable listener) { + PlatformStorage(final Storage delegate, + final StorageType type, + final TrackedStorageRepository trackingRepository, + final Runnable listener) { super(delegate); this.type = type; this.trackingRepository = trackingRepository; this.listener = listener; } - public void load(final T resource, final long amount, @Nullable final String changedBy, final long changedAt) { + void load(final T resource, final long amount, @Nullable final String changedBy, final long changedAt) { super.insert(resource, amount, Action.EXECUTE, EmptyActor.INSTANCE); if (changedBy != null && !changedBy.isBlank()) { trackingRepository.update(resource, new PlayerActor(changedBy), changedAt); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/PrioritySideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PrioritySideButtonWidget.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/PrioritySideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PrioritySideButtonWidget.java index dfa2b79aa..94fc285af 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/PrioritySideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/PrioritySideButtonWidget.java @@ -1,7 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.storage; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.screen.amount.PriorityScreen; +import com.refinedmods.refinedstorage2.platform.common.support.amount.PriorityScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/StorageAccessor.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageAccessor.java similarity index 63% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/StorageAccessor.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageAccessor.java index e3a43e111..f45b0818b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/StorageAccessor.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; public interface StorageAccessor { long getStored(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/StorageConfigurationContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageConfigurationContainer.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/StorageConfigurationContainer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageConfigurationContainer.java index c2dd98edb..723141478 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/StorageConfigurationContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageConfigurationContainer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; import com.refinedmods.refinedstorage2.api.storage.AccessMode; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; public interface StorageConfigurationContainer { int getPriority(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/StorageConfigurationContainerImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageConfigurationContainerImpl.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/StorageConfigurationContainerImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageConfigurationContainerImpl.java index 3fb40d138..883d6afd6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/StorageConfigurationContainerImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageConfigurationContainerImpl.java @@ -1,10 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; import com.refinedmods.refinedstorage2.api.network.node.StorageConfiguration; import com.refinedmods.refinedstorage2.api.storage.AccessMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageConfigurationContainer; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; import java.util.function.Consumer; import java.util.function.Supplier; @@ -26,8 +27,7 @@ public StorageConfigurationContainerImpl(final StorageConfiguration config, final FilterWithFuzzyMode filter, final Runnable listener, final Supplier redstoneModeSupplier, - final Consumer redstoneModeConsumer - ) { + final Consumer redstoneModeConsumer) { this.config = config; this.filter = filter; this.listener = listener; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/StorageContainerItemHelperImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/StorageContainerItemHelperImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java index 8f2688022..bb6802484 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/StorageContainerItemHelperImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageContainerItemHelperImpl.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItemHelper; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItemHelper; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.StorageTooltipHelper; import java.util.List; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StoragePropertyTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StoragePropertyTypes.java new file mode 100644 index 000000000..b083228b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StoragePropertyTypes.java @@ -0,0 +1,21 @@ +package com.refinedmods.refinedstorage2.platform.common.storage; + +import com.refinedmods.refinedstorage2.api.storage.AccessMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +public final class StoragePropertyTypes { + public static final PropertyType PRIORITY = PropertyTypes.createIntegerProperty( + createIdentifier("priority") + ); + public static final PropertyType ACCESS_MODE = new PropertyType<>( + createIdentifier("access_mode"), + AccessModeSettings::getAccessMode, + AccessModeSettings::getAccessMode + ); + + private StoragePropertyTypes() { + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageRepositoryImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageRepositoryImpl.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageRepositoryImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageRepositoryImpl.java index fb890bb37..34f75ae7f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageRepositoryImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageRepositoryImpl.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.CoreValidations; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.storage.SerializableStorage; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageTooltipHelper.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageTooltipHelper.java similarity index 61% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageTooltipHelper.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageTooltipHelper.java index 4c479ad03..8b7334c2b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageTooltipHelper.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageTooltipHelper.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; @@ -8,13 +8,13 @@ import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; -public final class StorageTooltipHelper { +final class StorageTooltipHelper { private StorageTooltipHelper() { } - public static void addAmountStoredWithoutCapacity(final List tooltip, - final long stored, - final LongFunction quantityFormatter) { + static void addAmountStoredWithoutCapacity(final List tooltip, + final long stored, + final LongFunction quantityFormatter) { tooltip.add(PlatformApi.INSTANCE.createTranslation( "misc", "stored", @@ -22,10 +22,10 @@ public static void addAmountStoredWithoutCapacity(final List tooltip, ).withStyle(ChatFormatting.GRAY)); } - public static void addAmountStoredWithCapacity(final List tooltip, - final long stored, - final long capacity, - final LongFunction quantityFormatter) { + static void addAmountStoredWithCapacity(final List tooltip, + final long stored, + final long capacity, + final LongFunction quantityFormatter) { if (capacity <= 0) { addAmountStoredWithoutCapacity(tooltip, stored, quantityFormatter); return; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageTypes.java new file mode 100644 index 000000000..98cf8a896 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageTypes.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage2.platform.common.storage; + +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; + +public final class StorageTypes { + public static final StorageType ITEM = new ItemStorageType(); + public static final StorageType FLUID = new FluidStorageType(); + + private StorageTypes() { + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/FluidStorageChannelType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/FluidStorageChannelType.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/FluidStorageChannelType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/FluidStorageChannelType.java index b9566d1c2..e6a324666 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/FluidStorageChannelType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/FluidStorageChannelType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.channel; +package com.refinedmods.refinedstorage2.platform.common.storage.channel; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperationsImpl; @@ -8,14 +8,14 @@ import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.list.FuzzyResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.list.FuzzyResourceListImpl; import com.refinedmods.refinedstorage2.platform.api.storage.channel.AbstractPlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.FuzzyStorageChannelImpl; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.list.FuzzyResourceList; +import com.refinedmods.refinedstorage2.platform.api.support.resource.list.FuzzyResourceListImpl; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.FluidGridResource; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.grid.view.FluidGridResource; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/ItemStorageChannelType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/ItemStorageChannelType.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/ItemStorageChannelType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/ItemStorageChannelType.java index 307e1dcb7..909c14bce 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/ItemStorageChannelType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/ItemStorageChannelType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.channel; +package com.refinedmods.refinedstorage2.platform.common.storage.channel; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperationsImpl; @@ -8,14 +8,14 @@ import com.refinedmods.refinedstorage2.api.resource.list.ResourceListImpl; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.list.FuzzyResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.list.FuzzyResourceListImpl; import com.refinedmods.refinedstorage2.platform.api.storage.channel.AbstractPlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.channel.FuzzyStorageChannelImpl; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.list.FuzzyResourceList; +import com.refinedmods.refinedstorage2.platform.api.support.resource.list.FuzzyResourceListImpl; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.ItemGridResource; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/StorageChannelTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/StorageChannelTypes.java similarity index 61% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/StorageChannelTypes.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/StorageChannelTypes.java index b7f830692..01e9179c3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/channel/StorageChannelTypes.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/StorageChannelTypes.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.channel; +package com.refinedmods.refinedstorage2.platform.common.storage.channel; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; public final class StorageChannelTypes { public static final PlatformStorageChannelType ITEM = new ItemStorageChannelType(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/package-info.java new file mode 100644 index 000000000..72cbfb5b1 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/channel/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.storage.channel; + +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/block/entity/diskdrive/AbstractDiskDriveBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/AbstractDiskDriveBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java index 2e99a8364..8e81c6854 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/AbstractDiskDriveBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageListener; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode; @@ -6,18 +6,16 @@ import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageStorageState; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.BlockEntityWithDrops; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive.DiskDriveContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive.EmptyStorageDiskInfoAccessor; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +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.ExtendedMenuProvider; +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 com.refinedmods.refinedstorage2.platform.common.util.LevelUtil; import javax.annotation.Nullable; @@ -42,12 +40,11 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.BooleanProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class AbstractDiskDriveBlockEntity - extends AbstractInternalNetworkNodeContainerBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements BlockEntityWithDrops, MultiStorageListener, ExtendedMenuProvider { public static final int AMOUNT_OF_DISKS = 8; @@ -95,7 +92,7 @@ public static boolean hasDisk(final CompoundTag tag, final int slot) { && ContainerUtil.hasItemInSlot(tag.getCompound(TAG_DISK_INVENTORY), slot); } - public void updateDiskStateIfNecessaryInLevel() { + void updateDiskStateIfNecessaryInLevel() { if (!syncRequested) { return; } @@ -145,31 +142,36 @@ private void initialize(final Level level) { } @Override - public void activenessChanged(final BlockState state, - final boolean newActive, - @Nullable final BooleanProperty activenessProperty) { - super.activenessChanged(state, newActive, activenessProperty); - LevelUtil.updateBlock(level, worldPosition, getBlockState()); + public void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + updateBlock(); } @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); configContainer.load(tag); filter.load(tag); - - super.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); } @@ -180,7 +182,7 @@ public SimpleContainer getDiskInventory() { void onDiskChanged(final int slot) { getNode().onStorageChanged(slot); - LevelUtil.updateBlock(level, worldPosition, this.getBlockState()); + updateBlock(); setChanged(); } @@ -194,16 +196,14 @@ protected void onNetworkInNodeInitialized() { super.onNetworkInNodeInitialized(); // It's important to sync here as the initial update packet might have failed as the network // could possibly be not initialized yet. - LevelUtil.updateBlock(level, worldPosition, this.getBlockState()); + updateBlock(); } private void fromClientTag(final CompoundTag tag) { if (!tag.contains(TAG_STATES)) { return; } - final ListTag statesList = tag.getList(TAG_STATES, Tag.TAG_BYTE); - driveState = MultiStorageState.of( statesList.size(), idx -> { @@ -215,12 +215,11 @@ private void fromClientTag(final CompoundTag tag) { return values[ordinal]; } ); - onDriveStateUpdated(); } protected void onDriveStateUpdated() { - LevelUtil.updateBlock(level, worldPosition, getBlockState()); + updateBlock(); } @Override @@ -273,4 +272,10 @@ public NonNullList getDrops() { 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/render/entity/AbstractDiskDriveBlockEntityRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/entity/AbstractDiskDriveBlockEntityRenderer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java index 1080c43c1..4049f051c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/entity/AbstractDiskDriveBlockEntityRenderer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/AbstractDiskDriveBlockEntityRenderer.java @@ -1,11 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.render.entity; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageState; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageStorageState; -import com.refinedmods.refinedstorage2.platform.common.block.DiskDriveBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.render.CubeBuilder; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.support.render.CubeBuilder; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DiskDriveBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java similarity index 76% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DiskDriveBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java index c1d252797..597b90aff 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DiskDriveBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlock.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block; - -import com.refinedmods.refinedstorage2.platform.common.block.direction.BiDirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.DiskDriveBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.item.block.SimpleBlockItem; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; + +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.SimpleBlockItem; +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; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/DiskDriveBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/DiskDriveBlockEntityTicker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java index c6646cdd1..586b361cd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/DiskDriveBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveBlockEntityTicker.java @@ -1,19 +1,19 @@ -package com.refinedmods.refinedstorage2.platform.common.block.ticker; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; 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.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -public class DiskDriveBlockEntityTicker +class DiskDriveBlockEntityTicker extends NetworkNodeBlockEntityTicker { @SuppressWarnings("unchecked") - public DiskDriveBlockEntityTicker() { + DiskDriveBlockEntityTicker() { super(() -> (BlockEntityType) BlockEntities.INSTANCE.getDiskDrive()); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/DiskDriveContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/DiskDriveContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java index 753856c63..077ef877a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/DiskDriveContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveContainerMenu.java @@ -1,17 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItem; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ValidatedSlot; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.AbstractStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageAccessor; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageConfigurationContainer; +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.internal.resource.ResourceContainerImpl; +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.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.ArrayList; import java.util.List; @@ -51,12 +50,12 @@ public DiskDriveContainerMenu(final int syncId, final Inventory playerInventory, initializeResourceSlots(buf); } - public DiskDriveContainerMenu(final int syncId, - final Player player, - final SimpleContainer diskInventory, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer, - final StorageDiskInfoAccessor storageInfoAccessor) { + DiskDriveContainerMenu(final int syncId, + final Player player, + final SimpleContainer diskInventory, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer, + final StorageDiskInfoAccessor storageInfoAccessor) { super(Menus.INSTANCE.getDiskDrive(), syncId, player, configContainer); this.storageInfoAccessor = storageInfoAccessor; addSlots(player, diskInventory, resourceContainer); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/DiskDriveInventory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/DiskDriveInventory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java index 4b314f931..69903ed5b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/diskdrive/DiskDriveInventory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveInventory.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageProvider; import com.refinedmods.refinedstorage2.api.storage.TypedStorage; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItem; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItem; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import java.util.Optional; @@ -11,17 +11,17 @@ import net.minecraft.world.SimpleContainer; import net.minecraft.world.item.ItemStack; -public class DiskDriveInventory extends SimpleContainer implements MultiStorageProvider { +class DiskDriveInventory extends SimpleContainer implements MultiStorageProvider { private final AbstractDiskDriveBlockEntity diskDrive; @Nullable private StorageRepository storageRepository; - public DiskDriveInventory(final AbstractDiskDriveBlockEntity diskDrive, final int diskCount) { + DiskDriveInventory(final AbstractDiskDriveBlockEntity diskDrive, final int diskCount) { super(diskCount); this.diskDrive = diskDrive; } - public void setStorageRepository(@Nullable final StorageRepository storageRepository) { + void setStorageRepository(@Nullable final StorageRepository storageRepository) { this.storageRepository = storageRepository; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/DiskDriveScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveScreen.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/DiskDriveScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveScreen.java index cac6204bb..62d0c0c06 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/DiskDriveScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/DiskDriveScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive.DiskDriveContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.AbstractStorageScreen; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/EmptyStorageDiskInfoAccessor.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java similarity index 60% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/EmptyStorageDiskInfoAccessor.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java index d4ac47b4c..b43cde2a9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/EmptyStorageDiskInfoAccessor.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/EmptyStorageDiskInfoAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; @@ -6,7 +6,7 @@ import net.minecraft.world.item.ItemStack; -public class EmptyStorageDiskInfoAccessor implements StorageDiskInfoAccessor { +class EmptyStorageDiskInfoAccessor implements StorageDiskInfoAccessor { @Override public Optional getInfo(final ItemStack stack) { return Optional.empty(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/StorageDiskInfoAccessor.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/StorageDiskInfoAccessor.java similarity index 59% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/StorageDiskInfoAccessor.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/StorageDiskInfoAccessor.java index 4c1827edc..8e0c09bc4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/StorageDiskInfoAccessor.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/StorageDiskInfoAccessor.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; @@ -6,6 +6,6 @@ import net.minecraft.world.item.ItemStack; -public interface StorageDiskInfoAccessor { +interface StorageDiskInfoAccessor { Optional getInfo(ItemStack stack); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/StorageDiskInfoAccessorImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java similarity index 65% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/StorageDiskInfoAccessorImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java index bda3cb129..b7b49b413 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/diskdrive/StorageDiskInfoAccessorImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/StorageDiskInfoAccessorImpl.java @@ -1,17 +1,17 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.diskdrive; +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; -import com.refinedmods.refinedstorage2.platform.api.item.StorageContainerItem; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageContainerItem; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import java.util.Optional; import net.minecraft.world.item.ItemStack; -public class StorageDiskInfoAccessorImpl implements StorageDiskInfoAccessor { +class StorageDiskInfoAccessorImpl implements StorageDiskInfoAccessor { private final StorageRepository storageRepository; - public StorageDiskInfoAccessorImpl(final StorageRepository storageRepository) { + StorageDiskInfoAccessorImpl(final StorageRepository storageRepository) { this.storageRepository = storageRepository; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/package-info.java new file mode 100644 index 000000000..96fe08d70 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/diskdrive/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.storage.diskdrive; + +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/block/ExternalStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ExternalStorageBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java index fc5cb0972..ef3f47bc4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ExternalStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlock.java @@ -1,12 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; -import com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage.ExternalStorageBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalCableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.DirectionalCableBlockShapes; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java index 94bebab8c..027a31103 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageBlockEntity.java @@ -1,165 +1,177 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage; - -import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExternalStorageNetworkNode; -import com.refinedmods.refinedstorage2.api.network.node.externalstorage.ExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; -import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.ExternalStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; - -import java.util.Optional; -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.Tag; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.BooleanProperty; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ExternalStorageBlockEntity - extends AbstractInternalNetworkNodeContainerBlockEntity - implements ExtendedMenuProvider { - private static final Logger LOGGER = LoggerFactory.getLogger(ExternalStorageBlockEntity.class); - private static final String TAG_TRACKED_RESOURCES = "tr"; - - private final FilterWithFuzzyMode filter; - private final StorageConfigurationContainerImpl configContainer; - private final ExternalStorageTrackedStorageRepositoryProvider trackedStorageRepositoryProvider; - private final WorkRate workRate = new WorkRate(); - private boolean initialized; - - public ExternalStorageBlockEntity(final BlockPos pos, final BlockState state) { - super(BlockEntities.INSTANCE.getExternalStorage(), pos, state, new ExternalStorageNetworkNode( - Platform.INSTANCE.getConfig().getExternalStorage().getEnergyUsage() - )); - this.filter = FilterWithFuzzyMode.createAndListenForUniqueTemplates( - ResourceContainerImpl.createForFilter(), - this::setChanged, - templates -> getNode().setFilterTemplates(templates) - ); - this.trackedStorageRepositoryProvider = new ExternalStorageTrackedStorageRepositoryProvider( - PlatformApi.INSTANCE.getStorageChannelTypeRegistry(), - this::setChanged - ); - getNode().setNormalizer(filter.createNormalizer()); - getNode().initialize( - PlatformApi.INSTANCE.getStorageChannelTypeRegistry().getAll(), - System::currentTimeMillis, - trackedStorageRepositoryProvider - ); - this.configContainer = new StorageConfigurationContainerImpl( - getNode(), - filter, - this::setChanged, - this::getRedstoneMode, - this::setRedstoneMode - ); - } - - @Override - @SuppressWarnings("deprecation") - public void setBlockState(final BlockState newBlockState) { - super.setBlockState(newBlockState); - if (level instanceof ServerLevel serverLevel) { - LOGGER.debug("Reloading external storage @ {} as block state has changed", worldPosition); - loadStorage(serverLevel); - } - } - - @Override - protected void activenessChanged(final BlockState state, - final boolean newActive, - @Nullable final BooleanProperty activenessProperty) { - super.activenessChanged(state, newActive, activenessProperty); - if (!initialized && level instanceof ServerLevel serverLevel) { - LOGGER.debug("Triggering initial load of external storage {}", worldPosition); - loadStorage(serverLevel); - initialized = true; - } - } - - public void loadStorage(final ServerLevel serverLevel) { - final Direction direction = getDirection(); - LOGGER.debug("Loading storage for external storage with direction {} @ {}", direction, worldPosition); - if (direction == null) { - return; - } - getNode().initialize(new ExternalStorageProviderFactory() { - @Override - public Optional> create(final StorageChannelType channelType) { - final Direction incomingDirection = direction.getOpposite(); - final BlockPos sourcePosition = worldPosition.relative(direction); - return PlatformApi.INSTANCE - .getExternalStorageProviderFactories() - .stream() - .flatMap(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, channelType) - .stream()) - .findFirst(); - } - }); - } - - @Override - public void doWork() { - super.doWork(); - if (workRate.canDoWork()) { - final boolean hasChanges = getNode().detectChanges(); - if (hasChanges) { - LOGGER.debug("External storage @ {} has changed!", worldPosition); - workRate.faster(); - } else { - workRate.slower(); - } - } - } - - @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); - filter.save(tag); - configContainer.save(tag); - tag.put(TAG_TRACKED_RESOURCES, trackedStorageRepositoryProvider.toTag()); - } - - @Override - public void load(final CompoundTag tag) { - super.load(tag); - filter.load(tag); - configContainer.load(tag); - trackedStorageRepositoryProvider.fromTag(tag.getList(TAG_TRACKED_RESOURCES, Tag.TAG_COMPOUND)); - } - - @Override - public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { - filter.getFilterContainer().writeToUpdatePacket(buf); - } - - @Override - public Component getDisplayName() { - return ContentNames.EXTERNAL_STORAGE; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { - return new ExternalStorageContainerMenu(syncId, player, filter.getFilterContainer(), configContainer); - } -} +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; + +import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.ExternalStorageNetworkNode; +import com.refinedmods.refinedstorage2.api.network.node.externalstorage.ExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; +import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +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.StorageConfigurationContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; + +import java.util.Optional; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ExternalStorageBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements ExtendedMenuProvider { + private static final Logger LOGGER = LoggerFactory.getLogger(ExternalStorageBlockEntity.class); + private static final String TAG_TRACKED_RESOURCES = "tr"; + + private final FilterWithFuzzyMode filter; + private final StorageConfigurationContainerImpl configContainer; + private final ExternalStorageTrackedStorageRepositoryProvider trackedStorageRepositoryProvider; + private final ExternalStorageWorkRate workRate = new ExternalStorageWorkRate(); + private boolean initialized; + + public ExternalStorageBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getExternalStorage(), pos, state, new ExternalStorageNetworkNode( + Platform.INSTANCE.getConfig().getExternalStorage().getEnergyUsage() + )); + this.filter = FilterWithFuzzyMode.createAndListenForUniqueTemplates( + ResourceContainerImpl.createForFilter(), + this::setChanged, + templates -> getNode().setFilterTemplates(templates) + ); + this.trackedStorageRepositoryProvider = new ExternalStorageTrackedStorageRepositoryProvider( + PlatformApi.INSTANCE.getStorageChannelTypeRegistry(), + this::setChanged + ); + getNode().setNormalizer(filter.createNormalizer()); + getNode().initialize( + PlatformApi.INSTANCE.getStorageChannelTypeRegistry().getAll(), + System::currentTimeMillis, + trackedStorageRepositoryProvider + ); + this.configContainer = new StorageConfigurationContainerImpl( + getNode(), + filter, + this::setChanged, + this::getRedstoneMode, + this::setRedstoneMode + ); + } + + @Override + public void setBlockState(final BlockState newBlockState) { + super.setBlockState(newBlockState); + if (level instanceof ServerLevel serverLevel) { + LOGGER.debug("Reloading external storage @ {} as block state has changed", worldPosition); + loadStorage(serverLevel); + } + } + + @Override + protected void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + if (!initialized && level instanceof ServerLevel serverLevel) { + LOGGER.debug("Triggering initial load of external storage {}", worldPosition); + loadStorage(serverLevel); + initialized = true; + } + } + + void loadStorage(final ServerLevel serverLevel) { + final Direction direction = getDirection(); + LOGGER.debug("Loading storage for external storage with direction {} @ {}", direction, worldPosition); + if (direction == null) { + return; + } + getNode().initialize(new ExternalStorageProviderFactory() { + @Override + public Optional> create(final StorageChannelType channelType) { + final Direction incomingDirection = direction.getOpposite(); + final BlockPos sourcePosition = worldPosition.relative(direction); + return PlatformApi.INSTANCE + .getExternalStorageProviderFactories() + .stream() + .flatMap(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, channelType) + .stream()) + .findFirst(); + } + }); + } + + @Override + public void doWork() { + super.doWork(); + if (workRate.canDoWork()) { + final boolean hasChanges = getNode().detectChanges(); + if (hasChanges) { + LOGGER.debug("External storage @ {} has changed!", worldPosition); + workRate.faster(); + } else { + workRate.slower(); + } + } + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + tag.put(TAG_TRACKED_RESOURCES, trackedStorageRepositoryProvider.toTag()); + } + + @Override + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); + filter.save(tag); + configContainer.save(tag); + } + + @Override + public void load(final CompoundTag tag) { + super.load(tag); + trackedStorageRepositoryProvider.fromTag(tag.getList(TAG_TRACKED_RESOURCES, Tag.TAG_COMPOUND)); + } + + @Override + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); + filter.load(tag); + configContainer.load(tag); + } + + @Override + public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { + filter.getFilterContainer().writeToUpdatePacket(buf); + } + + @Override + public Component getDisplayName() { + return ContentNames.EXTERNAL_STORAGE; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new ExternalStorageContainerMenu(syncId, player, filter.getFilterContainer(), configContainer); + } + + @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/containermenu/storage/ExternalStorageContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/ExternalStorageContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java index e038b320e..c7ae28af0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/ExternalStorageContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageContainerMenu.java @@ -1,9 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.storage.AbstractStorageContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainer; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Inventory; @@ -22,10 +24,10 @@ public ExternalStorageContainerMenu(final int syncId, final Inventory playerInve initializeResourceSlots(buf); } - public ExternalStorageContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { + ExternalStorageContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { super(Menus.INSTANCE.getExternalStorage(), syncId, player, configContainer); addSlots(player, resourceContainer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ExternalStorageScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageScreen.java similarity index 56% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ExternalStorageScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageScreen.java index ab09e6551..8409b7575 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ExternalStorageScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageScreen.java @@ -1,11 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.ExternalStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AccessModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FilterModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.PrioritySideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.storage.AbstractStorageScreen; +import com.refinedmods.refinedstorage2.platform.common.storage.AccessModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.storage.PrioritySideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.storage.StoragePropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractFilterScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FilterModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.widget.FuzzyModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -32,9 +34,9 @@ protected void init() { getMenu().getProperty(PropertyTypes.FUZZY_MODE), FuzzyModeSideButtonWidget.Type.STORAGE )); - addSideButton(new AccessModeSideButtonWidget(getMenu().getProperty(PropertyTypes.ACCESS_MODE))); + addSideButton(new AccessModeSideButtonWidget(getMenu().getProperty(StoragePropertyTypes.ACCESS_MODE))); addSideButton(new PrioritySideButtonWidget( - getMenu().getProperty(PropertyTypes.PRIORITY), + getMenu().getProperty(StoragePropertyTypes.PRIORITY), playerInventory, this )); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageTrackedStorageRepository.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageTrackedStorageRepository.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java index 7754f4103..8ae59bcad 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageTrackedStorageRepository.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepository.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.tracked.InMemoryTrackedStorageRepository; @@ -38,7 +38,7 @@ ListTag toTag() { void fromTag(final ListTag items) { items.forEach(tag -> type.fromTag( - (CompoundTag) tag, + (CompoundTag) tag, // call super here to avoid marking dirty. (resource, trackedResource) -> super.update( resource, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageTrackedStorageRepositoryProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepositoryProvider.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageTrackedStorageRepositoryProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepositoryProvider.java index 6b718854b..01f051694 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/ExternalStorageTrackedStorageRepositoryProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageTrackedStorageRepositoryProvider.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; import com.refinedmods.refinedstorage2.api.network.impl.node.externalstorage.TrackedStorageRepositoryProvider; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/WorkRate.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/WorkRate.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java index 1c530a918..9f1f636e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/externalstorage/WorkRate.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/ExternalStorageWorkRate.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.externalstorage; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; import com.google.common.util.concurrent.RateLimiter; -class WorkRate { +class ExternalStorageWorkRate { private static final double[] RATE_LIMITERS = new double[] { 0.5D, // slowest, every 2 sec 0.75D, // faster @@ -14,11 +14,11 @@ class WorkRate { private int idx = 2; // medium private final RateLimiter rateLimiter = RateLimiter.create(RATE_LIMITERS[idx]); - public boolean canDoWork() { + boolean canDoWork() { return rateLimiter.tryAcquire(); } - public void faster() { + void faster() { if (idx + 1 >= RATE_LIMITERS.length) { return; } @@ -26,7 +26,7 @@ public void faster() { updateRate(); } - public void slower() { + void slower() { if (idx - 1 < 0) { return; } diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/package-info.java similarity index 72% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/package-info.java index 34cea1edd..dbd3fe16a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/storagemonitor/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/externalstorage/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storage.externalstorage; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/block/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/package-info.java similarity index 76% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/block/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/package-info.java index 251629c87..d5c5c0aa4 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/item/block/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.item.block; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlock.java similarity index 72% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractStorageBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlock.java index 9f7aed88c..517bad963 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlock.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.AbstractStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import javax.annotation.Nullable; @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -public abstract class AbstractStorageBlock> extends AbstractBaseBlock +abstract class AbstractStorageBlock> extends AbstractBaseBlock implements EntityBlock { private final AbstractBlockEntityTicker ticker; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/AbstractStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/AbstractStorageBlockBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java index ccce42bcf..bcd83af57 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/AbstractStorageBlockBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockBlockEntity.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storage; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; 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.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.StorageConfigurationContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +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.UUID; @@ -26,8 +26,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public abstract class AbstractStorageBlockBlockEntity - extends AbstractInternalNetworkNodeContainerBlockEntity> +abstract class AbstractStorageBlockBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity> implements ExtendedMenuProvider { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractStorageBlockBlockEntity.class); @@ -90,7 +90,7 @@ public void setLevel(final Level level) { } } - public void modifyStorageIdAfterAlreadyInitialized(final UUID actualStorageId) { + void modifyStorageIdAfterAlreadyInitialized(final UUID actualStorageId) { LOGGER.debug( "Storage {} got placed through nbt, replacing with actual storage {}", storageId, @@ -114,11 +114,14 @@ public void load(final CompoundTag tag) { } storageId = actualStorageId; } + super.load(tag); + } + @Override + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); configContainer.load(tag); filter.load(tag); - - super.load(tag); } @SuppressWarnings("unchecked") @@ -149,6 +152,11 @@ public void saveAdditional(final CompoundTag tag) { if (storageId != null) { tag.putUUID(TAG_STORAGE_ID, storageId); } + } + + @Override + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); configContainer.save(tag); filter.save(tag); } @@ -168,4 +176,5 @@ public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByte buf.writeLong(getNode().getCapacity()); filter.getFilterContainer().writeToUpdatePacket(buf); } + } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/AbstractStorageBlockContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockContainerMenu.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/AbstractStorageBlockContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockContainerMenu.java index 6793f6912..a3cd05fa1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/AbstractStorageBlockContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockContainerMenu.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.AbstractStorageContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageAccessor; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageConfigurationContainer; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +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.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Player; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractStorageBlockScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockScreen.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractStorageBlockScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockScreen.java index 7c349c920..e27f88ae4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractStorageBlockScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/AbstractStorageBlockScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.AbstractStorageBlockContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.storage.AbstractStorageScreen; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -8,7 +8,7 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; -public abstract class AbstractStorageBlockScreen extends AbstractStorageScreen { +abstract class AbstractStorageBlockScreen extends AbstractStorageScreen { private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/storage.png"); protected AbstractStorageBlockScreen(final AbstractStorageBlockContainerMenu menu, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/FluidStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java similarity index 69% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/FluidStorageBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java index 8842b89d2..3ffaa23f7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/FluidStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlock.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.FluidStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/FluidStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/FluidStorageBlockBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java index 3c5fafc96..b80290bcd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/FluidStorageBlockBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockEntity.java @@ -1,15 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storage; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; 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.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.FluidStorageBlockContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/FluidStorageBlockBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/FluidStorageBlockBlockItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java index fc90f5772..d90c54575 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/FluidStorageBlockBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockBlockItem.java @@ -1,12 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.item.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.block.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.AbstractStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.storage.AbstractStorageContainerBlockItem; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import java.util.UUID; import javax.annotation.Nullable; @@ -40,7 +39,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return Platform.INSTANCE.getBucketAmountFormatter().format(amount); + return FluidResourceRendering.format(amount); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/FluidStorageBlockContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java similarity index 63% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/FluidStorageBlockContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java index 2a32bfb65..038e67fe0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/FluidStorageBlockContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockContainerMenu.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageConfigurationContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainer; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Inventory; @@ -22,10 +22,10 @@ public FluidStorageBlockContainerMenu(final int syncId, ); } - public FluidStorageBlockContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { + FluidStorageBlockContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { super(Menus.INSTANCE.getFluidStorage(), syncId, player, resourceContainer, configContainer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/FluidStorageBlockScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java similarity index 60% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/FluidStorageBlockScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java index 0051eb51b..0b8cd277a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/FluidStorageBlockScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/FluidStorageBlockScreen.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.AbstractStorageBlockContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -15,6 +14,6 @@ public FluidStorageBlockScreen(final AbstractStorageBlockContainerMenu menu, @Override protected String formatQuantity(final long qty) { - return Platform.INSTANCE.getBucketAmountFormatter().format(qty); + return FluidResourceRendering.format(qty); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ItemStorageBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java similarity index 69% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ItemStorageBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java index 854453343..4e8be0837 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ItemStorageBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlock.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.ItemStorageBlockBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/ItemStorageBlockBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/ItemStorageBlockBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java index 50e06c8dd..f77c3642c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storage/ItemStorageBlockBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockEntity.java @@ -1,15 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storage; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; 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.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.ItemStorageBlockContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ItemStorageBlockBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockItem.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ItemStorageBlockBlockItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockItem.java index f34d72258..b36ed9efd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ItemStorageBlockBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockBlockItem.java @@ -1,12 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.item.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.block.AbstractStorageContainerBlockItem; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.AbstractStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.storage.AbstractStorageContainerBlockItem; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import java.util.UUID; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/ItemStorageBlockContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java similarity index 61% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/ItemStorageBlockContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java index cd43b9b56..47f29c553 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/storage/block/ItemStorageBlockContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockContainerMenu.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.StorageConfigurationContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageConfigurationContainer; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Inventory; @@ -20,10 +20,10 @@ public ItemStorageBlockContainerMenu(final int syncId, final Inventory playerInv ); } - public ItemStorageBlockContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final StorageConfigurationContainer configContainer) { + ItemStorageBlockContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final StorageConfigurationContainer configContainer) { super(Menus.INSTANCE.getItemStorage(), syncId, player, resourceContainer, configContainer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ItemStorageBlockScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockScreen.java similarity index 69% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ItemStorageBlockScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockScreen.java index bbfb9ed98..ceaa93a83 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/ItemStorageBlockScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/ItemStorageBlockScreen.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; - -import com.refinedmods.refinedstorage2.platform.common.containermenu.storage.block.AbstractStorageBlockContainerMenu; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/StorageBlockLootItemFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/StorageBlockLootItemFunction.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java index 7d391f748..ad13e1200 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/StorageBlockLootItemFunction.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunction.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.loot; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.AbstractStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.content.LootFunctions; import java.util.UUID; @@ -15,7 +14,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class StorageBlockLootItemFunction implements LootItemFunction { +class StorageBlockLootItemFunction implements LootItemFunction { private static final Logger LOGGER = LoggerFactory.getLogger(StorageBlockLootItemFunction.class); @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/StorageBlockLootItemFunctionSerializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunctionSerializer.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/StorageBlockLootItemFunctionSerializer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunctionSerializer.java index face54610..d66b00ee4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/StorageBlockLootItemFunctionSerializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/StorageBlockLootItemFunctionSerializer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.loot; +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/package-info.java new file mode 100644 index 000000000..be2984c49 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storageblock/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.storage.storageblock; + +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/item/FluidStorageDiskItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java similarity index 72% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/FluidStorageDiskItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java index 70b8f7187..c385d496a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/FluidStorageDiskItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/FluidStorageDiskItem.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.storage.storagedisk; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractStorageContainerItem; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.storage.AbstractStorageContainerItem; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.support.resource.FluidResourceRendering; import javax.annotation.Nullable; @@ -35,7 +35,7 @@ protected boolean hasCapacity() { @Override protected String formatAmount(final long amount) { - return Platform.INSTANCE.getBucketAmountFormatter().format(amount); + return FluidResourceRendering.format(amount); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/ItemStorageDiskItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/ItemStorageDiskItem.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/ItemStorageDiskItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/ItemStorageDiskItem.java index 456cb365c..f2d696c56 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/ItemStorageDiskItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/ItemStorageDiskItem.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.storage.storagedisk; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractStorageContainerItem; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.storage.AbstractStorageContainerItem; import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/package-info.java similarity index 73% rename from refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/package-info.java index c064632c2..7b412880e 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/destructor/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storage/storagedisk/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.api.blockentity.destructor; +package com.refinedmods.refinedstorage2.platform.common.storage.storagedisk; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/CompositeStorageMonitorExtractionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/CompositeStorageMonitorExtractionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java index 48472b1aa..05367d735 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/CompositeStorageMonitorExtractionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/CompositeStorageMonitorExtractionStrategy.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/CompositeStorageMonitorInsertionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/CompositeStorageMonitorInsertionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java index 95e98fdd1..31e9c8f30 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/CompositeStorageMonitorInsertionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/CompositeStorageMonitorInsertionStrategy.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/FluidStorageMonitorExtractionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java similarity index 76% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/FluidStorageMonitorExtractionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java index 629dfc662..77d48a9df 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/FluidStorageMonitorExtractionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/FluidStorageMonitorExtractionStrategy.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.TransferHelper; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.BucketPlayerInventoryInsertableStorage; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.BucketPlayerInventoryInsertableStorage; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.world.entity.player.Player; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/FluidStorageMonitorInsertionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/FluidStorageMonitorInsertionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java index 35a7ed952..3f7319673 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/FluidStorageMonitorInsertionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/FluidStorageMonitorInsertionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; @@ -6,11 +6,10 @@ import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.ContainedFluid; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; import javax.annotation.Nullable; @@ -36,10 +35,10 @@ public Optional insert( } @Nullable - private ContainedFluid tryInsert(final Actor actor, - final FluidResource configuredResource, - final ContainedFluid result, - final StorageChannel storageChannel) { + private Platform.ContainedFluid tryInsert(final Actor actor, + final FluidResource configuredResource, + final Platform.ContainedFluid result, + final StorageChannel storageChannel) { final ResourceAmount fluid = result.fluid(); if (!fluid.getResource().equals(configuredResource)) { return null; @@ -55,7 +54,7 @@ private ContainedFluid tryInsert(final Actor actor, } private ItemStack doInsert(final Actor actor, - final ContainedFluid extracted, + final Platform.ContainedFluid extracted, final StorageChannel storageChannel) { final ResourceAmount fluid = extracted.fluid(); storageChannel.insert( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/ItemStorageMonitorExtractionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/ItemStorageMonitorExtractionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java index 4338802e2..0cf8a8c9a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/ItemStorageMonitorExtractionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/ItemStorageMonitorExtractionStrategy.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/ItemStorageMonitorInsertionStrategy.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/ItemStorageMonitorInsertionStrategy.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java index 297741a93..82ccb5cca 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/ItemStorageMonitorInsertionStrategy.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/ItemStorageMonitorInsertionStrategy.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.blockentity.storagemonitor.StorageMonitorInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.storagemonitor.StorageMonitorInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/StorageMonitorBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java similarity index 72% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/StorageMonitorBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java index 74a6fef2f..27a390a44 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/StorageMonitorBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlock.java @@ -1,16 +1,18 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; -import com.refinedmods.refinedstorage2.platform.common.block.direction.BiDirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +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 com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -29,7 +31,7 @@ public class StorageMonitorBlock extends AbstractDirectionalBlock i new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getStorageMonitor); public StorageMonitorBlock() { - super(BlockConstants.PROPERTIES.strength(1.5F, 6.0F)); + super(BlockConstants.PROPERTIES.strength(2.5F, 6.0F)); } @Override @@ -60,6 +62,10 @@ public InteractionResult use(final BlockState state, if (player.isCrouching()) { return super.use(state, level, pos, player, hand, hit); } + final BiDirection direction = getDirection(state); + if (direction == null || hit.getDirection() != direction.asDirection()) { + return InteractionResult.FAIL; + } if (!level.isClientSide()) { final BlockEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof StorageMonitorBlockEntity storageMonitor) { @@ -83,19 +89,23 @@ public void attack(final BlockState state, final Level level, final BlockPos pos if (direction == null) { return; } + final Direction hitDirection = getHitDirection(level, player); + if (hitDirection != direction.asDirection()) { + return; + } + storageMonitor.extract(player); + } + + private Direction getHitDirection(final Level level, final Player player) { final Vec3 base = player.getEyePosition(1.0F); final Vec3 look = player.getLookAngle(); final Vec3 target = base.add(look.x * 20, look.y * 20, look.z * 20); - final BlockHitResult hitResult = level.clip(new ClipContext( + return level.clip(new ClipContext( base, target, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player - )); - if (hitResult.getDirection() != direction.asDirection()) { - return; - } - storageMonitor.extract(player); + )).getDirection(); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/StorageMonitorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/StorageMonitorBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java index 21586c41c..72f365509 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/StorageMonitorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; @@ -6,19 +6,19 @@ import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannel; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.FuzzyStorageChannel; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.FilterWithFuzzyMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.StorageMonitorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; @@ -42,7 +42,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class StorageMonitorBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity +public class StorageMonitorBlockEntity extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements ExtendedMenuProvider { private static final Logger LOGGER = LoggerFactory.getLogger(StorageMonitorBlockEntity.class); @@ -52,7 +52,7 @@ public class StorageMonitorBlockEntity extends AbstractInternalNetworkNodeContai private final FilterWithFuzzyMode filter; private final RateLimiter displayUpdateRateLimiter = RateLimiter.create(0.25); - private final InsertTracker insertTracker = new InsertTracker(); + private final StorageMonitorInsertTracker insertTracker = new StorageMonitorInsertTracker(); private long currentAmount; private boolean currentlyActive; @@ -64,9 +64,7 @@ public StorageMonitorBlockEntity(final BlockPos pos, final BlockState state) { final ResourceContainer resourceContainer = ResourceContainerImpl.createForFilter(1); this.filter = FilterWithFuzzyMode.create(resourceContainer, () -> { setChanged(); - if (level != null) { - sendDisplayUpdate(level, getAmount(), getNode().isActive()); - } + sendDisplayUpdate(); }); } @@ -139,7 +137,7 @@ private void extract( if (!success) { return; } - sendDisplayUpdate(level, getAmount(), getNode().isActive()); + sendDisplayUpdate(); level.playSound( null, getBlockPos(), @@ -152,7 +150,7 @@ private void extract( public void insert(final Player player, final InteractionHand hand) { if (level != null && doInsert(player, hand)) { - sendDisplayUpdate(level, getAmount(), getNode().isActive()); + sendDisplayUpdate(); } } @@ -261,8 +259,8 @@ public boolean isCurrentlyActive() { } @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); filter.save(tag); } @@ -272,12 +270,16 @@ public void load(final CompoundTag tag) { filter.getFilterContainer().fromTag(tag.getCompound(TAG_CLIENT_FILTER)); currentAmount = tag.getLong(TAG_CLIENT_AMOUNT); currentlyActive = tag.getBoolean(TAG_CLIENT_ACTIVE); - } else { - filter.load(tag); } super.load(tag); } + @Override + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); + filter.load(tag); + } + @Override public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { filter.getFilterContainer().writeToUpdatePacket(buf); @@ -308,10 +310,23 @@ public CompoundTag getUpdateTag() { return tag; } + private void sendDisplayUpdate() { + if (level == null) { + return; + } + sendDisplayUpdate(level, getAmount(), getNode().isActive()); + } + private void sendDisplayUpdate(final Level level, final long amount, final boolean active) { currentAmount = amount; currentlyActive = active; level.sendBlockUpdated(worldPosition, getBlockState(), getBlockState(), Block.UPDATE_ALL); - LOGGER.info("Sending display update for storage monitor {} with amount {}", worldPosition, amount); + LOGGER.debug("Sending display update for storage monitor {} with amount {}", worldPosition, amount); + } + + @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/render/entity/StorageMonitorBlockEntityRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntityRenderer.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/entity/StorageMonitorBlockEntityRenderer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntityRenderer.java index b1bf7d150..dfc29ce40 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/entity/StorageMonitorBlockEntityRenderer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorBlockEntityRenderer.java @@ -1,12 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.render.entity; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; -import com.refinedmods.refinedstorage2.platform.common.block.StorageMonitorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.direction.BiDirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/StorageMonitorContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java similarity index 62% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/StorageMonitorContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java index ab288c604..356db7d23 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/StorageMonitorContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorContainerMenu.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor.StorageMonitorBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +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.ServerProperty; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; @@ -28,10 +28,10 @@ public StorageMonitorContainerMenu(final int syncId, final Inventory playerInven initializeResourceSlots(buf); } - public StorageMonitorContainerMenu(final int syncId, - final Player player, - final StorageMonitorBlockEntity storageMonitor, - final ResourceContainer resourceContainer) { + StorageMonitorContainerMenu(final int syncId, + final Player player, + final StorageMonitorBlockEntity storageMonitor, + final ResourceContainer resourceContainer) { super(Menus.INSTANCE.getStorageMonitor(), syncId, player); registerProperty(new ServerProperty<>( PropertyTypes.FUZZY_MODE, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/InsertTracker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorInsertTracker.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/InsertTracker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorInsertTracker.java index 87d42cdee..61deefca7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/storagemonitor/InsertTracker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorInsertTracker.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.storagemonitor; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import java.util.HashMap; import java.util.Map; @@ -10,16 +10,16 @@ import com.mojang.authlib.GameProfile; import net.minecraft.world.item.ItemStack; -class InsertTracker { +class StorageMonitorInsertTracker { private static final long MAX_DELAY = 500; private final Map entries = new HashMap<>(); - public void trackInsertedItem(final GameProfile gameProfile, final ItemStack stack) { + void trackInsertedItem(final GameProfile gameProfile, final ItemStack stack) { entries.put(gameProfile.getId(), new Entry(System.currentTimeMillis(), ItemResource.ofItemStack(stack))); } - public Optional getLastInsertedItem(final GameProfile gameProfile) { + Optional getLastInsertedItem(final GameProfile gameProfile) { final Entry entry = entries.get(gameProfile.getId()); if (entry == null) { return Optional.empty(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/StorageMonitorScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/StorageMonitorScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java index 47b5cf231..4b55dcce1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/StorageMonitorScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/StorageMonitorScreen.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; -import com.refinedmods.refinedstorage2.platform.common.containermenu.StorageMonitorContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.FuzzyModeSideButtonWidget; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; +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.network.chat.Component; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/package-info.java new file mode 100644 index 000000000..84be21a57 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/storagemonitor/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.storagemonitor; + +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/block/AbstractBaseBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java similarity index 74% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractBaseBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java index 94438607c..0d61113ab 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractBaseBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseBlock.java @@ -1,8 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.BlockEntityWithDrops; -import com.refinedmods.refinedstorage2.platform.common.block.entity.PlayerAware; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.Sounds; @@ -41,13 +39,6 @@ protected BlockState getDefaultState() { return getStateDefinition().any(); } - @SuppressWarnings("deprecation") - private static boolean rotate(final BlockState state, final Level level, final BlockPos pos) { - final BlockState rotated = state.rotate(Rotation.CLOCKWISE_90); - level.setBlockAndUpdate(pos, rotated); - return !state.equals(rotated); - } - @Override @SuppressWarnings("deprecation") public InteractionResult use(final BlockState state, @@ -123,16 +114,17 @@ public void setPlacedBy(final Level level, @Nullable final LivingEntity entity, final ItemStack stack) { super.setPlacedBy(level, pos, state, entity, stack); - if (entity instanceof Player player && level.getBlockEntity(pos) instanceof PlayerAware playerAware) { + if (entity instanceof Player player + && level.getBlockEntity(pos) instanceof PlayerAwareBlockEntity playerAware) { playerAware.setPlacedBy(player.getGameProfile().getId()); } } - public static Optional tryUseWrench(final BlockState state, - final Level level, - final BlockHitResult hitResult, - final Player player, - final InteractionHand hand) { + public final Optional tryUseWrench(final BlockState state, + final Level level, + final BlockHitResult hitResult, + final Player player, + final InteractionHand hand) { if (player.isSpectator() || !level.mayInteract(player, hitResult.getBlockPos())) { return Optional.empty(); } @@ -161,33 +153,10 @@ public static Optional tryUseWrench(final BlockState state, return Optional.of(InteractionResult.sidedSuccess(level.isClientSide())); } - public static Optional tryUpdateColor(final BlockState state, - final Level level, - final BlockPos pos, - final Player player, - final InteractionHand hand) { - if (state.getBlock() instanceof ColorableBlock colorableBlock) { - return tryUpdateColor(colorableBlock.getBlockColorMap(), state, level, pos, player, hand); - } - return Optional.empty(); - } - - private static Optional tryUpdateColor(final BlockColorMap blockColorMap, - final BlockState state, - final Level level, - final BlockPos pos, - final Player player, - final InteractionHand hand) { - if (!player.isCrouching()) { - return Optional.empty(); - } - return blockColorMap.updateColor(state, player.getItemInHand(hand), level, pos, player); - } - - private static boolean dismantleOrRotate(final BlockState state, - final Level level, - final BlockHitResult hitResult, - final Player player) { + private boolean dismantleOrRotate(final BlockState state, + final Level level, + final BlockHitResult hitResult, + final Player player) { if (player.isCrouching()) { dismantle(state, level, hitResult, player); return true; @@ -196,14 +165,24 @@ private static boolean dismantleOrRotate(final BlockState state, } } - private static boolean isWrench(final ItemStack item) { + private boolean rotate(final BlockState state, final Level level, final BlockPos pos) { + final BlockState rotated = getRotatedBlockState(state, level, pos); + level.setBlockAndUpdate(pos, rotated); + return !state.equals(rotated); + } + + protected BlockState getRotatedBlockState(final BlockState state, final Level level, final BlockPos pos) { + return state.rotate(Rotation.CLOCKWISE_90); + } + + private boolean isWrench(final ItemStack item) { return item.is(Platform.INSTANCE.getWrenchTag()); } - private static void dismantle(final BlockState state, - final Level level, - final BlockHitResult hitResult, - final Player player) { + private void dismantle(final BlockState state, + final Level level, + final BlockHitResult hitResult, + final Player player) { final ItemStack stack = Platform.INSTANCE.getCloneItemStack(state, level, hitResult, player); final BlockEntity blockEntity = level.getBlockEntity(hitResult.getBlockPos()); if (blockEntity != null) { @@ -220,4 +199,29 @@ private static void dismantle(final BlockState state, stack )); } + + public final Optional tryUpdateColor(final BlockState state, + final Level level, + final BlockPos pos, + final Player player, + final InteractionHand hand) { + if (this instanceof ColorableBlock colorableBlock) { + return tryUpdateColor(colorableBlock.getBlockColorMap(), state, level, pos, player, hand); + } + return Optional.empty(); + } + + private Optional tryUpdateColor( + final BlockColorMap blockColorMap, + final BlockState state, + final Level level, + final BlockPos pos, + final Player player, + final InteractionHand hand + ) { + if (!player.isCrouching()) { + return Optional.empty(); + } + return blockColorMap.updateColor(state, player.getItemInHand(hand), level, pos, player); + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractBaseContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractBaseContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java index b2f16454b..77dfedcef 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractBaseContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseContainerMenu.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.Property; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.DisabledSlot; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferManager; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.DisabledSlot; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.Property; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractBaseScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseScreen.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractBaseScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseScreen.java index fee620d19..b54951840 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractBaseScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBaseScreen.java @@ -1,21 +1,21 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.UpgradeSlot; -import com.refinedmods.refinedstorage2.platform.common.screen.amount.ResourceAmountScreen; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.MouseWithIconClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.SmallTextClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.UpgradeItemClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.amount.ResourceAmountScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.MouseWithIconClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.SmallTextClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.widget.AbstractSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeItemClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeSlot; import java.util.ArrayList; import java.util.Collections; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/AbstractBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBlockEntityTicker.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/AbstractBlockEntityTicker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBlockEntityTicker.java index 813d25cd2..019670400 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/AbstractBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractBlockEntityTicker.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.ticker; +package com.refinedmods.refinedstorage2.platform.common.support; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractColoredBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractColoredBlock.java new file mode 100644 index 000000000..7a6e06ac5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractColoredBlock.java @@ -0,0 +1,34 @@ +package com.refinedmods.refinedstorage2.platform.common.support; + +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; + +public abstract class AbstractColoredBlock + extends AbstractBaseBlock implements ColorableBlock, BlockItemProvider { + private final DyeColor color; + private final MutableComponent name; + + protected AbstractColoredBlock(final Properties properties, final DyeColor color, final MutableComponent name) { + super(properties); + this.color = color; + this.name = name; + } + + @Override + public MutableComponent getName() { + return name; + } + + @Override + public DyeColor getColor() { + return color; + } + + @Override + public BlockItem createBlockItem() { + return new NamedBlockItem(this, new Item.Properties(), name); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractDirectionalBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractDirectionalBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java index 34a0bc0c7..b8f86a1c7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractDirectionalBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalBlock.java @@ -1,7 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; +import java.util.Objects; import javax.annotation.Nullable; import net.minecraft.core.Direction; @@ -68,4 +69,18 @@ public Direction extractDirection(@Nullable final BlockState state) { } return getDirectionType().extractDirection(direction); } + + public static boolean doesBlockStateChangeWarrantNetworkNodeUpdate(final BlockState oldBlockState, + final BlockState newBlockState) { + if (!(newBlockState.getBlock() instanceof AbstractDirectionalBlock newDirectionalBlock)) { + return true; + } + if (!(oldBlockState.getBlock() instanceof AbstractDirectionalBlock oldDirectionalBlock)) { + return true; + } + return !Objects.equals( + oldDirectionalBlock.getDirection(oldBlockState), + newDirectionalBlock.getDirection(newBlockState) + ); + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractDirectionalCableBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalCableBlock.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractDirectionalCableBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalCableBlock.java index bbdbdf330..d75d8310e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/AbstractDirectionalCableBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractDirectionalCableBlock.java @@ -1,7 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionTypeImpl; import java.util.Map; import java.util.Objects; @@ -11,6 +12,7 @@ import net.minecraft.core.Direction; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.SimpleWaterloggedBlock; @@ -68,6 +70,12 @@ public BlockState updateShape(final BlockState state, return CableBlockSupport.getState(state, level, pos, getDirection(state)); } + @Override + protected BlockState getRotatedBlockState(final BlockState state, final Level level, final BlockPos pos) { + final BlockState rotated = super.getRotatedBlockState(state, level, pos); + return CableBlockSupport.getState(rotated, level, pos, getDirection(rotated)); + } + @Override @SuppressWarnings("deprecation") public boolean isPathfindable(final BlockState state, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractFilterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractFilterScreen.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractFilterScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractFilterScreen.java index 0c3079c56..dd47a7d05 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/AbstractFilterScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/AbstractFilterScreen.java @@ -1,8 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractBaseContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/BlockEntityWithDrops.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/BlockEntityWithDrops.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/BlockEntityWithDrops.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/BlockEntityWithDrops.java index efc79a017..e8a676aad 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/BlockEntityWithDrops.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/BlockEntityWithDrops.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support; import net.minecraft.core.NonNullList; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/BlockItemProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/BlockItemProvider.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/BlockItemProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/BlockItemProvider.java index 684966115..a437fbbdb 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/BlockItemProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/BlockItemProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; import net.minecraft.world.item.BlockItem; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableBlockSupport.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableBlockSupport.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java index 92150dacc..d43160251 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/CableBlockSupport.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableBlockSupport.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; import java.util.HashMap; import java.util.Map; @@ -39,7 +39,7 @@ public final class CableBlockSupport { private CableBlockSupport() { } - static BlockState getDefaultState(final BlockState state) { + public static BlockState getDefaultState(final BlockState state) { return state .setValue(NORTH, false) .setValue(EAST, false) @@ -50,11 +50,11 @@ static BlockState getDefaultState(final BlockState state) { .setValue(BlockStateProperties.WATERLOGGED, false); } - static void appendBlockStateProperties(final StateDefinition.Builder builder) { + public static void appendBlockStateProperties(final StateDefinition.Builder builder) { builder.add(NORTH, EAST, SOUTH, WEST, UP, DOWN, BlockStateProperties.WATERLOGGED); } - static VoxelShape getShape(final CableShapeCacheKey cacheKey) { + public static VoxelShape getShape(final CableShapeCacheKey cacheKey) { return SHAPE_CACHE.computeIfAbsent(cacheKey, CableBlockSupport::calculateShape); } @@ -81,18 +81,18 @@ private static VoxelShape calculateShape(final CableShapeCacheKey cacheKey) { return shape; } - static BlockState getState( + public static BlockState getState( final BlockState currentState, - final LevelAccessor world, + final LevelAccessor level, final BlockPos pos, @Nullable final Direction blacklistedDirection ) { - final boolean north = hasVisualConnection(currentState, world, pos, Direction.NORTH, blacklistedDirection); - final boolean east = hasVisualConnection(currentState, world, pos, Direction.EAST, blacklistedDirection); - final boolean south = hasVisualConnection(currentState, world, pos, Direction.SOUTH, blacklistedDirection); - final boolean west = hasVisualConnection(currentState, world, pos, Direction.WEST, blacklistedDirection); - final boolean up = hasVisualConnection(currentState, world, pos, Direction.UP, blacklistedDirection); - final boolean down = hasVisualConnection(currentState, world, pos, Direction.DOWN, blacklistedDirection); + final boolean north = hasVisualConnection(currentState, level, pos, Direction.NORTH, blacklistedDirection); + final boolean east = hasVisualConnection(currentState, level, pos, Direction.EAST, blacklistedDirection); + final boolean south = hasVisualConnection(currentState, level, pos, Direction.SOUTH, blacklistedDirection); + final boolean west = hasVisualConnection(currentState, level, pos, Direction.WEST, blacklistedDirection); + final boolean up = hasVisualConnection(currentState, level, pos, Direction.UP, blacklistedDirection); + final boolean down = hasVisualConnection(currentState, level, pos, Direction.DOWN, blacklistedDirection); return currentState .setValue(NORTH, north) @@ -105,7 +105,7 @@ static BlockState getState( private static boolean hasVisualConnection( final BlockState blockState, - final LevelAccessor world, + final LevelAccessor level, final BlockPos pos, final Direction direction, @Nullable final Direction blacklistedDirection @@ -114,9 +114,9 @@ private static boolean hasVisualConnection( return false; } final BlockPos offsetPos = pos.relative(direction); - if (!(world.getBlockEntity(offsetPos) instanceof PlatformNetworkNodeContainer neighboringContainer)) { + if (!(level.getBlockEntity(offsetPos) instanceof PlatformNetworkNodeContainer neighboringContainer)) { return false; } - return neighboringContainer.canAcceptIncomingConnection(direction, blockState); + return neighboringContainer.canAcceptIncomingConnection(direction.getOpposite(), blockState); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableShapeCacheKey.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableShapeCacheKey.java new file mode 100644 index 000000000..10408a62c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/CableShapeCacheKey.java @@ -0,0 +1,23 @@ +package com.refinedmods.refinedstorage2.platform.common.support; + +import net.minecraft.world.level.block.state.BlockState; + +import static com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport.DOWN; +import static com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport.EAST; +import static com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport.NORTH; +import static com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport.SOUTH; +import static com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport.UP; +import static com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport.WEST; + +public record CableShapeCacheKey(boolean north, boolean east, boolean south, boolean west, boolean up, boolean down) { + public static CableShapeCacheKey of(final BlockState state) { + return new CableShapeCacheKey( + state.getValue(NORTH), + state.getValue(EAST), + state.getValue(SOUTH), + state.getValue(WEST), + state.getValue(UP), + state.getValue(DOWN) + ); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ClientToServerCommunications.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ClientToServerCommunications.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java index 59ff10a08..a16489164 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ClientToServerCommunications.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ClientToServerCommunications.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.packet; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyType; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; import java.util.List; import java.util.UUID; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ColorableBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ColorableBlock.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ColorableBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ColorableBlock.java index 18b43aa8c..a3128725e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ColorableBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ColorableBlock.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DirectionalCableBlockShapes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/DirectionalCableBlockShapes.java similarity index 55% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DirectionalCableBlockShapes.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/DirectionalCableBlockShapes.java index b9db76e42..a645d5df3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/DirectionalCableBlockShapes.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/DirectionalCableBlockShapes.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; import static net.minecraft.world.level.block.Block.box; -final class DirectionalCableBlockShapes { +public final class DirectionalCableBlockShapes { private static final VoxelShape EXPORTER_NORTH_1 = box(6, 6, 0, 10, 10, 2); private static final VoxelShape EXPORTER_NORTH_2 = box(5, 5, 2, 11, 11, 4); private static final VoxelShape EXPORTER_NORTH_3 = box(3, 3, 4, 13, 13, 6); @@ -61,33 +61,33 @@ final class DirectionalCableBlockShapes { private static final VoxelShape HOLDER_UP = box(7, 10, 7, 9, 14, 9); private static final VoxelShape HOLDER_DOWN = box(7, 2, 7, 9, 6, 9); - static final VoxelShape EXPORTER_NORTH = Shapes.or(EXPORTER_NORTH_1, EXPORTER_NORTH_2, EXPORTER_NORTH_3); - static final VoxelShape EXPORTER_EAST = Shapes.or(EXPORTER_EAST_1, EXPORTER_EAST_2, EXPORTER_EAST_3); - static final VoxelShape EXPORTER_SOUTH = Shapes.or(EXPORTER_SOUTH_1, EXPORTER_SOUTH_2, EXPORTER_SOUTH_3); - static final VoxelShape EXPORTER_WEST = Shapes.or(EXPORTER_WEST_1, EXPORTER_WEST_2, EXPORTER_WEST_3); - static final VoxelShape EXPORTER_UP = Shapes.or(EXPORTER_UP_1, EXPORTER_UP_2, EXPORTER_UP_3); - static final VoxelShape EXPORTER_DOWN = Shapes.or(EXPORTER_DOWN_1, EXPORTER_DOWN_2, EXPORTER_DOWN_3); - - static final VoxelShape IMPORTER_NORTH = Shapes.or(IMPORTER_NORTH_1, IMPORTER_NORTH_2, IMPORTER_NORTH_3); - static final VoxelShape IMPORTER_EAST = Shapes.or(IMPORTER_EAST_1, IMPORTER_EAST_2, IMPORTER_EAST_3); - static final VoxelShape IMPORTER_SOUTH = Shapes.or(IMPORTER_SOUTH_1, IMPORTER_SOUTH_2, IMPORTER_SOUTH_3); - static final VoxelShape IMPORTER_WEST = Shapes.or(IMPORTER_WEST_1, IMPORTER_WEST_2, IMPORTER_WEST_3); - static final VoxelShape IMPORTER_UP = Shapes.or(IMPORTER_UP_1, IMPORTER_UP_2, IMPORTER_UP_3); - static final VoxelShape IMPORTER_DOWN = Shapes.or(IMPORTER_DOWN_1, IMPORTER_DOWN_2, IMPORTER_DOWN_3); - - static final VoxelShape EXTERNAL_STORAGE_NORTH = Shapes.or(box(3, 3, 0, 13, 13, 2), HOLDER_NORTH); - static final VoxelShape EXTERNAL_STORAGE_EAST = Shapes.or(box(14, 3, 3, 16, 13, 13), HOLDER_EAST); - static final VoxelShape EXTERNAL_STORAGE_SOUTH = Shapes.or(box(3, 3, 14, 13, 13, 16), HOLDER_SOUTH); - static final VoxelShape EXTERNAL_STORAGE_WEST = Shapes.or(box(0, 3, 3, 2, 13, 13), HOLDER_WEST); - static final VoxelShape EXTERNAL_STORAGE_UP = Shapes.or(box(3, 14, 3, 13, 16, 13), HOLDER_UP); - static final VoxelShape EXTERNAL_STORAGE_DOWN = Shapes.or(box(3, 0, 3, 13, 2, 13), HOLDER_DOWN); - - static final VoxelShape CONSTRUCTOR_DESTRUCTOR_NORTH = Shapes.or(box(2, 2, 0, 14, 14, 2), HOLDER_NORTH); - static final VoxelShape CONSTRUCTOR_DESTRUCTOR_EAST = Shapes.or(box(14, 2, 2, 16, 14, 14), HOLDER_EAST); - static final VoxelShape CONSTRUCTOR_DESTRUCTOR_SOUTH = Shapes.or(box(2, 2, 14, 14, 14, 16), HOLDER_SOUTH); - static final VoxelShape CONSTRUCTOR_DESTRUCTOR_WEST = Shapes.or(box(0, 2, 2, 2, 14, 14), HOLDER_WEST); - static final VoxelShape CONSTRUCTOR_DESTRUCTOR_DOWN = Shapes.or(box(2, 0, 2, 14, 2, 14), HOLDER_DOWN); - static final VoxelShape CONSTRUCTOR_DESTRUCTOR_UP = Shapes.or(box(2, 14, 2, 14, 16, 14), HOLDER_UP); + public static final VoxelShape EXPORTER_NORTH = Shapes.or(EXPORTER_NORTH_1, EXPORTER_NORTH_2, EXPORTER_NORTH_3); + public static final VoxelShape EXPORTER_EAST = Shapes.or(EXPORTER_EAST_1, EXPORTER_EAST_2, EXPORTER_EAST_3); + public static final VoxelShape EXPORTER_SOUTH = Shapes.or(EXPORTER_SOUTH_1, EXPORTER_SOUTH_2, EXPORTER_SOUTH_3); + public static final VoxelShape EXPORTER_WEST = Shapes.or(EXPORTER_WEST_1, EXPORTER_WEST_2, EXPORTER_WEST_3); + public static final VoxelShape EXPORTER_UP = Shapes.or(EXPORTER_UP_1, EXPORTER_UP_2, EXPORTER_UP_3); + public static final VoxelShape EXPORTER_DOWN = Shapes.or(EXPORTER_DOWN_1, EXPORTER_DOWN_2, EXPORTER_DOWN_3); + + public static final VoxelShape IMPORTER_NORTH = Shapes.or(IMPORTER_NORTH_1, IMPORTER_NORTH_2, IMPORTER_NORTH_3); + public static final VoxelShape IMPORTER_EAST = Shapes.or(IMPORTER_EAST_1, IMPORTER_EAST_2, IMPORTER_EAST_3); + public static final VoxelShape IMPORTER_SOUTH = Shapes.or(IMPORTER_SOUTH_1, IMPORTER_SOUTH_2, IMPORTER_SOUTH_3); + public static final VoxelShape IMPORTER_WEST = Shapes.or(IMPORTER_WEST_1, IMPORTER_WEST_2, IMPORTER_WEST_3); + public static final VoxelShape IMPORTER_UP = Shapes.or(IMPORTER_UP_1, IMPORTER_UP_2, IMPORTER_UP_3); + public static final VoxelShape IMPORTER_DOWN = Shapes.or(IMPORTER_DOWN_1, IMPORTER_DOWN_2, IMPORTER_DOWN_3); + + public static final VoxelShape EXTERNAL_STORAGE_NORTH = Shapes.or(box(3, 3, 0, 13, 13, 2), HOLDER_NORTH); + public static final VoxelShape EXTERNAL_STORAGE_EAST = Shapes.or(box(14, 3, 3, 16, 13, 13), HOLDER_EAST); + public static final VoxelShape EXTERNAL_STORAGE_SOUTH = Shapes.or(box(3, 3, 14, 13, 13, 16), HOLDER_SOUTH); + public static final VoxelShape EXTERNAL_STORAGE_WEST = Shapes.or(box(0, 3, 3, 2, 13, 13), HOLDER_WEST); + public static final VoxelShape EXTERNAL_STORAGE_UP = Shapes.or(box(3, 14, 3, 13, 16, 13), HOLDER_UP); + public static final VoxelShape EXTERNAL_STORAGE_DOWN = Shapes.or(box(3, 0, 3, 13, 2, 13), HOLDER_DOWN); + + public static final VoxelShape CONSTRUCTOR_DESTRUCTOR_NORTH = Shapes.or(box(2, 2, 0, 14, 14, 2), HOLDER_NORTH); + public static final VoxelShape CONSTRUCTOR_DESTRUCTOR_EAST = Shapes.or(box(14, 2, 2, 16, 14, 14), HOLDER_EAST); + public static final VoxelShape CONSTRUCTOR_DESTRUCTOR_SOUTH = Shapes.or(box(2, 2, 14, 14, 14, 16), HOLDER_SOUTH); + public static final VoxelShape CONSTRUCTOR_DESTRUCTOR_WEST = Shapes.or(box(0, 2, 2, 2, 14, 14), HOLDER_WEST); + public static final VoxelShape CONSTRUCTOR_DESTRUCTOR_DOWN = Shapes.or(box(2, 0, 2, 14, 2, 14), HOLDER_DOWN); + public static final VoxelShape CONSTRUCTOR_DESTRUCTOR_UP = Shapes.or(box(2, 14, 2, 14, 16, 14), HOLDER_UP); private DirectionalCableBlockShapes() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/FilterModeSettings.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilterModeSettings.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/FilterModeSettings.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilterModeSettings.java index f0f5654b5..c63f1141e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/FilterModeSettings.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilterModeSettings.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/FilterWithFuzzyMode.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilterWithFuzzyMode.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/FilterWithFuzzyMode.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilterWithFuzzyMode.java index 501c0d385..0b43296d7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/FilterWithFuzzyMode.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/FilterWithFuzzyMode.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.FuzzyModeNormalizer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FuzzyModeNormalizer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import java.util.List; import java.util.Set; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/NamedBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NamedBlockItem.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/NamedBlockItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NamedBlockItem.java index 02108e39f..80183c9b0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/NamedBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/NamedBlockItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item.block; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAwareBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAwareBlockEntity.java new file mode 100644 index 000000000..930c4f448 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/PlayerAwareBlockEntity.java @@ -0,0 +1,7 @@ +package com.refinedmods.refinedstorage2.platform.common.support; + +import java.util.UUID; + +public interface PlayerAwareBlockEntity { + void setPlacedBy(UUID playerId); +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/RedstoneMode.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/RedstoneMode.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/RedstoneMode.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/RedstoneMode.java index 7b673ec27..86568ab54 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/RedstoneMode.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/RedstoneMode.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.util; +package com.refinedmods.refinedstorage2.platform.common.support; public enum RedstoneMode { IGNORE, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/RedstoneModeSettings.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/RedstoneModeSettings.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/RedstoneModeSettings.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/RedstoneModeSettings.java index afa443360..a5228c2d4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/RedstoneModeSettings.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/RedstoneModeSettings.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; - -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +package com.refinedmods.refinedstorage2.platform.common.support; public class RedstoneModeSettings { private static final int IGNORE = 0; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/SchedulingMode.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SchedulingMode.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/SchedulingMode.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SchedulingMode.java index 7bf6576f8..0364aac21 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/SchedulingMode.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SchedulingMode.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/SchedulingModeType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SchedulingModeType.java similarity index 97% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/SchedulingModeType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SchedulingModeType.java index 46448c81d..af4fc46d2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/SchedulingModeType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SchedulingModeType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.network.impl.node.task.DefaultTaskExecutor; import com.refinedmods.refinedstorage2.api.network.impl.node.task.RandomTaskExecutor; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java index 5022943f3..2aab8e7b1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java @@ -1,9 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.packet; +package com.refinedmods.refinedstorage2.platform.common.support; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import java.util.UUID; import javax.annotation.Nullable; @@ -30,4 +31,6 @@ void sendResourceSlotUpdate(ServerPlayer player, int slotIndex); void sendStorageInfoResponse(ServerPlayer player, UUID id, StorageInfo storageInfo); + + void sendNetworkTransmitterStatus(ServerPlayer player, NetworkTransmitterStatus status); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/SimpleBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleBlock.java similarity index 54% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/SimpleBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleBlock.java index f5c7368fc..2418a3dbb 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/SimpleBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleBlock.java @@ -1,4 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.support; + +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import net.minecraft.world.level.block.Block; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/SimpleBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleBlockItem.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/SimpleBlockItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleBlockItem.java index 5ee43b43a..05ef58f3f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/SimpleBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleBlockItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item.block; +package com.refinedmods.refinedstorage2.platform.common.support; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/SimpleItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleItem.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/SimpleItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleItem.java index db8b2d12d..59cb1d3ff 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/SimpleItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/SimpleItem.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.support; import net.minecraft.world.item.Item; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/TextureIds.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/TextureIds.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/TextureIds.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/TextureIds.java index e76b05f66..e0fc1e118 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/TextureIds.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/TextureIds.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.support; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AbstractAmountScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AbstractAmountScreen.java similarity index 98% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AbstractAmountScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AbstractAmountScreen.java index 29c999299..049f9649c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AbstractAmountScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AbstractAmountScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AbstractSingleAmountScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AbstractSingleAmountScreen.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AbstractSingleAmountScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AbstractSingleAmountScreen.java index 23ec38f2b..c4c00fef9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AbstractSingleAmountScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AbstractSingleAmountScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AmountOperations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AmountOperations.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AmountOperations.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AmountOperations.java index 0bad40ccf..b11be6def 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AmountOperations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AmountOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; import java.util.Optional; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AmountScreenConfiguration.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AmountScreenConfiguration.java similarity index 99% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AmountScreenConfiguration.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AmountScreenConfiguration.java index 4edfb2087..949b90420 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/AmountScreenConfiguration.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/AmountScreenConfiguration.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/DoubleAmountOperations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/DoubleAmountOperations.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/DoubleAmountOperations.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/DoubleAmountOperations.java index 962f8185a..b3ac29150 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/DoubleAmountOperations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/DoubleAmountOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/IntegerAmountOperations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/IntegerAmountOperations.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/IntegerAmountOperations.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/IntegerAmountOperations.java index 8630bbabb..d55da228f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/IntegerAmountOperations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/IntegerAmountOperations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/LongAmountOperations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/LongAmountOperations.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/LongAmountOperations.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/LongAmountOperations.java index 35a454944..ce89ca131 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/LongAmountOperations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/LongAmountOperations.java @@ -1,11 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; -import com.refinedmods.refinedstorage2.platform.common.util.MathHelper; +import com.refinedmods.refinedstorage2.platform.common.util.MathUtil; -import java.util.Objects; import java.util.Optional; import javax.annotation.Nullable; +import static java.util.Objects.requireNonNullElse; + public class LongAmountOperations implements AmountOperations { public static final AmountOperations INSTANCE = new LongAmountOperations(); @@ -40,10 +41,10 @@ public Long changeAmount(final Long current, final int delta, @Nullable final Long minAmount, @Nullable final Long maxAmount) { - return MathHelper.clamp( + return MathUtil.clamp( current + delta, - Objects.requireNonNullElse(minAmount, Long.MIN_VALUE), - Objects.requireNonNullElse(maxAmount, Long.MAX_VALUE) + requireNonNullElse(minAmount, Long.MIN_VALUE), + requireNonNullElse(maxAmount, Long.MAX_VALUE) ); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/PriorityScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/PriorityScreen.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/PriorityScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/PriorityScreen.java index 9c9f6cf6d..ed19a096d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/PriorityScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/PriorityScreen.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/ResourceAmountScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/ResourceAmountScreen.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/ResourceAmountScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/ResourceAmountScreen.java index 95b102ad9..8ee594dba 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/amount/ResourceAmountScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/ResourceAmountScreen.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.amount; +package com.refinedmods.refinedstorage2.platform.common.support.amount; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/package-info.java new file mode 100644 index 000000000..4dcade88b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/amount/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.amount; + +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/containermenu/AbstractResourceContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractResourceContainerMenu.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractResourceContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractResourceContainerMenu.java index 24cfdf0c2..6d8018e6a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractResourceContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractResourceContainerMenu.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSchedulingContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSchedulingContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java index e34412a5e..fc8b301a9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSchedulingContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSchedulingContainerMenu.java @@ -1,14 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractSchedulingNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.SchedulingModeType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractSchedulingNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSimpleFilterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSimpleFilterContainerMenu.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSimpleFilterContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSimpleFilterContainerMenu.java index b736f9b79..93503ee9e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSimpleFilterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSimpleFilterContainerMenu.java @@ -1,12 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.UpgradeSlot; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +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.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSingleAmountContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSingleAmountContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java index 25e3988a5..e6c6ccc59 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/AbstractSingleAmountContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/AbstractSingleAmountContainerMenu.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/ClientProperty.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ClientProperty.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/ClientProperty.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ClientProperty.java index 55ac840b2..f559f76f0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/ClientProperty.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ClientProperty.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.property; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import com.refinedmods.refinedstorage2.platform.common.Platform; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/DisabledSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/DisabledSlot.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/DisabledSlot.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/DisabledSlot.java index e6e8258af..afd7d3925 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/DisabledSlot.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/DisabledSlot.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.slot; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import net.minecraft.world.Container; import net.minecraft.world.inventory.Slot; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/ExtendedMenuProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ExtendedMenuProvider.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/ExtendedMenuProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ExtendedMenuProvider.java index 6061f0949..95e91f4aa 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/ExtendedMenuProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ExtendedMenuProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.menu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerPlayer; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/MenuOpener.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/MenuOpener.java similarity index 70% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/MenuOpener.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/MenuOpener.java index 6032f83db..2582f6571 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/menu/MenuOpener.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/MenuOpener.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.menu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.MenuProvider; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/Property.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/Property.java similarity index 66% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/Property.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/Property.java index 80a56ada6..d4c0962d6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/Property.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/Property.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.property; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import net.minecraft.world.inventory.DataSlot; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/PropertyType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/PropertyType.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/PropertyType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/PropertyType.java index b0dc9a5bc..0dd483bb8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/PropertyType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/PropertyType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.property; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import java.util.function.Function; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/PropertyTypes.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/PropertyTypes.java new file mode 100644 index 000000000..11c6f1aad --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/PropertyTypes.java @@ -0,0 +1,52 @@ +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; + +import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; +import com.refinedmods.refinedstorage2.platform.common.support.FilterModeSettings; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneModeSettings; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingModeType; + +import net.minecraft.resources.ResourceLocation; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +public final class PropertyTypes { + public static final PropertyType REDSTONE_MODE = new PropertyType<>( + createIdentifier("redstone_mode"), + RedstoneModeSettings::getRedstoneMode, + RedstoneModeSettings::getRedstoneMode + ); + + public static final PropertyType FILTER_MODE = new PropertyType<>( + createIdentifier("filter_mode"), + FilterModeSettings::getFilterMode, + FilterModeSettings::getFilterMode + ); + + public static final PropertyType SCHEDULING_MODE = new PropertyType<>( + createIdentifier("scheduling_mode"), + SchedulingModeType::getId, + SchedulingModeType::getById + ); + + public static final PropertyType FUZZY_MODE = createBooleanProperty(createIdentifier("fuzzy_mode")); + + private PropertyTypes() { + } + + public static PropertyType createBooleanProperty(final ResourceLocation id) { + return new PropertyType<>( + id, + value -> Boolean.TRUE.equals(value) ? 1 : 0, + value -> value == 1 + ); + } + + public static PropertyType createIntegerProperty(final ResourceLocation id) { + return new PropertyType<>( + id, + value -> value, + value -> value + ); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java new file mode 100644 index 000000000..b56d9a12d --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceInventoryDestination.java @@ -0,0 +1,11 @@ +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; + +import net.minecraft.world.item.ItemStack; + +record ResourceInventoryDestination(AbstractResourceContainerMenu destination) implements TransferDestination { + @Override + public ItemStack transfer(final ItemStack stack) { + destination.addToResourceSlotIfNotExisting(stack); + return null; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/ResourceSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceSlot.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/ResourceSlot.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceSlot.java index 359a039f3..4cbacd608 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/ResourceSlot.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ResourceSlot.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.slot; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainerType; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainerType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; import com.refinedmods.refinedstorage2.platform.common.Platform; import java.util.Objects; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/ServerProperty.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ServerProperty.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/ServerProperty.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ServerProperty.java index 6c3a7d555..84bfd4a3b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/property/ServerProperty.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ServerProperty.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.property; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import java.util.function.Consumer; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/TransferDestination.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferDestination.java similarity index 71% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/TransferDestination.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferDestination.java index ddcc38611..5159ab21d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/TransferDestination.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferDestination.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.transfer; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/TransferManager.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/TransferManager.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java index 091fa489a..e4239721e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/transfer/TransferManager.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/TransferManager.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.transfer; - -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import java.util.HashMap; import java.util.LinkedList; @@ -24,7 +22,6 @@ public TransferManager(final AbstractContainerMenu containerMenu, this.destinationFactory = destinationFactory; } - public void addTransfer(final Container from, final Container to) { addTransfer( destinationFactory.apply(from), diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/ValidatedSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/ValidatedSlot.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java index a728fd5f5..0b4d78684 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/ValidatedSlot.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/ValidatedSlot.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.slot; +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; import java.util.function.Predicate; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/package-info.java new file mode 100644 index 000000000..041f84e48 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/containermenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.containermenu; + +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/util/BiDirection.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/BiDirection.java similarity index 97% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BiDirection.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/BiDirection.java index 264943074..19e1eb8e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BiDirection.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/BiDirection.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.util; +package com.refinedmods.refinedstorage2.platform.common.support.direction; import java.util.Locale; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/BiDirectionType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/BiDirectionType.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/BiDirectionType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/BiDirectionType.java index c82b89d7b..8faa69294 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/BiDirectionType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/BiDirectionType.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.direction; - -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +package com.refinedmods.refinedstorage2.platform.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.EnumProperty; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/DirectionType.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/DirectionType.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/DirectionType.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/DirectionType.java index 539f34119..c22d56efc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/DirectionType.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/DirectionType.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.direction; +package com.refinedmods.refinedstorage2.platform.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.util.StringRepresentable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/DirectionTypeImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/DirectionTypeImpl.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/DirectionTypeImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/DirectionTypeImpl.java index d4b743913..039d6941b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/direction/DirectionTypeImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/DirectionTypeImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.direction; +package com.refinedmods.refinedstorage2.platform.common.support.direction; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.EnumProperty; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/package-info.java new file mode 100644 index 000000000..a10e7502b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/direction/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.direction; + +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/block/entity/BlockEntityEnergyStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/BlockEntityEnergyStorage.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/BlockEntityEnergyStorage.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/BlockEntityEnergyStorage.java index ddae1cef8..6515f7ffd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/BlockEntityEnergyStorage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/BlockEntityEnergyStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.refinedmods.refinedstorage2.api.network.impl.energy.EnergyStorageImpl; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/CreativeEnergyStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/CreativeEnergyStorage.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/CreativeEnergyStorage.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/CreativeEnergyStorage.java index b9e409319..50563ce2b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/CreativeEnergyStorage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/CreativeEnergyStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.energy; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/EnergyItemHelperImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyItemHelperImpl.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/EnergyItemHelperImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyItemHelperImpl.java index 8faba40e9..f53a35ea6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/EnergyItemHelperImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyItemHelperImpl.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.EnergyBlockEntity; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractEnergyBlockItem; -import com.refinedmods.refinedstorage2.platform.api.item.EnergyItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractEnergyBlockItem; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItemHelper; import java.util.List; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/EnergyLootItemFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyLootItemFunction.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/EnergyLootItemFunction.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyLootItemFunction.java index 823c84a73..f5476b195 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/EnergyLootItemFunction.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyLootItemFunction.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.loot; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.EnergyBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyBlockEntity; import com.refinedmods.refinedstorage2.platform.common.content.LootFunctions; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/EnergyLootItemFunctionSerializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyLootItemFunctionSerializer.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/EnergyLootItemFunctionSerializer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyLootItemFunctionSerializer.java index 3360070dd..bb5dd73a3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/loot/EnergyLootItemFunctionSerializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/EnergyLootItemFunctionSerializer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.loot; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/ItemEnergyStorage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/ItemEnergyStorage.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/ItemEnergyStorage.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/ItemEnergyStorage.java index a3e8db2ed..97ff327de 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/energy/ItemEnergyStorage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/ItemEnergyStorage.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.energy; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/energy/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/package-info.java similarity index 77% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/energy/package-info.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/package-info.java index 372ae8fb0..5b378d7b4 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/energy/package-info.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/energy/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.energy; +package com.refinedmods.refinedstorage2.platform.common.support.energy; import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java index 8c66c1785..fb8f6e7f2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractLevelInteractingNetworkNodeContainerBlockEntity.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; @@ -12,9 +12,9 @@ import org.slf4j.LoggerFactory; public abstract class AbstractLevelInteractingNetworkNodeContainerBlockEntity - extends AbstractInternalNetworkNodeContainerBlockEntity { + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity { private static final Logger LOGGER = LoggerFactory.getLogger( - AbstractLevelInteractingNetworkNodeContainerBlockEntity.class + AbstractLevelInteractingNetworkNodeContainerBlockEntity.class ); protected AbstractLevelInteractingNetworkNodeContainerBlockEntity( @@ -28,7 +28,6 @@ protected AbstractLevelInteractingNetworkNodeContainerBlockEntity( // used to handle rotations @Override - @SuppressWarnings("deprecation") public void setBlockState(final BlockState newBlockState) { super.setBlockState(newBlockState); if (!(level instanceof ServerLevel serverLevel)) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java new file mode 100644 index 000000000..49787cd0e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractRedstoneModeNetworkNodeContainerBlockEntity.java @@ -0,0 +1,102 @@ +package com.refinedmods.refinedstorage2.platform.common.support.network; + +import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; +import com.refinedmods.refinedstorage2.platform.api.configurationcard.ConfigurationCardTarget; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.support.PlayerAwareBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneModeSettings; + +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; + +public abstract class AbstractRedstoneModeNetworkNodeContainerBlockEntity + extends NetworkNodeContainerBlockEntityImpl implements PlayerAwareBlockEntity, ConfigurationCardTarget { + private static final String TAG_REDSTONE_MODE = "rm"; + private static final String TAG_PLACED_BY_PLAYER_ID = "pbpid"; + + private RedstoneMode redstoneMode = RedstoneMode.IGNORE; + @Nullable + private UUID placedByPlayerId; + + protected AbstractRedstoneModeNetworkNodeContainerBlockEntity(final BlockEntityType type, + final BlockPos pos, + final BlockState state, + final T node) { + super(type, pos, state, node); + } + + @Override + protected boolean isActive() { + return super.isActive() && level != null && redstoneMode.isActive(level.hasNeighborSignal(worldPosition)); + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + writeConfiguration(tag); + if (placedByPlayerId != null) { + tag.putUUID(TAG_PLACED_BY_PLAYER_ID, placedByPlayerId); + } + } + + @Override + public void writeConfiguration(final CompoundTag tag) { + tag.putInt(TAG_REDSTONE_MODE, RedstoneModeSettings.getRedstoneMode(getRedstoneMode())); + } + + @Override + public void load(final CompoundTag tag) { + super.load(tag); + readConfiguration(tag); + if (tag.hasUUID(TAG_PLACED_BY_PLAYER_ID)) { + placedByPlayerId = tag.getUUID(TAG_PLACED_BY_PLAYER_ID); + } + } + + @Override + public void readConfiguration(final CompoundTag tag) { + if (tag.contains(TAG_REDSTONE_MODE)) { + redstoneMode = RedstoneModeSettings.getRedstoneMode(tag.getInt(TAG_REDSTONE_MODE)); + } + } + + @Override + public List getUpgradeItems() { + return Collections.emptyList(); + } + + @Override + public boolean addUpgradeItem(final Item upgradeItem) { + return false; + } + + public RedstoneMode getRedstoneMode() { + return redstoneMode; + } + + public void setRedstoneMode(final RedstoneMode redstoneMode) { + this.redstoneMode = redstoneMode; + setChanged(); + } + + @Override + public void setPlacedBy(final UUID playerId) { + this.placedByPlayerId = playerId; + setChanged(); + } + + protected final Player getFakePlayer(final ServerLevel serverLevel) { + return Platform.INSTANCE.getFakePlayer(serverLevel, placedByPlayerId); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractSchedulingNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java similarity index 76% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractSchedulingNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java index e298d8b87..2de3e849b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractSchedulingNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractSchedulingNetworkNodeContainerBlockEntity.java @@ -1,11 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.api.network.node.task.TaskExecutor; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.FilterWithFuzzyMode; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingMode; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import java.util.List; import java.util.stream.Collectors; @@ -43,17 +46,17 @@ protected AbstractSchedulingNetworkNodeContainerBlockEntity( } @Override - public void saveAdditional(final CompoundTag tag) { - super.saveAdditional(tag); + public void writeConfiguration(final CompoundTag tag) { + super.writeConfiguration(tag); schedulingMode.writeToTag(tag); filter.save(tag); } @Override - public void load(final CompoundTag tag) { + public void readConfiguration(final CompoundTag tag) { + super.readConfiguration(tag); schedulingMode.load(tag); filter.load(tag); - super.load(tag); } public void setSchedulingModeType(final SchedulingModeType type) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java index c1a725fe3..24c922e1d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/AbstractUpgradeableNetworkNodeContainerBlockEntity.java @@ -1,9 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; +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 com.google.common.util.concurrent.RateLimiter; import net.minecraft.core.BlockPos; @@ -11,6 +16,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; @@ -63,6 +69,24 @@ private void upgradeContainerChanged() { } } + @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 void saveAdditional(final CompoundTag tag) { super.saveAdditional(tag); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/LevelConnectionProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java similarity index 62% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/LevelConnectionProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java index 358301027..cd33c72e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/network/LevelConnectionProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java @@ -1,24 +1,22 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.network; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.ConnectionProvider; import com.refinedmods.refinedstorage2.api.network.Connections; import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; -import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; import java.util.ArrayDeque; -import java.util.Collections; +import java.util.ArrayList; import java.util.Comparator; import java.util.HashSet; import java.util.List; -import java.util.Objects; import java.util.Queue; import java.util.Set; import java.util.stream.Collectors; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.resources.ResourceKey; +import net.minecraft.core.GlobalPos; import net.minecraft.server.MinecraftServer; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; @@ -26,12 +24,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class LevelConnectionProvider implements ConnectionProvider { - private static final Logger LOGGER = LoggerFactory.getLogger(LevelConnectionProvider.class); +public class ConnectionProviderImpl implements ConnectionProvider { + private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionProviderImpl.class); private final Level originLevel; - public LevelConnectionProvider(final Level originLevel) { + public ConnectionProviderImpl(final Level originLevel) { this.originLevel = originLevel; } @@ -44,11 +42,11 @@ public Connections findConnections(final NetworkNodeContainer pivot, .collect(Collectors.toSet()); LOGGER.info("Finding connections for pivot {} with {} existing connections", pivot, existingConnections.size()); final ScanState scanState = new ScanState(existingPlatformConnections); - addInitialRequest(pivot, scanState); - ScanRequest currentRequest; + addStartContainer(pivot, scanState); + PlatformNetworkNodeContainer currentContainer; int requests = 0; - while ((currentRequest = scanState.toCheck.poll()) != null) { - visit(scanState, currentRequest); + while ((currentContainer = scanState.toCheck.poll()) != null) { + visit(scanState, new ScanEntry(currentContainer)); requests++; } LOGGER.info( @@ -62,25 +60,11 @@ public Connections findConnections(final NetworkNodeContainer pivot, return scanState.toConnections(); } - private void addInitialRequest(final NetworkNodeContainer pivot, final ScanState scanState) { + private void addStartContainer(final NetworkNodeContainer pivot, final ScanState scanState) { if (!(pivot instanceof PlatformNetworkNodeContainer platformPivot)) { return; } - final Level pivotLevel = platformPivot.getContainerLevel(); - if (pivotLevel == null) { - LOGGER.warn("Pivot level was null for {}", pivot); - return; - } - scanState.toCheck.add(new ScanRequest( - pivotLevel.dimension(), - platformPivot.getContainerPosition() - )); - } - - private void visit(final ScanState state, final ScanRequest request) { - if (getBlockEntity(request.dimension, request.position) instanceof PlatformNetworkNodeContainer container) { - visit(state, new ScanEntry(container, originLevel, request.position)); - } + scanState.toCheck.add(platformPivot); } private void visit(final ScanState state, final ScanEntry entry) { @@ -92,27 +76,41 @@ private void visit(final ScanState state, final ScanEntry entry) { state.newEntries.add(entry); } state.removedEntries.remove(entry); - final Set connections = findConnectionsAt(entry.getContainer()); + final List connections = findConnectionsAt(entry.getContainer()); state.toCheck.addAll(connections); } - private Set findConnectionsAt(final PlatformNetworkNodeContainer from) { - final Level level = from.getContainerLevel(); - if (level == null) { - return Collections.emptySet(); - } - final Set requests = new HashSet<>(); - for (final Direction direction : Direction.values()) { - if (!from.canPerformOutgoingConnection(direction)) { - continue; - } - final BlockPos offsetPos = from.getContainerPosition().relative(direction); - if (getBlockEntity(level, offsetPos) instanceof PlatformNetworkNodeContainer neighborContainer - && neighborContainer.canAcceptIncomingConnection(direction, from.getContainerBlockState())) { - requests.add(new ScanRequest(level.dimension(), offsetPos)); + private List findConnectionsAt(final PlatformNetworkNodeContainer from) { + final ConnectionSinkImpl sink = new ConnectionSinkImpl(from.getContainerPosition()); + from.addOutgoingConnections(sink); + final List connections = new ArrayList<>(); + for (final ConnectionSinkImpl.Connection connection : sink.getConnections()) { + final PlatformNetworkNodeContainer connectionContainer = getConnection(from, connection); + if (connectionContainer != null) { + connections.add(connectionContainer); } } - return requests; + return connections; + } + + @Nullable + private PlatformNetworkNodeContainer getConnection(final PlatformNetworkNodeContainer from, + final ConnectionSinkImpl.Connection connection) { + final BlockEntity connectionBlockEntity = getBlockEntitySafely(connection.pos()); + if (!(connectionBlockEntity instanceof PlatformNetworkNodeContainer connectionContainer)) { + return null; + } + if (connection.incomingDirection() == null) { + return connectionContainer; + } + final boolean acceptsIncomingDirection = connectionContainer.canAcceptIncomingConnection( + connection.incomingDirection(), + from.getContainerBlockState() + ); + if (!acceptsIncomingDirection) { + return null; + } + return connectionContainer; } @Override @@ -124,20 +122,20 @@ public List sortDeterministically(final Set dimension, final BlockPos pos) { + private BlockEntity getBlockEntitySafely(final GlobalPos pos) { final MinecraftServer server = originLevel.getServer(); if (server == null) { return null; } - final Level level = server.getLevel(dimension); + final Level level = server.getLevel(pos.dimension()); if (level == null) { return null; } - return getBlockEntity(level, pos); + return getBlockEntitySafely(level, pos.pos()); } @Nullable - private BlockEntity getBlockEntity(final Level level, final BlockPos pos) { + private BlockEntity getBlockEntitySafely(final Level level, final BlockPos pos) { if (!level.isLoaded(pos)) { return null; } @@ -159,7 +157,7 @@ private static class ScanState { private final Set foundEntries = new HashSet<>(); private final Set newEntries = new HashSet<>(); private final Set removedEntries; - private final Queue toCheck = new ArrayDeque<>(); + private final Queue toCheck = new ArrayDeque<>(); ScanState(final Set existingConnections) { this.currentEntries = toScanEntries(existingConnections); @@ -179,23 +177,17 @@ private Set toContainers(final Set entries) { } private static Set toScanEntries(final Set existingConnections) { - return existingConnections.stream().map(container -> new ScanEntry( - container, - Objects.requireNonNull(container.getContainerLevel()), - Objects.requireNonNull(container.getContainerPosition()) - )).collect(Collectors.toSet()); + return existingConnections.stream().map(ScanEntry::new).collect(Collectors.toSet()); } } private static class ScanEntry { private final PlatformNetworkNodeContainer container; - private final ResourceKey dimension; - private final BlockPos position; + private final GlobalPos pos; - ScanEntry(final PlatformNetworkNodeContainer container, final Level dimension, final BlockPos position) { + ScanEntry(final PlatformNetworkNodeContainer container) { this.container = container; - this.dimension = dimension.dimension(); - this.position = position; + this.pos = container.getContainerPosition(); } public PlatformNetworkNodeContainer getContainer() { @@ -211,15 +203,12 @@ public boolean equals(final Object o) { return false; } final ScanEntry that = (ScanEntry) o; - return Objects.equals(dimension, that.dimension) && Objects.equals(position, that.position); + return pos.equals(that.pos); } @Override public int hashCode() { - return Objects.hash(dimension, position); + return pos.hashCode(); } } - - private record ScanRequest(ResourceKey dimension, BlockPos position) { - } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java new file mode 100644 index 000000000..e75182f34 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java @@ -0,0 +1,38 @@ +package com.refinedmods.refinedstorage2.platform.common.support.network; + +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; + +import java.util.HashSet; +import java.util.Set; +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.GlobalPos; + +class ConnectionSinkImpl implements ConnectionSink { + private final GlobalPos source; + private final Set connections = new HashSet<>(); + + ConnectionSinkImpl(final GlobalPos source) { + this.source = source; + } + + Set getConnections() { + return connections; + } + + @Override + public void tryConnect(final GlobalPos pos) { + connections.add(new Connection(pos, null)); + } + + @Override + public void tryConnectInSameDimension(final BlockPos pos, final Direction incomingDirection) { + final GlobalPos globalPos = GlobalPos.of(source.dimension(), pos); + connections.add(new Connection(globalPos, incomingDirection)); + } + + record Connection(GlobalPos pos, @Nullable Direction incomingDirection) { + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/NetworkNodeBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeBlockEntityTicker.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/NetworkNodeBlockEntityTicker.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeBlockEntityTicker.java index f2e9a10fa..b2077a117 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/ticker/NetworkNodeBlockEntityTicker.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeBlockEntityTicker.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.ticker; +package com.refinedmods.refinedstorage2.platform.common.support.network; import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import java.util.function.Supplier; import javax.annotation.Nullable; @@ -14,7 +14,7 @@ public class NetworkNodeBlockEntityTicker< N extends AbstractNetworkNode, - T extends AbstractInternalNetworkNodeContainerBlockEntity + T extends NetworkNodeContainerBlockEntityImpl > extends AbstractBlockEntityTicker { @Nullable private final BooleanProperty activenessProperty; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeContainerBlockEntityImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeContainerBlockEntityImpl.java new file mode 100644 index 000000000..a3461c809 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/NetworkNodeContainerBlockEntityImpl.java @@ -0,0 +1,167 @@ +package com.refinedmods.refinedstorage2.platform.common.support.network; + +import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.support.network.AbstractNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.Block; +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; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NetworkNodeContainerBlockEntityImpl + extends AbstractNetworkNodeContainerBlockEntity { + private static final Logger LOGGER = LoggerFactory.getLogger(NetworkNodeContainerBlockEntityImpl.class); + + private final RateLimiter activenessChangeRateLimiter = RateLimiter.create(1); + + public NetworkNodeContainerBlockEntityImpl(final BlockEntityType type, + final BlockPos pos, + final BlockState state, + final T networkNode) { + super(type, pos, state, networkNode); + } + + protected boolean isActive() { + final long energyUsage = getNode().getEnergyUsage(); + final boolean hasLevel = level != null && level.isLoaded(worldPosition); + return hasLevel + && getNode().getNetwork() != null + && getNode().getNetwork().getComponent(EnergyNetworkComponent.class).getStored() >= energyUsage; + } + + public void updateActiveness(final BlockState state, @Nullable final BooleanProperty activenessProperty) { + final boolean newActive = isActive(); + final boolean nodeActivenessNeedsUpdate = newActive != getNode().isActive(); + final boolean blockStateActivenessNeedsUpdate = activenessProperty != null + && state.getValue(activenessProperty) != newActive; + final boolean activenessNeedsUpdate = nodeActivenessNeedsUpdate || blockStateActivenessNeedsUpdate; + if (activenessNeedsUpdate && activenessChangeRateLimiter.tryAcquire()) { + if (nodeActivenessNeedsUpdate) { + activenessChanged(newActive); + } + if (blockStateActivenessNeedsUpdate) { + updateActivenessBlockState(state, activenessProperty, newActive); + } + } + } + + protected void activenessChanged(final boolean newActive) { + LOGGER.debug("Activeness change for node at {}: {} -> {}", getBlockPos(), getNode().isActive(), newActive); + getNode().setActive(newActive); + } + + private void updateActivenessBlockState(final BlockState state, + final BooleanProperty activenessProperty, + final boolean active) { + if (level != null) { + LOGGER.debug( + "Sending block update at {} due to activeness change: {} -> {}", + getBlockPos(), + state.getValue(activenessProperty), + active + ); + level.setBlockAndUpdate(getBlockPos(), state.setValue(activenessProperty, active)); + } + } + + public void doWork() { + getNode().doWork(); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction myDirection = getDirection(); + if (myDirection == null) { + super.addOutgoingConnections(sink); + return; + } + for (final Direction direction : Direction.values()) { + if (direction == myDirection) { + continue; + } + sink.tryConnectInSameDimension(worldPosition.relative(direction), direction.getOpposite()); + } + } + + @Override + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { + return false; + } + final Direction myDirection = getDirection(); + if (myDirection != null) { + return myDirection != incomingDirection; + } + return true; + } + + protected final boolean colorsAllowConnecting(final BlockState connectingState) { + if (!(connectingState.getBlock() instanceof ColorableBlock otherColorableBlock)) { + return true; + } + final ColorableBlock colorableBlock = getColor(); + if (colorableBlock == null) { + return true; + } + return otherColorableBlock.getColor() == colorableBlock.getColor() + || colorableBlock.canAlwaysConnect() + || otherColorableBlock.canAlwaysConnect(); + } + + @Nullable + private ColorableBlock getColor() { + if (!(getBlockState().getBlock() instanceof ColorableBlock colorableBlock)) { + return null; + } + return colorableBlock; + } + + @Nullable + protected final Direction getDirection() { + final BlockState blockState = getBlockState(); + if (!(blockState.getBlock() instanceof AbstractDirectionalBlock directionalBlock)) { + return null; + } + return directionalBlock.extractDirection(blockState); + } + + protected final void updateBlock() { + if (level == null) { + return; + } + level.sendBlockUpdated(getBlockPos(), getBlockState(), getBlockState(), Block.UPDATE_ALL); + } + + protected boolean doesBlockStateChangeWarrantNetworkNodeUpdate( + final BlockState oldBlockState, + final BlockState newBlockState + ) { + return false; + } + + @Override + @SuppressWarnings("deprecation") + public void setBlockState(final BlockState newBlockState) { + final BlockState oldBlockState = getBlockState(); + super.setBlockState(newBlockState); + if (!doesBlockStateChangeWarrantNetworkNodeUpdate(oldBlockState, newBlockState)) { + return; + } + if (level == null || level.isClientSide || getNode().getNetwork() == null) { + return; + } + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/CompositeSlotReferenceProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java similarity index 87% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/CompositeSlotReferenceProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java index 09149ca82..c955c5157 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/CompositeSlotReferenceProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/CompositeSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReference.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReference.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReference.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReference.java index e0c7424fd..dfa9b0a6e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReference.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import java.util.Optional; @@ -14,7 +14,7 @@ public final class InventorySlotReference implements SlotReference { private final int slotIndex; - public InventorySlotReference(final int slotIndex) { + InventorySlotReference(final int slotIndex) { this.slotIndex = slotIndex; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReferenceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java similarity index 60% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReferenceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java index b344b840f..98c1b76c8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReferenceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import net.minecraft.network.FriendlyByteBuf; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReferenceProvider.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReferenceProvider.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java index 9b0b28b6e..0bbb50266 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/InventorySlotReferenceProvider.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/InventorySlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/NetworkBoundItemHelperImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/NetworkBoundItemHelperImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java index ec9812d66..50ee4e1b3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/NetworkBoundItemHelperImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemHelperImpl.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemHelper; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemHelper; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.List; import java.util.Objects; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/NetworkItemItemPropertyFunction.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/NetworkItemItemPropertyFunction.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java index abed03a94..5261c73ab 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/NetworkItemItemPropertyFunction.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemItemPropertyFunction.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.render; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractNetworkBoundEnergyItem; +import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; import javax.annotation.Nullable; @@ -10,7 +10,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -public class NetworkItemItemPropertyFunction implements ClampedItemPropertyFunction { +public class NetworkBoundItemItemPropertyFunction implements ClampedItemPropertyFunction { public static final ResourceLocation NAME = new ResourceLocation("active"); @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/NetworkBoundItemSessionImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java similarity index 83% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/NetworkBoundItemSessionImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java index e83d8b8e4..a1ffad1c5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/item/NetworkBoundItemSessionImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/NetworkBoundItemSessionImpl.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.item; +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.Network; -import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitter; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.PlatformNetworkNodeContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage2.platform.common.Platform; import java.util.Optional; @@ -82,6 +82,6 @@ public void drainEnergy(final long amount) { ); } - public record NetworkReference(ResourceKey dimensionKey, BlockPos pos) { + record NetworkReference(ResourceKey dimensionKey, BlockPos pos) { } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/package-info.java new file mode 100644 index 000000000..3b9e35000 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/bounditem/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.network.bounditem; + +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/support/network/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/package-info.java new file mode 100644 index 000000000..57bc26862 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.network; + +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/support/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/package-info.java new file mode 100644 index 000000000..8a1a70a3c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support; + +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/internal/registry/PlatformRegistryImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/registry/PlatformRegistryImpl.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/PlatformRegistryImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/registry/PlatformRegistryImpl.java index 9eca49ad0..2873e2cfc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/PlatformRegistryImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/registry/PlatformRegistryImpl.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.registry; +package com.refinedmods.refinedstorage2.platform.common.support.registry; import com.refinedmods.refinedstorage2.api.core.CoreValidations; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import java.util.ArrayList; import java.util.HashMap; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/registry/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/registry/package-info.java new file mode 100644 index 000000000..24e76b4ea --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/registry/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.registry; + +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/render/model/AbstractFluidRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/AbstractFluidRenderer.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/AbstractFluidRenderer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/AbstractFluidRenderer.java index 091d8b592..1e17d2483 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/model/AbstractFluidRenderer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/AbstractFluidRenderer.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.render.model; - -import com.refinedmods.refinedstorage2.platform.common.render.FluidRenderer; +package com.refinedmods.refinedstorage2.platform.common.support.render; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.BufferBuilder; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/CubeBuilder.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/CubeBuilder.java similarity index 98% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/CubeBuilder.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/CubeBuilder.java index ec6497625..b173c350e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/CubeBuilder.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/CubeBuilder.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.render; +package com.refinedmods.refinedstorage2.platform.common.support.render; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/FluidRenderer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/FluidRenderer.java similarity index 77% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/FluidRenderer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/FluidRenderer.java index eb4deace0..e5d76bc35 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/render/FluidRenderer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/FluidRenderer.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.render; +package com.refinedmods.refinedstorage2.platform.common.support.render; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/package-info.java new file mode 100644 index 000000000..37dd8d3ee --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/render/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.render; + +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/internal/resource/AbstractResourceContainerContainerAdapter.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/AbstractResourceContainerContainerAdapter.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java index c12cbbd43..7714f7600 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/AbstractResourceContainerContainerAdapter.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/AbstractResourceContainerContainerAdapter.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.resource; +package com.refinedmods.refinedstorage2.platform.common.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.minecraft.world.Container; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public abstract class AbstractResourceContainerContainerAdapter implements Container { +abstract class AbstractResourceContainerContainerAdapter implements Container { private final ResourceContainer container; protected AbstractResourceContainerContainerAdapter(final ResourceContainer container) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/FluidResourceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceFactory.java similarity index 61% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/FluidResourceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceFactory.java index ffe9b8705..499231e91 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/FluidResourceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceFactory.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.resource; +package com.refinedmods.refinedstorage2.platform.common.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/FluidResourceRendering.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java similarity index 50% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/FluidResourceRendering.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java index d004a4336..d9df74755 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/FluidResourceRendering.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRendering.java @@ -1,10 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.resource; +package com.refinedmods.refinedstorage2.platform.common.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import com.refinedmods.refinedstorage2.platform.common.Platform; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.util.List; +import java.util.Locale; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.gui.GuiGraphics; @@ -13,12 +17,17 @@ import net.minecraft.world.level.Level; public class FluidResourceRendering implements ResourceRendering { + private static final DecimalFormat LESS_THAN_1_BUCKET_FORMATTER = + new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.US)); + private static final DecimalFormat FORMATTER = + new DecimalFormat("#,###.#", DecimalFormatSymbols.getInstance(Locale.US)); + @Override public String getDisplayedAmount(final long amount, final boolean withUnits) { if (!withUnits) { - return Platform.INSTANCE.getBucketAmountFormatter().format(amount); + return format(amount); } - return Platform.INSTANCE.getBucketAmountFormatter().formatWithUnits(amount); + return formatWithUnits(amount); } @Override @@ -44,4 +53,22 @@ public void render(final FluidResource resource, final Level level) { Platform.INSTANCE.getFluidRenderer().render(poseStack, renderTypeBuffer, light, resource); } + + public static String formatWithUnits(final long droplets) { + final double buckets = convertToBuckets(droplets); + if (buckets >= 1) { + return AmountFormatting.formatWithUnits((long) Math.floor(buckets)); + } else { + return LESS_THAN_1_BUCKET_FORMATTER.format(buckets); + } + } + + public static String format(final long droplets) { + final double buckets = convertToBuckets(droplets); + return FORMATTER.format(buckets); + } + + private static double convertToBuckets(final long droplets) { + return droplets / (double) Platform.INSTANCE.getBucketAmount(); + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ItemResourceFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceFactory.java similarity index 60% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ItemResourceFactory.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceFactory.java index 45ef53d9a..f7c354427 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ItemResourceFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceFactory.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.resource; +package com.refinedmods.refinedstorage2.platform.common.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ItemResourceRendering.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ItemResourceRendering.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java index e54703dbc..ed35746d4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ItemResourceRendering.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ItemResourceRendering.java @@ -1,11 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.resource; +package com.refinedmods.refinedstorage2.platform.common.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -50,10 +48,10 @@ public Component getDisplayName(final ItemResource resource) { @Override public List getTooltip(final ItemResource resource) { final Minecraft minecraft = Minecraft.getInstance(); - return ClientProxy.getPlayer().map(player -> getStack(resource).getTooltipLines( - player, + return getStack(resource).getTooltipLines( + minecraft.player, minecraft.options.advancedItemTooltips ? TooltipFlag.ADVANCED : TooltipFlag.NORMAL - )).orElse(Collections.emptyList()); + ); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ResourceContainerImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ResourceContainerImpl.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ResourceContainerImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ResourceContainerImpl.java index 944ee6d36..1c2113b26 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/resource/ResourceContainerImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/ResourceContainerImpl.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.resource; +package com.refinedmods.refinedstorage2.platform.common.support.resource; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.core.CoreValidations; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainerType; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceFactory; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.util.MathHelper; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainerType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.util.MathUtil; import java.util.ArrayList; import java.util.Collections; @@ -125,7 +125,7 @@ public void setAmount(final int index, final long amount) { if (resourceAmount == null) { return; } - final long newAmount = MathHelper.clamp(amount, 0, getMaxAmount(resourceAmount)); + final long newAmount = MathUtil.clamp(amount, 0, getMaxAmount(resourceAmount)); if (newAmount == 0) { remove(index); } else { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/package-info.java new file mode 100644 index 000000000..c030f3f9f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.resource; + +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/screen/tooltip/CompositeClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/CompositeClientTooltipComponent.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/CompositeClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/CompositeClientTooltipComponent.java index e2cfd7afc..87f8c04dd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/CompositeClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/CompositeClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/HelpClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/HelpClientTooltipComponent.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/HelpClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/HelpClientTooltipComponent.java index b80fe9718..1122cac6c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/HelpClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/HelpClientTooltipComponent.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/MouseWithIconClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/MouseWithIconClientTooltipComponent.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/MouseWithIconClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/MouseWithIconClientTooltipComponent.java index a4b5fecf0..659e5eb8f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/MouseWithIconClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/MouseWithIconClientTooltipComponent.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/ResourceClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/ResourceClientTooltipComponent.java similarity index 88% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/ResourceClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/ResourceClientTooltipComponent.java index 686af7f05..bac724911 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/ResourceClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/ResourceClientTooltipComponent.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceRendering; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceRendering; import java.util.Objects; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/SmallText.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallText.java similarity index 59% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/SmallText.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallText.java index ad5451c83..864a1fffa 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/SmallText.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallText.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; @@ -10,17 +10,17 @@ public final class SmallText { private SmallText() { } - public static float getScale() { + static float getScale() { return Minecraft.getInstance().isEnforceUnicode() ? 1F : 0.7F; } - public static void render(final Font font, - final FormattedCharSequence text, - final int x, - final int y, - final float scale, - final Matrix4f pose, - final MultiBufferSource.BufferSource buffer) { + static void render(final Font font, + final FormattedCharSequence text, + final int x, + final int y, + final float scale, + final Matrix4f pose, + final MultiBufferSource.BufferSource buffer) { final Matrix4f scaled = new Matrix4f(pose); scaled.scale(scale, scale, 1); font.drawInBatch( diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/SmallTextClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/SmallTextClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java index c138eca15..4de87fadf 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/SmallTextClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/package-info.java new file mode 100644 index 000000000..3389a4614 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.tooltip; + +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/screen/widget/AbstractSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/AbstractSideButtonWidget.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AbstractSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/AbstractSideButtonWidget.java index 90f231770..e4208b8fd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AbstractSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/AbstractSideButtonWidget.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.screen.TextureIds; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.SmallTextClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.HelpClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.SmallTextClientTooltipComponent; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AbstractYesNoSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/AbstractYesNoSideButtonWidget.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AbstractYesNoSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/AbstractYesNoSideButtonWidget.java index 1aac2bee5..b04f3faea 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/AbstractYesNoSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/AbstractYesNoSideButtonWidget.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/FilterModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FilterModeSideButtonWidget.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/FilterModeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FilterModeSideButtonWidget.java index 609d1d790..fc79a5875 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/FilterModeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FilterModeSideButtonWidget.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import com.refinedmods.refinedstorage2.api.core.filter.FilterMode; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/FuzzyModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/FuzzyModeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java index 411ad017e..8c6846f57 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/FuzzyModeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/FuzzyModeSideButtonWidget.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/History.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/History.java similarity index 93% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/History.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/History.java index 24d951abb..e6225f837 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/History.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/History.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import java.util.List; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ProgressWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/ProgressWidget.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ProgressWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/ProgressWidget.java index 1edf356b2..da5fcf18f 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ProgressWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/ProgressWidget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import java.util.List; import java.util.function.DoubleSupplier; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/RedstoneModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/RedstoneModeSideButtonWidget.java similarity index 92% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/RedstoneModeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/RedstoneModeSideButtonWidget.java index 573264ae5..6918d79fb 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/RedstoneModeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/RedstoneModeSideButtonWidget.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/SchedulingModeSideButtonWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java similarity index 86% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/SchedulingModeSideButtonWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java index a0cb53f56..f504d48fd 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/SchedulingModeSideButtonWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SchedulingModeSideButtonWidget.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; -import com.refinedmods.refinedstorage2.platform.common.block.entity.SchedulingModeType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.SchedulingModeType; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ScrollbarWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/ScrollbarWidget.java similarity index 98% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ScrollbarWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/ScrollbarWidget.java index ed2185644..835d6149c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/ScrollbarWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/ScrollbarWidget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.AbstractWidget; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/SearchFieldWidget.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SearchFieldWidget.java similarity index 97% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/SearchFieldWidget.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SearchFieldWidget.java index 41e749e31..ca7ed0b72 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/SearchFieldWidget.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/SearchFieldWidget.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/package-info.java new file mode 100644 index 000000000..9d1bfa6d8 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/widget/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.support.widget; + +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/internal/upgrade/BuiltinUpgradeDestinationsImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java similarity index 91% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java index 9da555b11..f2dc6bfd5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/BuiltinUpgradeDestinationsImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.upgrade; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/FortuneUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/FortuneUpgradeItem.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/FortuneUpgradeItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/FortuneUpgradeItem.java index 81a3d19ab..a46ff32e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/FortuneUpgradeItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/FortuneUpgradeItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.upgrade; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage2.platform.common.Platform; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RangeUpgradeItem.java similarity index 84% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RangeUpgradeItem.java index afe3894b4..c151a645c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RangeUpgradeItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.upgrade; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage2.platform.common.Platform; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/RegulatorUpgradeContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java similarity index 66% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/RegulatorUpgradeContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java index 0e604b5e0..076b4f039 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/RegulatorUpgradeContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeContainerMenu.java @@ -1,8 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.upgrade; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; import java.util.function.Consumer; import javax.annotation.Nullable; @@ -24,11 +25,11 @@ public RegulatorUpgradeContainerMenu(final int syncId, final Inventory playerInv super(Menus.INSTANCE.getRegulatorUpgrade(), syncId, playerInventory, buf, FILTER_HELP); } - public RegulatorUpgradeContainerMenu(final int syncId, - final Player player, - final ResourceContainer resourceContainer, - final Consumer amountAcceptor, - final SlotReference slotReference) { + RegulatorUpgradeContainerMenu(final int syncId, + final Player player, + final ResourceContainer resourceContainer, + final Consumer amountAcceptor, + final SlotReference slotReference) { super( Menus.INSTANCE.getRegulatorUpgrade(), syncId, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RegulatorUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java similarity index 89% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RegulatorUpgradeItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java index 19ec7a354..4bf0d3aa9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RegulatorUpgradeItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeItem.java @@ -1,17 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractSingleAmountContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.RegulatorUpgradeContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.resource.ResourceContainerImpl; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.resource.ResourceContainerImpl; import java.util.Optional; import java.util.OptionalLong; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/RegulatorUpgradeScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeScreen.java similarity index 64% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/RegulatorUpgradeScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeScreen.java index a1fa2e083..eb92ce2d7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/RegulatorUpgradeScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/RegulatorUpgradeScreen.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.upgrade; -import com.refinedmods.refinedstorage2.platform.common.containermenu.RegulatorUpgradeContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.screen.amount.AbstractSingleAmountScreen; +import com.refinedmods.refinedstorage2.platform.common.support.amount.AbstractSingleAmountScreen; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/SimpleUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/SimpleUpgradeItem.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/SimpleUpgradeItem.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/SimpleUpgradeItem.java index acf2d330e..5f35382ef 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/SimpleUpgradeItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/SimpleUpgradeItem.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.item; +package com.refinedmods.refinedstorage2.platform.common.upgrade; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import java.util.function.LongSupplier; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java index bd80803be..d7c0833fe 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; -import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; import java.util.OptionalLong; import java.util.Set; @@ -27,8 +26,7 @@ public class UpgradeContainer extends SimpleContainer implements UpgradeState { private final UpgradeRegistry registry; private final Object2IntMap index = new Object2IntOpenHashMap<>(); - public UpgradeContainer(final UpgradeDestination destination, - final UpgradeRegistry registry) { + public UpgradeContainer(final UpgradeDestination destination, final UpgradeRegistry registry) { this(destination, registry, () -> { }); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/UpgradeDestinationClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinationClientTooltipComponent.java similarity index 96% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/UpgradeDestinationClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinationClientTooltipComponent.java index 09c69b38f..50171bab5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/UpgradeDestinationClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinationClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java similarity index 95% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java index 0058a6aa9..2897fc7a8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeDestinations.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.upgrade; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/UpgradeItemClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeItemClientTooltipComponent.java similarity index 94% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/UpgradeItemClientTooltipComponent.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeItemClientTooltipComponent.java index d599a03d3..3bd99a92b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/tooltip/UpgradeItemClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeItemClientTooltipComponent.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.tooltip; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeRegistryImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeRegistryImpl.java similarity index 97% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeRegistryImpl.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeRegistryImpl.java index 85daa579f..a45db1f9a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeRegistryImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeRegistryImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.upgrade; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/UpgradeSlot.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeSlot.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/UpgradeSlot.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeSlot.java index 01cc4a3f6..745daab62 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/slot/UpgradeSlot.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeSlot.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu.slot; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; import java.util.Set; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/UpgradeWithEnchantedBookRecipe.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java similarity index 90% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/UpgradeWithEnchantedBookRecipe.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java index 6e0c63e70..4d0af11d8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/UpgradeWithEnchantedBookRecipe.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipe.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.recipe; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import com.refinedmods.refinedstorage2.platform.common.content.Items; @@ -26,10 +26,10 @@ public class UpgradeWithEnchantedBookRecipe extends ShapedRecipe { private final EnchantmentInstance enchantment; private final ItemStack theResult; - public UpgradeWithEnchantedBookRecipe(final ResourceLocation recipeId, - final Enchantment enchantment, - final int enchantmentLevel, - final ItemStack theResult) { + UpgradeWithEnchantedBookRecipe(final ResourceLocation recipeId, + final Enchantment enchantment, + final int enchantmentLevel, + final ItemStack theResult) { super(recipeId, "", CraftingBookCategory.MISC, 3, 3, NonNullList.of( Ingredient.EMPTY, Ingredient.of(new ItemStack(Items.INSTANCE.getQuartzEnrichedIron())), diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/UpgradeWithEnchantedBookRecipeSerializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java similarity index 97% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/UpgradeWithEnchantedBookRecipeSerializer.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java index f13716600..09a98fa06 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/recipe/UpgradeWithEnchantedBookRecipeSerializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeWithEnchantedBookRecipeSerializer.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.recipe; +package com.refinedmods.refinedstorage2.platform.common.upgrade; import java.util.Objects; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/package-info.java new file mode 100644 index 000000000..0d95fe01c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.upgrade; + +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/util/BucketAmountFormatting.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormatting.java deleted file mode 100644 index 5cc38ecc8..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormatting.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.util; - -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; - -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.Locale; - -public final class BucketAmountFormatting { - private static final DecimalFormat LESS_THAN_1_BUCKET_FORMATTER = - new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.US)); - private static final DecimalFormat FORMATTER = - new DecimalFormat("#,###.#", DecimalFormatSymbols.getInstance(Locale.US)); - - private final long bucketAmount; - - public BucketAmountFormatting(final long bucketAmount) { - this.bucketAmount = bucketAmount; - } - - public String formatWithUnits(final long droplets) { - final double buckets = convertToBuckets(droplets); - if (buckets >= 1) { - return AmountFormatting.formatWithUnits((long) Math.floor(buckets)); - } else { - return LESS_THAN_1_BUCKET_FORMATTER.format(buckets); - } - } - - public String format(final long droplets) { - final double buckets = convertToBuckets(droplets); - return FORMATTER.format(buckets); - } - - private double convertToBuckets(final long droplets) { - return droplets / (double) bucketAmount; - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/IdentifierUtil.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/IdentifierUtil.java index dac67542a..880eb27c4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/IdentifierUtil.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/IdentifierUtil.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.util; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.api.support.AmountFormatting; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/LevelUtil.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/LevelUtil.java deleted file mode 100644 index eb819c831..000000000 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/LevelUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.util; - -import javax.annotation.Nullable; - -import net.minecraft.core.BlockPos; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; - -public final class LevelUtil { - private LevelUtil() { - } - - public static void updateBlock(@Nullable final Level level, final BlockPos pos, final BlockState state) { - if (level == null) { - return; - } - level.sendBlockUpdated(pos, state, state, Block.UPDATE_ALL); - } -} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/MathHelper.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/MathUtil.java similarity index 78% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/MathHelper.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/MathUtil.java index 74a925167..86094c3b6 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/MathHelper.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/MathUtil.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.common.util; -public final class MathHelper { - private MathHelper() { +public final class MathUtil { + private MathUtil() { } public static long clamp(final long value, final long min, final long max) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/PacketUtil.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/PacketUtil.java index c7c04eed0..22af8955c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/PacketUtil.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/PacketUtil.java @@ -1,8 +1,8 @@ package com.refinedmods.refinedstorage2.platform.common.util; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/TickHandler.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ServerEventQueue.java similarity index 79% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/TickHandler.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ServerEventQueue.java index 260504fa2..bcee12c97 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/TickHandler.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ServerEventQueue.java @@ -3,10 +3,10 @@ import java.util.ArrayDeque; import java.util.Deque; -public final class TickHandler { +public final class ServerEventQueue { private static final Deque ACTIONS = new ArrayDeque<>(); - private TickHandler() { + private ServerEventQueue() { } public static void runQueuedActions() { @@ -18,7 +18,7 @@ public static void runQueuedActions() { } } - public static void runWhenReady(final Runnable runnable) { + public static void queue(final Runnable runnable) { synchronized (ACTIONS) { ACTIONS.add(runnable); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java index a284249d5..d61f68a1e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.common.Platform; public class BaseWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java similarity index 80% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java index 377779e3c..9e5ca5785 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import java.util.Comparator; import java.util.PriorityQueue; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java similarity index 73% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java index 4933e6295..19d8ee641 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.common.content.Items; public class CreativeRangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java similarity index 76% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java index 5a2b1b9c0..7fbb9ae87 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.Items; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java similarity index 85% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java index 6f069a0d5..9e3860f68 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlock.java @@ -1,14 +1,17 @@ -package com.refinedmods.refinedstorage2.platform.common.block; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionTypeImpl; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; 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.item.block.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.BlockItemProvider; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.NamedBlockItem; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionType; +import com.refinedmods.refinedstorage2.platform.common.support.direction.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java index a45aede31..003611acc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -1,16 +1,17 @@ -package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitter; +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage2.platform.api.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractDirectionalBlock; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.upgrade.UpgradeDestinations; import javax.annotation.Nullable; @@ -29,7 +30,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; -public class WirelessTransmitterBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity +public class WirelessTransmitterBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity implements ExtendedMenuProvider, WirelessTransmitter { private static final String TAG_UPGRADES = "u"; @@ -61,13 +63,21 @@ public void load(final CompoundTag tag) { } @Override - public boolean canPerformOutgoingConnection(final Direction direction) { - return direction == getDirection(); + public void addOutgoingConnections(final ConnectionSink sink) { + final Direction myDirection = getDirection(); + if (myDirection == null) { + return; + } + sink.tryConnectInSameDimension(worldPosition.relative(myDirection), myDirection.getOpposite()); } @Override - public boolean canAcceptIncomingConnection(final Direction direction, final BlockState other) { - return colorsAllowConnecting(other) && direction.getOpposite() == getDirection(); + public boolean canAcceptIncomingConnection(final Direction incomingDirection, final BlockState connectingState) { + if (!colorsAllowConnecting(connectingState)) { + return false; + } + final Direction myDirection = getDirection(); + return incomingDirection == myDirection; } @Override @@ -81,7 +91,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent return new WirelessTransmitterContainerMenu(syncId, inventory, this, upgradeContainer); } - public int getRange() { + int getRange() { return PlatformApi.INSTANCE.getWirelessTransmitterRangeModifier().modifyRange(upgradeContainer, 0); } @@ -116,4 +126,10 @@ public boolean isInRange(final ResourceKey dimension, final Vec3 position ); return distance <= getRange(); } + + @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/containermenu/WirelessTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java similarity index 71% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java index bc6e1de5f..11f05aadb 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterContainerMenu.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.containermenu; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.UpgradeSlot; import com.refinedmods.refinedstorage2.platform.common.content.Menus; -import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; -import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +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; +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 javax.annotation.Nullable; @@ -42,10 +42,10 @@ public WirelessTransmitterContainerMenu(final int syncId, this.player = playerInventory.player; } - public WirelessTransmitterContainerMenu(final int syncId, - final Inventory playerInventory, - final WirelessTransmitterBlockEntity wirelessTransmitter, - final UpgradeContainer upgradeContainer) { + WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final WirelessTransmitterBlockEntity wirelessTransmitter, + final UpgradeContainer upgradeContainer) { super(Menus.INSTANCE.getWirelessTransmitter(), syncId); addSlots(playerInventory, upgradeContainer); registerProperty(new ServerProperty<>( @@ -83,7 +83,7 @@ public void broadcastChanges() { } } - public int getRange() { + int getRange() { return range; } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterScreen.java similarity index 82% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java rename to refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterScreen.java index f889a4c23..ab60a85dc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/WirelessTransmitterScreen.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.common.screen; +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; -import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; -import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; +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.RedstoneModeSideButtonWidget; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/package-info.java new file mode 100644 index 000000000..131caf83d --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; 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 59ef8d0bb..6d4759f1a 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 @@ -28,6 +28,8 @@ "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", "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.", @@ -131,6 +133,10 @@ "gui.refinedstorage2.filter_slot.right_click_for": "Right click for", "gui.refinedstorage2.filter_slot.click_to_clear": "Click to clear", "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", "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.", @@ -194,6 +200,20 @@ "item.refinedstorage2.network_item.bound_to": "Bound to %d, %d, %d.", "item.refinedstorage2.network_item.cannot_open_with_shortcut_due_to_duplicate": "There is more than one %s in your inventory.", "item.refinedstorage2.network_item.cannot_open_because_not_found": "There isn't any %s in your inventory.", + "item.refinedstorage2.configuration_card": "Configuration Card", + "item.refinedstorage2.configuration_card.empty": "Empty.", + "item.refinedstorage2.configuration_card.configured": "Contains configuration for %s.", + "item.refinedstorage2.configuration_card.copied_configuration": "Copied configuration for %s.", + "item.refinedstorage2.configuration_card.cleared_configuration": "Cleared configuration.", + "item.refinedstorage2.configuration_card.cannot_apply_configuration": "Cannot apply configuration card to different type of device. It is configured for %s.", + "item.refinedstorage2.configuration_card.applied_configuration": "Applied configuration.", + "item.refinedstorage2.configuration_card.empty_help": "Use on a storage network device while crouching to copy its configuration and upgrades to the card.", + "item.refinedstorage2.configuration_card.configured_help": "Use on the destination storage network device while crouching to transfer the configuration and upgrades. Use while crouching to clear.", + "item.refinedstorage2.network_card": "Network Card", + "item.refinedstorage2.network_card.unbound_help": "Use while crouching on a Network Receiver.", + "item.refinedstorage2.network_card.unbound": "Unbound.", + "item.refinedstorage2.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", + "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d in %s.", "misc.refinedstorage2.stored": "Stored: %s", "misc.refinedstorage2.stored_with_capacity": "Stored: %s / %s (%d%%)", "misc.refinedstorage2.total": "%d total", @@ -225,7 +245,7 @@ "text.autoconfig.refinedstorage2.option.grid": "Grid", "text.autoconfig.refinedstorage2.option.grid.largeFont": "Large font", "text.autoconfig.refinedstorage2.option.grid.maxRowsStretch": "Maximum amount of rows when stretched", - "text.autoconfig.refinedstorage2.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while shift is down", + "text.autoconfig.refinedstorage2.option.grid.preventSortingWhileShiftIsDown": "Prevent sorting while SHIFT is down", "text.autoconfig.refinedstorage2.option.grid.detailedTooltip": "Detailed tooltip", "text.autoconfig.refinedstorage2.option.grid.rememberSearchQuery": "Remember search query", "text.autoconfig.refinedstorage2.option.grid.energyUsage": "Energy usage", @@ -292,7 +312,10 @@ "text.autoconfig.refinedstorage2.option.wirelessTransmitter": "Wireless Transmitter", "text.autoconfig.refinedstorage2.option.wirelessTransmitter.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.wirelessTransmitter.baseRange": "Base range", + "text.autoconfig.refinedstorage2.option.storageMonitor": "Storage Monitor", "text.autoconfig.refinedstorage2.option.storageMonitor.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.networkReceiver": "Network Receiver", + "text.autoconfig.refinedstorage2.option.networkReceiver.energyUsage": "Energy usage", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", @@ -325,5 +348,7 @@ "advancements.refinedstorage2.wireless": "Wireless", "advancements.refinedstorage2.wireless.description": "Access your resources wirelessly with a Wireless Grid.", "advancements.refinedstorage2.better_than_a_barrel": "Better than a barrel", - "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network" + "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", + "advancements.refinedstorage2.no_cables_required": "No cables required", + "advancements.refinedstorage2.no_cables_required.description": "Add extra components to your network without using cables by using a Network Transmitter, Network Receiver and Network Card" } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json index 9b8a907a2..e5811b6b1 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/active.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_active", + "parent": "refinedstorage2:block/constructor_destructor/active", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/constructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json index ac9d2a9db..d4f463b18 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor/inactive.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_inactive", + "parent": "refinedstorage2:block/constructor_destructor/inactive", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/constructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/active.json similarity index 100% rename from refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_active.json rename to refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/active.json diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/inactive.json similarity index 100% rename from refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor_inactive.json rename to refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/constructor_destructor/inactive.json diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json index f8c2bad42..50442e8c6 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/active.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_active", + "parent": "refinedstorage2:block/constructor_destructor/active", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/destructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json index 9278c65b1..85c234671 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/destructor/inactive.json @@ -1,5 +1,5 @@ { - "parent": "refinedstorage2:block/constructor_destructor_inactive", + "parent": "refinedstorage2:block/constructor_destructor/inactive", "textures": { "border": "refinedstorage2:block/cable/part_border", "front": "refinedstorage2:block/destructor/front", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/active.json new file mode 100644 index 000000000..d0a6a83b2 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/active.json @@ -0,0 +1,233 @@ +{ + "render_type": "cutout", + "parent": "block/cube", + "ambientocclusion": false, + "textures": { + "particle": "refinedstorage2:block/wireless_transmitter/base", + "torch": "refinedstorage2:block/wireless_transmitter/base" + }, + "elements": [ + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 10, + 9 + ], + "shade": false, + "faces": { + "down": { + "uv": [ + 7, + 13, + 9, + 15 + ], + "texture": "#torch" + }, + "up": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 16 + ], + "shade": false, + "faces": { + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 0, + 0, + 7 + ], + "to": [ + 16, + 16, + 9 + ], + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 10, + 9 + ], + "shade": false, + "faces": { + "down": { + "uv": [ + 7, + 13, + 9, + 15 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "up": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + }, + { + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 16 + ], + "shade": false, + "faces": { + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + }, + { + "from": [ + 0, + 0, + 7 + ], + "to": [ + 16, + 16, + 9 + ], + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + } + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json index ecfb994fd..4e1f0ad54 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json @@ -127,11 +127,7 @@ 9, 15 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" }, "up": { "uv": [ @@ -140,11 +136,7 @@ 9, 8 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" } } }, @@ -168,11 +160,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" }, "east": { "uv": [ @@ -181,11 +169,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" } } }, @@ -209,11 +193,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" }, "south": { "uv": [ @@ -222,11 +202,7 @@ 16, 16 ], - "texture": "#cutout", - "forge_data": { - "block_light": 15, - "sky_light": 15 - } + "texture": "#cutout" } } } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card.json new file mode 100644 index 000000000..d0e58b52d --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card.json @@ -0,0 +1,17 @@ +{ + "parent": "item/generated", + "overrides": [ + { + "predicate": { + "active": 0 + }, + "model": "refinedstorage2:item/configuration_card/inactive" + }, + { + "predicate": { + "active": 1 + }, + "model": "refinedstorage2:item/configuration_card/active" + } + ] +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card/active.json new file mode 100644 index 000000000..d59df8a1f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card/active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/configuration_card/active" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card/inactive.json new file mode 100644 index 000000000..211dd1de5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/configuration_card/inactive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/configuration_card/inactive" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json new file mode 100644 index 000000000..9138e7731 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card.json @@ -0,0 +1,17 @@ +{ + "parent": "item/generated", + "overrides": [ + { + "predicate": { + "active": 0 + }, + "model": "refinedstorage2:item/network_card/inactive" + }, + { + "predicate": { + "active": 1 + }, + "model": "refinedstorage2:item/network_card/active" + } + ] +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json new file mode 100644 index 000000000..b13105f56 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/network_card/active" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json new file mode 100644 index 000000000..0468d834e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/network_card/inactive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/network_card/inactive" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/base.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/base.png new file mode 100644 index 000000000..f0fdad1d7 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/base.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/black.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/black.png new file mode 100644 index 000000000..58f7b9244 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/black.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/blue.png new file mode 100644 index 000000000..00d6eb6f0 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/brown.png new file mode 100644 index 000000000..63204a3af Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/brown.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/cyan.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/cyan.png new file mode 100644 index 000000000..dc7165708 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/cyan.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/gray.png new file mode 100644 index 000000000..f529f259e Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/green.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/green.png new file mode 100644 index 000000000..77523987d Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/green.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/inactive.png new file mode 100644 index 000000000..b5bc63f8f Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/inactive.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/light_blue.png new file mode 100644 index 000000000..a6b017a44 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/light_blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/light_gray.png new file mode 100644 index 000000000..fca72ba2e Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/light_gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/lime.png new file mode 100644 index 000000000..d2dc60135 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/lime.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/magenta.png new file mode 100644 index 000000000..039d61ef9 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/magenta.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/orange.png new file mode 100644 index 000000000..7389d27e3 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/orange.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/pink.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/pink.png new file mode 100644 index 000000000..7991ef0d9 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/pink.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/purple.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/purple.png new file mode 100644 index 000000000..204cbc55c Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/purple.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/red.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/red.png new file mode 100644 index 000000000..d4b83ce38 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/red.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/white.png new file mode 100644 index 000000000..ddbc7f2dd Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/white.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/yellow.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/yellow.png new file mode 100644 index 000000000..b6fcecf4b Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_receiver/cutouts/yellow.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png new file mode 100644 index 000000000..9e4f2df05 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png new file mode 100644 index 000000000..b478acfc8 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png new file mode 100644 index 000000000..552572138 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png new file mode 100644 index 000000000..fb4d506cb Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png new file mode 100644 index 000000000..b5973a446 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png new file mode 100644 index 000000000..0ad29042b Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png new file mode 100644 index 000000000..ce0726150 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png new file mode 100644 index 000000000..df155b8d7 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png new file mode 100644 index 000000000..d86c8677a Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png new file mode 100644 index 000000000..d069dbfbc Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png new file mode 100644 index 000000000..da38b659e Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png new file mode 100644 index 000000000..15de16c8d Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png new file mode 100644 index 000000000..3505727f5 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png new file mode 100644 index 000000000..d1891b6b0 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png new file mode 100644 index 000000000..4747663ab Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png new file mode 100644 index 000000000..7ce5ab351 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png new file mode 100644 index 000000000..129e1093c Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png new file mode 100644 index 000000000..8cc85ea01 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png new file mode 100644 index 000000000..106584585 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png new file mode 100755 index 000000000..1d25ea190 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/configuration_card/active.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/configuration_card/active.png new file mode 100644 index 000000000..a4d8387d7 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/configuration_card/active.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/configuration_card/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/configuration_card/inactive.png new file mode 100644 index 000000000..3ef77e19c Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/configuration_card/inactive.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/active.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/active.png new file mode 100644 index 000000000..02edcd362 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/active.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/inactive.png new file mode 100644 index 000000000..1f23b8d5a Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/network_card/inactive.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json new file mode 100644 index 000000000..b13859692 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json @@ -0,0 +1,34 @@ +{ + "display": { + "icon": { + "item": "refinedstorage2:network_transmitter" + }, + "title": { + "translate": "advancements.refinedstorage2.no_cables_required" + }, + "description": { + "translate": "advancements.refinedstorage2.no_cables_required.description" + } + }, + "parent": "refinedstorage2:wireless", + "criteria": { + "network_transmitter_receiver_card_in_inventory": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "tag": "refinedstorage2:network_receivers" + }, + { + "items": [ + "refinedstorage2:network_card" + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/configuration_card.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/configuration_card.json new file mode 100644 index 000000000..553f5a645 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/configuration_card.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EEE", + "PAP", + "EEE" + ], + "key": { + "E": { + "item": "refinedstorage2:quartz_enriched_iron" + }, + "P": { + "item": "minecraft:paper" + }, + "A": { + "item": "refinedstorage2:improved_processor" + } + }, + "result": { + "item": "refinedstorage2:configuration_card" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json new file mode 100644 index 000000000..05980b01d --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_card.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EEE", + "PAP", + "EEE" + ], + "key": { + "E": { + "item": "refinedstorage2:quartz_enriched_iron" + }, + "P": { + "item": "minecraft:paper" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + } + }, + "result": { + "item": "refinedstorage2:network_card" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_receiver.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_receiver.json new file mode 100644 index 000000000..4f9df536f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_receiver.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "ANA", + "CMD", + "EEE" + ], + "key": { + "E": { + "item": "minecraft:ender_pearl" + }, + "C": { + "item": "refinedstorage2:construction_core" + }, + "M": { + "item": "refinedstorage2:machine_casing" + }, + "D": { + "item": "refinedstorage2:destruction_core" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + }, + "N": { + "item": "minecraft:netherite_ingot" + } + }, + "result": { + "item": "refinedstorage2:network_receiver" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json new file mode 100644 index 000000000..ee854972e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EEE", + "CMD", + "ANA" + ], + "key": { + "E": { + "item": "minecraft:ender_pearl" + }, + "C": { + "item": "refinedstorage2:construction_core" + }, + "M": { + "item": "refinedstorage2:machine_casing" + }, + "D": { + "item": "refinedstorage2:destruction_core" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + }, + "N": { + "item": "minecraft:netherite_ingot" + } + }, + "result": { + "item": "refinedstorage2:network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/PlatformTestFixtures.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/PlatformTestFixtures.java index 7aaefa6f5..e617e9d33 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/PlatformTestFixtures.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/PlatformTestFixtures.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.common; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; -import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.registry.PlatformRegistryImpl; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.support.registry.PlatformRegistryImpl; import net.minecraft.resources.ResourceLocation; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/SimpleListener.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/SimpleListener.java index 0e86a7f65..3e2a1888a 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/SimpleListener.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/SimpleListener.java @@ -15,8 +15,4 @@ public boolean isChanged() { public int getChanges() { return changes; } - - public void reset() { - changes = 0; - } } diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java new file mode 100644 index 000000000..cde1aed42 --- /dev/null +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/TestPlatform.java @@ -0,0 +1,208 @@ +package com.refinedmods.refinedstorage2.platform.common; + +import com.refinedmods.refinedstorage2.api.core.Action; +import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; +import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; +import com.refinedmods.refinedstorage2.platform.common.support.render.FluidRenderer; + +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import javax.annotation.Nullable; + +import net.minecraft.client.KeyMapping; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.components.EditBox; +import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.tags.TagKey; +import net.minecraft.world.Container; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.tooltip.TooltipComponent; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingRecipe; +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.LiquidBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; + +public class TestPlatform implements Platform { + private final long bucketAmount; + + public TestPlatform(final long bucketAmount) { + this.bucketAmount = bucketAmount; + } + + @Override + public ServerToClientCommunications getServerToClientCommunications() { + throw new UnsupportedOperationException(); + } + + @Override + public ClientToServerCommunications getClientToServerCommunications() { + throw new UnsupportedOperationException(); + } + + @Override + public MenuOpener getMenuOpener() { + throw new UnsupportedOperationException(); + } + + @Override + public long getBucketAmount() { + return bucketAmount; + } + + @Override + public TagKey getWrenchTag() { + throw new UnsupportedOperationException(); + } + + @Override + public Config getConfig() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean canEditBoxLoseFocus(final EditBox editBox) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isKeyDown(final KeyMapping keyMapping) { + throw new UnsupportedOperationException(); + } + + @Override + public GridResourceFactory getItemGridResourceFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public GridResourceFactory getFluidGridResourceFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public GridInsertionStrategyFactory getDefaultGridInsertionStrategyFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public FluidRenderer getFluidRenderer() { + throw new UnsupportedOperationException(); + } + + @Override + public Optional getContainedFluid(final ItemStack stack) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional convertJeiIngredientToFluid(final Object ingredient) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional convertToBucket(final FluidResource fluidResource) { + throw new UnsupportedOperationException(); + } + + @Override + public TransferManager createTransferManager(final AbstractContainerMenu containerMenu) { + throw new UnsupportedOperationException(); + } + + @Override + public long insertIntoContainer(final Container container, final ItemResource itemResource, final long amount, + final Action action) { + throw new UnsupportedOperationException(); + } + + @Override + public ItemStack getCloneItemStack(final BlockState state, final Level level, final BlockHitResult hitResult, + final Player player) { + throw new UnsupportedOperationException(); + } + + @Override + public NonNullList getRemainingCraftingItems(final Player player, final CraftingRecipe craftingRecipe, + final CraftingContainer container) { + throw new UnsupportedOperationException(); + } + + @Override + public void onItemCrafted(final Player player, final ItemStack craftedStack, final CraftingContainer container) { + throw new UnsupportedOperationException(); + } + + @Override + public Player getFakePlayer(final ServerLevel level, @Nullable final UUID playerId) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean canBreakBlock(final Level level, final BlockPos pos, final BlockState state, final Player player) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean placeBlock(final Level level, final BlockPos pos, final Direction direction, final Player player, + final ItemStack stack) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean placeFluid(final Level level, final BlockPos pos, final Direction direction, final Player player, + final FluidResource fluidResource) { + throw new UnsupportedOperationException(); + } + + @Override + public ItemStack getBlockAsItemStack(final Block block, final BlockState state, final Direction direction, + final BlockGetter level, + final BlockPos pos, final Player player) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional getBucketPickupSound(final LiquidBlock liquidBlock, final BlockState state) { + throw new UnsupportedOperationException(); + } + + @Override + public List processTooltipComponents(final ItemStack stack, final GuiGraphics graphics, + final int mouseX, + final Optional imageComponent, + final List components) { + throw new UnsupportedOperationException(); + } + + @Override + public void renderTooltip(final GuiGraphics graphics, final List components, final int x, + final int y) { + throw new UnsupportedOperationException(); + } + + @Override + public Optional getEnergyStorage(final ItemStack stack) { + throw new UnsupportedOperationException(); + } +} diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSortingTypesTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSortingTypesTest.java similarity index 95% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSortingTypesTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSortingTypesTest.java index 0fa853b04..6a3c64e86 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/GridSortingTypesTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/grid/GridSortingTypesTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid; +package com.refinedmods.refinedstorage2.platform.common.grid; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; @@ -7,8 +7,8 @@ import com.refinedmods.refinedstorage2.api.grid.view.GridViewBuilder; import com.refinedmods.refinedstorage2.api.grid.view.GridViewBuilderImpl; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.AbstractItemGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.grid.view.AbstractItemGridResourceFactory; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; import java.util.Comparator; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/LastModifiedTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/LastModifiedTest.java similarity index 98% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/LastModifiedTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/LastModifiedTest.java index 07bb62c42..1679ba1e4 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/screen/grid/LastModifiedTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/grid/screen/LastModifiedTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.grid; +package com.refinedmods.refinedstorage2.platform.common.grid.screen; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/ClientStorageRepositoryTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/ClientStorageRepositoryTest.java similarity index 95% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/ClientStorageRepositoryTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/ClientStorageRepositoryTest.java index a86490f7a..6ea4bc7ec 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/ClientStorageRepositoryTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/ClientStorageRepositoryTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.storage.StorageInfo; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/FluidStorageTypeTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageTypeTest.java similarity index 94% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/FluidStorageTypeTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageTypeTest.java index 88a4f496d..88a44c6bf 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/FluidStorageTypeTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/FluidStorageTypeTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.type; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -11,11 +11,10 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.common.SimpleListener; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.LimitedPlatformStorage; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.PlatformStorage; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; import net.minecraft.nbt.CompoundTag; @@ -28,7 +27,7 @@ @SetupMinecraft class FluidStorageTypeTest { - FluidStorageType sut = StorageTypes.FLUID; + StorageType sut = StorageTypes.FLUID; SimpleListener listener; @BeforeEach diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/ItemStorageTypeTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageTypeTest.java similarity index 94% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/ItemStorageTypeTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageTypeTest.java index 60cba8e9e..79fcf3529 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/type/ItemStorageTypeTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/ItemStorageTypeTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage.type; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -11,11 +11,10 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; +import com.refinedmods.refinedstorage2.platform.api.storage.StorageType; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.SimpleListener; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.LimitedPlatformStorage; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.PlatformStorage; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; import net.minecraft.nbt.CompoundTag; @@ -28,7 +27,7 @@ @SetupMinecraft class ItemStorageTypeTest { - ItemStorageType sut = StorageTypes.ITEM; + StorageType sut = StorageTypes.ITEM; SimpleListener listener; @BeforeEach diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/LimitedPlatformStorageTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/LimitedPlatformStorageTest.java similarity index 80% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/LimitedPlatformStorageTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/LimitedPlatformStorageTest.java index 357dd4943..13558e964 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/LimitedPlatformStorageTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/LimitedPlatformStorageTest.java @@ -1,10 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.storage.InMemoryStorageImpl; import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorage; import com.refinedmods.refinedstorage2.api.storage.limited.LimitedStorageImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/PlatformStorageTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorageTest.java similarity index 94% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/PlatformStorageTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorageTest.java index 1b1a3ddec..530a6dd3e 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/PlatformStorageTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/PlatformStorageTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -9,10 +9,9 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageRepository; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.SimpleListener; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; import net.minecraft.world.item.Items; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageRepositoryImplTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageRepositoryImplTest.java similarity index 97% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageRepositoryImplTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageRepositoryImplTest.java index 366ce95a3..b0a69ffb8 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/storage/StorageRepositoryImplTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/storage/StorageRepositoryImplTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.storage; +package com.refinedmods.refinedstorage2.platform.common.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -11,10 +11,9 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorage; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedStorageImpl; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.PlatformTestFixtures; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; import com.refinedmods.refinedstorage2.platform.test.SetupMinecraft; import java.util.Optional; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/PlatformRegistryImplTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/registry/PlatformRegistryImplTest.java similarity index 96% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/PlatformRegistryImplTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/registry/PlatformRegistryImplTest.java index 4f615b0e4..af72b8a35 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/internal/registry/PlatformRegistryImplTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/registry/PlatformRegistryImplTest.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.registry; +package com.refinedmods.refinedstorage2.platform.common.support.registry; -import com.refinedmods.refinedstorage2.platform.api.registry.PlatformRegistry; +import com.refinedmods.refinedstorage2.platform.api.support.registry.PlatformRegistry; import java.util.List; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRenderingTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRenderingTest.java new file mode 100644 index 000000000..20b210dd4 --- /dev/null +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/resource/FluidResourceRenderingTest.java @@ -0,0 +1,47 @@ +package com.refinedmods.refinedstorage2.platform.common.support.resource; + +import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; +import com.refinedmods.refinedstorage2.platform.common.TestPlatform; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class FluidResourceRenderingTest { + private static final long BUCKET_AMOUNT = 1000; + + @BeforeAll + static void setUp() { + PlatformProxy.loadPlatform(new TestPlatform(BUCKET_AMOUNT)); + } + + @Test + void shouldFormatWithUnitsForCompleteBuckets() { + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT)).isEqualTo("1"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 2)).isEqualTo("2"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 3)).isEqualTo("3"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT * 1000)).isEqualTo("1K"); + } + + @Test + void shouldFormatWithUnitsForPartialBuckets() { + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT + 1)).isEqualTo("1"); + } + + @Test + void shouldFormatWithUnitsForLessThan1Bucket() { + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT / 2)).isEqualTo("0.5"); + assertThat(FluidResourceRendering.formatWithUnits(BUCKET_AMOUNT / 3)).isEqualTo("0.3"); + } + + @Test + void shouldFormatWithoutUnits() { + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT)).isEqualTo("1"); + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1.5"); + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 3))).isEqualTo("1.3"); + assertThat(FluidResourceRendering.format(BUCKET_AMOUNT * 1000)).isEqualTo("1,000"); + assertThat(FluidResourceRendering.format((BUCKET_AMOUNT * 1000) + (BUCKET_AMOUNT / 3))).isEqualTo("1,000.3"); + } +} diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/HistoryTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/widget/HistoryTest.java similarity index 97% rename from refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/HistoryTest.java rename to refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/widget/HistoryTest.java index ce50f5e5e..b98e5ca62 100644 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/screen/widget/HistoryTest.java +++ b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/support/widget/HistoryTest.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.common.screen.widget; +package com.refinedmods.refinedstorage2.platform.common.support.widget; import java.util.ArrayList; import java.util.List; diff --git a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormattingTest.java b/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormattingTest.java deleted file mode 100644 index ce3321df0..000000000 --- a/refinedstorage2-platform-common/src/test/java/com/refinedmods/refinedstorage2/platform/common/util/BucketAmountFormattingTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.refinedmods.refinedstorage2.platform.common.util; - -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -class BucketAmountFormattingTest { - private static final long BUCKET_AMOUNT = 1000; - - private final BucketAmountFormatting sut = new BucketAmountFormatting(BUCKET_AMOUNT); - - @Test - void shouldFormatWithUnitsForCompleteBuckets() { - assertThat(sut.formatWithUnits(BUCKET_AMOUNT)).isEqualTo("1"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT * 2)).isEqualTo("2"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT * 3)).isEqualTo("3"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT * 1000)).isEqualTo("1K"); - } - - @Test - void shouldFormatWithUnitsForPartialBuckets() { - assertThat(sut.formatWithUnits(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT + 1)).isEqualTo("1"); - } - - @Test - void shouldFormatWithUnitsForLessThan1Bucket() { - assertThat(sut.formatWithUnits(BUCKET_AMOUNT / 2)).isEqualTo("0.5"); - assertThat(sut.formatWithUnits(BUCKET_AMOUNT / 3)).isEqualTo("0.3"); - } - - @Test - void shouldFormatWithoutUnits() { - assertThat(sut.format(BUCKET_AMOUNT)).isEqualTo("1"); - assertThat(sut.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 2))).isEqualTo("1.5"); - assertThat(sut.format(BUCKET_AMOUNT + (BUCKET_AMOUNT / 3))).isEqualTo("1.3"); - assertThat(sut.format(BUCKET_AMOUNT * 1000)).isEqualTo("1,000"); - assertThat(sut.format((BUCKET_AMOUNT * 1000) + (BUCKET_AMOUNT / 3))).isEqualTo("1,000.3"); - } -} 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 1073aec9e..b258057b5 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 @@ -1,38 +1,41 @@ package com.refinedmods.refinedstorage2.platform.fabric; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.AbstractClientModInitializer; +import com.refinedmods.refinedstorage2.platform.common.configurationcard.ConfigurationCardItemPropertyFunction; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; -import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.render.NetworkItemItemPropertyFunction; -import com.refinedmods.refinedstorage2.platform.common.render.entity.StorageMonitorBlockEntityRenderer; -import com.refinedmods.refinedstorage2.platform.common.render.model.ControllerModelPredicateProvider; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.CompositeClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.ResourceClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.UpgradeDestinationClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei.RefinedStorageREIClientPlugin; -import com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei.ReiGridSynchronizer; -import com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei.ReiProxy; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerModelPredicateProvider; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItemPropertyFunction; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.NetworkBoundItemItemPropertyFunction; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.CompositeClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.HelpClientTooltipComponent; +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.fabric.mixin.ItemPropertiesAccessor; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.ControllerEnergyInfoPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridClearPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.NetworkTransmitterStatusPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.StorageInfoResponsePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.WirelessTransmitterRangePacket; -import com.refinedmods.refinedstorage2.platform.fabric.render.entity.DiskDriveBlockEntityRendererImpl; -import com.refinedmods.refinedstorage2.platform.fabric.render.model.DiskDriveUnbakedModel; -import com.refinedmods.refinedstorage2.platform.fabric.render.model.EmissiveModelRegistry; +import com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei.RefinedStorageREIClientPlugin; +import com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei.ReiGridSynchronizer; +import com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei.ReiProxy; +import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.DiskDriveBlockEntityRendererImpl; +import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.DiskDriveUnbakedModel; +import com.refinedmods.refinedstorage2.platform.fabric.support.render.EmissiveModelRegistry; import java.util.List; @@ -107,6 +110,8 @@ private void setRenderLayers() { setCutout(Blocks.INSTANCE.getConstructor()); setCutout(Blocks.INSTANCE.getDestructor()); setCutout(Blocks.INSTANCE.getWirelessTransmitter()); + setCutout(Blocks.INSTANCE.getNetworkReceiver()); + setCutout(Blocks.INSTANCE.getNetworkTransmitter()); } private void setCutout(final BlockColorMap blockMap) { @@ -143,6 +148,12 @@ private void registerEmissiveModels() { Blocks.INSTANCE.getWirelessTransmitter().forEach( (color, id, block) -> registerEmissiveWirelessTransmitterModels(color, id) ); + Blocks.INSTANCE.getNetworkReceiver().forEach( + (color, id, block) -> registerEmissiveNetworkReceiverModels(color, id) + ); + Blocks.INSTANCE.getNetworkTransmitter().forEach( + (color, id, block) -> registerEmissiveNetworkTransmitterModels(color, id) + ); } private void registerEmissiveControllerModels(final DyeColor color) { @@ -222,6 +233,36 @@ private void registerEmissiveWirelessTransmitterModels(final DyeColor color, fin ); } + private void registerEmissiveNetworkReceiverModels(final DyeColor color, final ResourceLocation id) { + // Block + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_receiver/" + color.getName()), + createIdentifier("block/network_receiver/cutouts/" + color.getName()) + ); + // Item + EmissiveModelRegistry.INSTANCE.register( + id, + createIdentifier("block/network_receiver/cutouts/" + color.getName()) + ); + } + + private void registerEmissiveNetworkTransmitterModels(final DyeColor color, final ResourceLocation id) { + // Block + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_transmitter/" + color.getName()), + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + ); + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_transmitter/error"), + createIdentifier("block/network_transmitter/cutouts/error") + ); + // Item + EmissiveModelRegistry.INSTANCE.register( + id, + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + ); + } + private void registerPackets() { ClientPlayNetworking.registerGlobalReceiver(PacketIds.STORAGE_INFO_RESPONSE, new StorageInfoResponsePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_UPDATE, new GridUpdatePacket()); @@ -233,6 +274,10 @@ private void registerPackets() { new WirelessTransmitterRangePacket() ); ClientPlayNetworking.registerGlobalReceiver(PacketIds.RESOURCE_SLOT_UPDATE, new ResourceSlotUpdatePacket()); + ClientPlayNetworking.registerGlobalReceiver( + PacketIds.NETWORK_TRANSMITTER_STATUS, + new NetworkTransmitterStatusPacket() + ); } private void registerBlockEntityRenderers() { @@ -336,13 +381,23 @@ private void registerReiGridSynchronizers() { private void registerItemProperties() { ItemProperties.register( Items.INSTANCE.getWirelessGrid(), - NetworkItemItemPropertyFunction.NAME, - new NetworkItemItemPropertyFunction() + NetworkBoundItemItemPropertyFunction.NAME, + new NetworkBoundItemItemPropertyFunction() ); ItemProperties.register( Items.INSTANCE.getCreativeWirelessGrid(), - NetworkItemItemPropertyFunction.NAME, - new NetworkItemItemPropertyFunction() + NetworkBoundItemItemPropertyFunction.NAME, + new NetworkBoundItemItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getConfigurationCard(), + ConfigurationCardItemPropertyFunction.NAME, + new ConfigurationCardItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getNetworkCard(), + NetworkCardItemPropertyFunction.NAME, + new NetworkCardItemPropertyFunction() ); } } 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 49f8c4428..df268b19a 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 @@ -2,9 +2,9 @@ import com.refinedmods.refinedstorage2.api.grid.view.GridSortingDirection; import com.refinedmods.refinedstorage2.platform.common.content.DefaultEnergyUsage; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSize; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSortingTypes; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSize; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSortingTypes; import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; import java.util.Optional; @@ -75,6 +75,16 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage2.p DefaultEnergyUsage.STORAGE_MONITOR ); + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl networkReceiver = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.NETWORK_RECEIVER + ); + + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl networkTransmitter = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); + public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); } @@ -169,6 +179,16 @@ public SimpleEnergyUsageEntry getStorageMonitor() { return storageMonitor; } + @Override + public SimpleEnergyUsageEntry getNetworkReceiver() { + return networkReceiver; + } + + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + private static class GridEntryImpl implements GridEntry { private boolean largeFont = false; 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 ab9396031..df9396002 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 @@ -1,37 +1,32 @@ package com.refinedmods.refinedstorage2.platform.fabric; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.EnergyBlockEntity; -import com.refinedmods.refinedstorage2.platform.api.item.EnergyItem; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItem; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.AbstractModInitializer; -import com.refinedmods.refinedstorage2.platform.common.block.AbstractBaseBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntityTypeFactory; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.CreativeModeTabItems; import com.refinedmods.refinedstorage2.platform.common.content.DirectRegistryCallback; import com.refinedmods.refinedstorage2.platform.common.content.MenuTypeFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.network.node.iface.externalstorage.InterfacePlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.item.WirelessGridItem; -import com.refinedmods.refinedstorage2.platform.common.util.TickHandler; -import com.refinedmods.refinedstorage2.platform.fabric.block.entity.FabricDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.fabric.integration.trinkets.TrinketsSlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.fabric.integration.trinkets.TrinketsSlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.fabric.internal.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.FluidGridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.FluidGridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.ItemGridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.ItemGridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.exporter.StorageExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.externalstorage.StoragePlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.importer.StorageImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.fabric.internal.storage.ResourceContainerFluidStorageAdapter; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfacePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeItem; +import com.refinedmods.refinedstorage2.platform.common.util.ServerEventQueue; +import com.refinedmods.refinedstorage2.platform.fabric.exporter.FabricStorageExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.FluidGridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.FluidGridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.ItemGridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.ItemGridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.fabric.importer.FabricStorageImporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.CraftingGridClearPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.CraftingGridRecipeTransferPacket; @@ -45,7 +40,13 @@ import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.SingleAmountChangePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.StorageInfoRequestPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.UseNetworkBoundItemPacket; -import com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil; +import com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive.FabricDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage.FabricStoragePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.fabric.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem.TrinketsSlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem.TrinketsSlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.fabric.support.resource.ResourceContainerFluidStorageAdapter; +import com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil; import java.util.Arrays; import java.util.HashSet; @@ -99,7 +100,7 @@ public class ModInitializerImpl extends AbstractModInitializer implements ModIni public void onInitialize() { AutoConfig.register(ConfigImpl.class, Toml4jConfigSerializer::new); - initializePlatform(new PlatformImpl()); + PlatformProxy.loadPlatform(new PlatformImpl()); initializePlatformApi(); registerAdditionalGridInsertionStrategyFactories(); registerGridExtractionStrategyFactories(); @@ -135,7 +136,7 @@ private void registerGridScrollingStrategyFactories() { private void registerImporterTransferStrategyFactories() { PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( createIdentifier("item"), - new StorageImporterTransferStrategyFactory<>( + new FabricStorageImporterTransferStrategyFactory<>( ItemStorage.SIDED, StorageChannelTypes.ITEM, VariantUtil::ofItemVariant, @@ -145,7 +146,7 @@ private void registerImporterTransferStrategyFactories() { ); PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().register( createIdentifier("fluid"), - new StorageImporterTransferStrategyFactory<>( + new FabricStorageImporterTransferStrategyFactory<>( FluidStorage.SIDED, StorageChannelTypes.FLUID, VariantUtil::ofFluidVariant, @@ -158,7 +159,7 @@ private void registerImporterTransferStrategyFactories() { private void registerExporterTransferStrategyFactories() { PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( createIdentifier("item"), - new StorageExporterTransferStrategyFactory<>( + new FabricStorageExporterTransferStrategyFactory<>( ItemStorage.SIDED, StorageChannelTypes.ITEM, resource -> resource instanceof ItemResource itemResource @@ -170,7 +171,7 @@ private void registerExporterTransferStrategyFactories() { ); PlatformApi.INSTANCE.getExporterTransferStrategyRegistry().register( createIdentifier("fluid"), - new StorageExporterTransferStrategyFactory<>( + new FabricStorageExporterTransferStrategyFactory<>( FluidStorage.SIDED, StorageChannelTypes.FLUID, resource -> resource instanceof FluidResource fluidResource @@ -184,18 +185,20 @@ private void registerExporterTransferStrategyFactories() { private void registerExternalStorageProviderFactories() { PlatformApi.INSTANCE.addExternalStorageProviderFactory(new InterfacePlatformExternalStorageProviderFactory()); - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new StoragePlatformExternalStorageProviderFactory<>( - StorageChannelTypes.ITEM, - ItemStorage.SIDED, - VariantUtil::ofItemVariant, - VariantUtil::toItemVariant - )); - PlatformApi.INSTANCE.addExternalStorageProviderFactory(new StoragePlatformExternalStorageProviderFactory<>( - StorageChannelTypes.FLUID, - FluidStorage.SIDED, - VariantUtil::ofFluidVariant, - VariantUtil::toFluidVariant - )); + PlatformApi.INSTANCE.addExternalStorageProviderFactory( + new FabricStoragePlatformExternalStorageProviderFactory<>( + StorageChannelTypes.ITEM, + ItemStorage.SIDED, + VariantUtil::ofItemVariant, + VariantUtil::toItemVariant + )); + PlatformApi.INSTANCE.addExternalStorageProviderFactory( + new FabricStoragePlatformExternalStorageProviderFactory<>( + StorageChannelTypes.FLUID, + FluidStorage.SIDED, + VariantUtil::ofFluidVariant, + VariantUtil::toFluidVariant + )); } private void registerContent() { @@ -357,7 +360,7 @@ public EnergyStorage find(final ItemStack itemStack, final ContainerItemContext } private void registerTickHandler() { - ServerTickEvents.START_SERVER_TICK.register(server -> TickHandler.runQueuedActions()); + ServerTickEvents.START_SERVER_TICK.register(server -> ServerEventQueue.runQueuedActions()); } private void registerSlotReferenceProviders() { @@ -373,8 +376,11 @@ private void registerSlotReferenceProviders() { private void registerWrenchingEvent() { UseBlockCallback.EVENT.register((player, level, hand, hitResult) -> { final BlockState state = level.getBlockState(hitResult.getBlockPos()); - return AbstractBaseBlock.tryUseWrench(state, level, hitResult, player, hand) - .or(() -> AbstractBaseBlock.tryUpdateColor(state, level, hitResult.getBlockPos(), player, hand)) + if (!(state.getBlock() instanceof AbstractBaseBlock block)) { + return InteractionResult.PASS; + } + return block.tryUseWrench(state, level, hitResult, player, hand) + .or(() -> block.tryUpdateColor(state, level, hitResult.getBlockPos(), player, hand)) .orElse(InteractionResult.PASS); }); } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java index 273f7e10f..b366bcfb3 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/PlatformImpl.java @@ -4,26 +4,24 @@ import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.AbstractPlatform; import com.refinedmods.refinedstorage2.platform.common.Config; -import com.refinedmods.refinedstorage2.platform.common.ContainedFluid; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferManager; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; import com.refinedmods.refinedstorage2.platform.common.util.CustomBlockPlaceContext; -import com.refinedmods.refinedstorage2.platform.fabric.containermenu.ContainerTransferDestination; -import com.refinedmods.refinedstorage2.platform.fabric.internal.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.ItemGridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.view.FabricFluidGridResourceFactory; -import com.refinedmods.refinedstorage2.platform.fabric.internal.grid.view.FabricItemGridResourceFactory; -import com.refinedmods.refinedstorage2.platform.fabric.menu.MenuOpenerImpl; +import com.refinedmods.refinedstorage2.platform.fabric.grid.strategy.ItemGridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.fabric.grid.view.FabricFluidGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.fabric.grid.view.FabricItemGridResourceFactory; import com.refinedmods.refinedstorage2.platform.fabric.mixin.EditBoxAccessor; import com.refinedmods.refinedstorage2.platform.fabric.mixin.KeyMappingAccessor; import com.refinedmods.refinedstorage2.platform.fabric.packet.c2s.ClientToServerCommunicationsImpl; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.ServerToClientCommunicationsImpl; -import com.refinedmods.refinedstorage2.platform.fabric.render.FluidVariantFluidRenderer; -import com.refinedmods.refinedstorage2.platform.fabric.util.SingleStackStorageImpl; +import com.refinedmods.refinedstorage2.platform.fabric.support.containermenu.ContainerTransferDestination; +import com.refinedmods.refinedstorage2.platform.fabric.support.containermenu.MenuOpenerImpl; +import com.refinedmods.refinedstorage2.platform.fabric.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage2.platform.fabric.support.render.FluidVariantFluidRenderer; +import com.refinedmods.refinedstorage2.platform.fabric.util.SimpleSingleStackStorage; import java.util.List; import java.util.Optional; @@ -88,9 +86,9 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.ofFluidVariant; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toFluidVariant; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toItemVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.ofFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toItemVariant; public final class PlatformImpl extends AbstractPlatform { private static final TagKey WRENCH_TAG = TagKey.create( @@ -103,7 +101,6 @@ public PlatformImpl() { new ServerToClientCommunicationsImpl(), new ClientToServerCommunicationsImpl(), new MenuOpenerImpl(), - new BucketAmountFormatting(FluidConstants.BUCKET), new FluidVariantFluidRenderer(), ItemGridInsertionStrategy::new ); @@ -152,7 +149,7 @@ public Optional getContainedFluid(final ItemStack stack) { if (stack.isEmpty()) { return Optional.empty(); } - final SingleStackStorageImpl interceptingStorage = new SingleStackStorageImpl(stack); + final SimpleSingleStackStorage interceptingStorage = new SimpleSingleStackStorage(stack); final Storage storage = FluidStorage.ITEM.find(stack, ContainerItemContext.ofSingleSlot( interceptingStorage )); @@ -181,7 +178,7 @@ public Optional convertJeiIngredientToFluid(final Object ingredie @Override public Optional convertToBucket(final FluidResource fluidResource) { - final SingleStackStorageImpl interceptingStorage = SingleStackStorageImpl.forEmptyBucket(); + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); final Storage destination = FluidStorage.ITEM.find( interceptingStorage.getStack(), ContainerItemContext.ofSingleSlot(interceptingStorage) diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/block/entity/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/block/entity/package-info.java deleted file mode 100644 index 09a391245..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/block/entity/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.block.entity; - -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/containermenu/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/containermenu/package-info.java deleted file mode 100644 index fae104b06..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/containermenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.containermenu; - -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/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java similarity index 69% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java index 2a72c1593..ed5f49a3b 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/FabricStorageExporterTransferStrategyFactory.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.exporter; +package com.refinedmods.refinedstorage2.platform.fabric.exporter; import com.refinedmods.refinedstorage2.api.network.impl.node.exporter.AbstractExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.network.node.AbstractFuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.fabric.internal.storage.StorageInsertableStorage; +import com.refinedmods.refinedstorage2.platform.common.exporter.AbstractFuzzyExporterTransferStrategy; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageInsertableStorage; import java.util.Optional; import java.util.function.Function; @@ -20,18 +20,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { +public class FabricStorageExporterTransferStrategyFactory implements ExporterTransferStrategyFactory { private final BlockApiLookup, Direction> lookup; private final StorageChannelType storageChannelType; private final Function toPlatformMapper; private final Function> mapper; private final long singleAmount; - public StorageExporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, - final StorageChannelType storageChannelType, - final Function> mapper, - final Function toPlatformMapper, - final long singleAmount) { + public FabricStorageExporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, + final StorageChannelType storageChannelType, + final Function> mapper, + final Function toPlatformMapper, + final long singleAmount) { this.lookup = lookup; this.storageChannelType = storageChannelType; this.mapper = mapper; @@ -46,7 +46,7 @@ public ExporterTransferStrategy create(final ServerLevel level, final UpgradeState upgradeState, final AmountOverride amountOverride, final boolean fuzzyMode) { - final StorageInsertableStorage insertTarget = new StorageInsertableStorage<>( + final FabricStorageInsertableStorage insertTarget = new FabricStorageInsertableStorage<>( lookup, toPlatformMapper, level, @@ -61,7 +61,7 @@ public ExporterTransferStrategy create(final ServerLevel level, } private AbstractExporterTransferStrategy create(final boolean fuzzyMode, - final StorageInsertableStorage insertTarget, + final FabricStorageInsertableStorage insertTarget, final long transferQuota) { if (fuzzyMode) { return new AbstractFuzzyExporterTransferStrategy<>(insertTarget, storageChannelType, transferQuota) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/package-info.java new file mode 100644 index 000000000..8137ac483 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/exporter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.exporter; + +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/internal/grid/FluidGridExtractionStrategy.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/FluidGridExtractionStrategy.java similarity index 87% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/FluidGridExtractionStrategy.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/FluidGridExtractionStrategy.java index 074b53eec..1537bfc34 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/FluidGridExtractionStrategy.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/FluidGridExtractionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid; +package com.refinedmods.refinedstorage2.platform.fabric.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; @@ -6,13 +6,13 @@ import com.refinedmods.refinedstorage2.api.storage.EmptyActor; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.fabric.util.SingleStackStorageImpl; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.fabric.util.SimpleSingleStackStorage; import net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; @@ -24,7 +24,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.Items; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toFluidVariant; public class FluidGridExtractionStrategy implements GridExtractionStrategy { private static final ItemVariant BUCKET_ITEM_VARIANT = ItemVariant.of(Items.BUCKET); @@ -65,7 +65,7 @@ public boolean onExtract(final PlatformStorageChannelType storageChannelT private void extractWithBucketInStorage(final FluidResource fluidResource, final GridExtractMode mode, final boolean cursor) { - final SingleStackStorageImpl interceptingStorage = SingleStackStorageImpl.forEmptyBucket(); + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); final net.fabricmc.fabric.api.transfer.v1.storage.Storage destination = FluidStorage.ITEM.find( interceptingStorage.getStack(), ContainerItemContext.ofSingleSlot(interceptingStorage) @@ -94,7 +94,7 @@ private void extractWithBucketInInventory(final FluidResource fluidResource, final boolean cursor) { try (Transaction tx = Transaction.openOuter()) { playerInventoryStorage.extract(BUCKET_ITEM_VARIANT, 1, tx); - final SingleStackStorageImpl interceptingStorage = SingleStackStorageImpl.forEmptyBucket(); + final SimpleSingleStackStorage interceptingStorage = SimpleSingleStackStorage.forEmptyBucket(); final net.fabricmc.fabric.api.transfer.v1.storage.Storage dest = FluidStorage.ITEM.find( interceptingStorage.getStack(), ContainerItemContext.ofSingleSlot(interceptingStorage) @@ -123,7 +123,7 @@ private void extractWithBucketInInventory(final FluidResource fluidResource, } } - private boolean insertResultingBucketIntoInventory(final SingleStackStorageImpl interceptingStorage, + private boolean insertResultingBucketIntoInventory(final SimpleSingleStackStorage interceptingStorage, final boolean cursor, final Transaction innerTx) { final net.fabricmc.fabric.api.transfer.v1.storage.Storage relevantStorage = cursor diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/FluidGridInsertionStrategy.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/FluidGridInsertionStrategy.java similarity index 89% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/FluidGridInsertionStrategy.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/FluidGridInsertionStrategy.java index 43f17db9e..13139cb8f 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/FluidGridInsertionStrategy.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/FluidGridInsertionStrategy.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid; +package com.refinedmods.refinedstorage2.platform.fabric.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import javax.annotation.Nullable; @@ -23,8 +23,8 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.ofFluidVariant; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.ofFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toFluidVariant; public class FluidGridInsertionStrategy implements GridInsertionStrategy { private final AbstractContainerMenu containerMenu; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridExtractionStrategy.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridExtractionStrategy.java similarity index 86% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridExtractionStrategy.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridExtractionStrategy.java index 919890924..b77050ac4 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridExtractionStrategy.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridExtractionStrategy.java @@ -1,14 +1,14 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid; +package com.refinedmods.refinedstorage2.platform.fabric.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; @@ -18,7 +18,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toItemVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toItemVariant; public class ItemGridExtractionStrategy implements GridExtractionStrategy { private final GridOperations gridOperations; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridInsertionStrategy.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridInsertionStrategy.java similarity index 86% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridInsertionStrategy.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridInsertionStrategy.java index 90c572e7c..ac9dfce0e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridInsertionStrategy.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridInsertionStrategy.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid; +package com.refinedmods.refinedstorage2.platform.fabric.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; @@ -20,8 +20,8 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.ofItemVariant; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toItemVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.ofItemVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toItemVariant; public class ItemGridInsertionStrategy implements GridInsertionStrategy { private final AbstractContainerMenu containerMenu; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridScrollingStrategy.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridScrollingStrategy.java similarity index 90% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridScrollingStrategy.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridScrollingStrategy.java index ffcbad1b4..7bfec47f0 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/ItemGridScrollingStrategy.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/ItemGridScrollingStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid; +package com.refinedmods.refinedstorage2.platform.fabric.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; @@ -6,11 +6,11 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; import net.fabricmc.fabric.api.transfer.v1.item.PlayerInventoryStorage; @@ -20,7 +20,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toItemVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toItemVariant; public class ItemGridScrollingStrategy implements GridScrollingStrategy { private final GridOperations gridOperations; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/package-info.java new file mode 100644 index 000000000..1721763e7 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.grid.strategy; + +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/internal/grid/view/FabricFluidGridResourceFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/FabricFluidGridResourceFactory.java similarity index 77% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/FabricFluidGridResourceFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/FabricFluidGridResourceFactory.java index 636ee7dcb..7312ea82d 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/FabricFluidGridResourceFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/FabricFluidGridResourceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.fabric.grid.view; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.AbstractFluidGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.common.grid.view.AbstractFluidGridResourceFactory; import java.util.stream.Collectors; @@ -12,7 +12,7 @@ import net.fabricmc.loader.api.metadata.ModMetadata; import net.minecraft.network.chat.Component; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toFluidVariant; public class FabricFluidGridResourceFactory extends AbstractFluidGridResourceFactory { @Override diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/FabricItemGridResourceFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/FabricItemGridResourceFactory.java similarity index 80% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/FabricItemGridResourceFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/FabricItemGridResourceFactory.java index a5ac8ba8a..def6b3975 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/FabricItemGridResourceFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/FabricItemGridResourceFactory.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.fabric.grid.view; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.AbstractItemGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.grid.view.AbstractItemGridResourceFactory; import java.util.Optional; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/package-info.java new file mode 100644 index 000000000..130aa66e0 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.grid.view; + +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/internal/network/node/importer/StorageImporterSource.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterSource.java similarity index 65% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterSource.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterSource.java index 340380936..bc34bcad1 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterSource.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterSource.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.importer; +package com.refinedmods.refinedstorage2.platform.fabric.importer; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.storage.Actor; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.fabric.internal.storage.StorageExtractableStorage; -import com.refinedmods.refinedstorage2.platform.fabric.internal.storage.StorageInsertableStorage; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageExtractableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageInsertableStorage; import java.util.Collections; import java.util.Iterator; @@ -22,23 +22,23 @@ import static com.google.common.collect.Iterators.filter; import static com.google.common.collect.Iterators.transform; -public class StorageImporterSource implements ImporterSource { +class FabricStorageImporterSource implements ImporterSource { private final BlockApiCache, Direction> cache; private final Function fromPlatformMapper; - private final StorageInsertableStorage insertTarget; - private final StorageExtractableStorage extractTarget; + private final FabricStorageInsertableStorage insertTarget; + private final FabricStorageExtractableStorage extractTarget; private final Direction direction; - public StorageImporterSource(final BlockApiLookup, Direction> lookup, - final Function fromPlatformMapper, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction, - final AmountOverride amountOverride) { + FabricStorageImporterSource(final BlockApiLookup, Direction> lookup, + final Function fromPlatformMapper, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction, + final AmountOverride amountOverride) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.fromPlatformMapper = fromPlatformMapper; - this.insertTarget = new StorageInsertableStorage<>( + this.insertTarget = new FabricStorageInsertableStorage<>( lookup, toPlatformMapper, serverLevel, @@ -46,7 +46,7 @@ public StorageImporterSource(final BlockApiLookup, Direction> lookup, direction, AmountOverride.NONE ); - this.extractTarget = new StorageExtractableStorage<>( + this.extractTarget = new FabricStorageExtractableStorage<>( lookup, toPlatformMapper, serverLevel, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java similarity index 69% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java index a8fb85eee..4d3ad81be 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/FabricStorageImporterTransferStrategyFactory.java @@ -1,11 +1,11 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.importer; +package com.refinedmods.refinedstorage2.platform.fabric.importer; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategyImpl; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; @@ -17,18 +17,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { +public class FabricStorageImporterTransferStrategyFactory implements ImporterTransferStrategyFactory { private final BlockApiLookup, Direction> lookup; private final StorageChannelType storageChannelType; private final Function fromPlatformMapper; private final Function toPlatformMapper; private final long singleAmount; - public StorageImporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, - final StorageChannelType storageChannelType, - final Function fromPlatformMapper, - final Function toPlatformMapper, - final long singleAmount) { + public FabricStorageImporterTransferStrategyFactory(final BlockApiLookup, Direction> lookup, + final StorageChannelType storageChannelType, + final Function fromPlatformMapper, + final Function toPlatformMapper, + final long singleAmount) { this.lookup = lookup; this.storageChannelType = storageChannelType; this.fromPlatformMapper = fromPlatformMapper; @@ -42,7 +42,7 @@ public ImporterTransferStrategy create(final ServerLevel level, final Direction direction, final UpgradeState upgradeState, final AmountOverride amountOverride) { - final ImporterSource source = new StorageImporterSource<>( + final ImporterSource source = new FabricStorageImporterSource<>( lookup, fromPlatformMapper, toPlatformMapper, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/package-info.java new file mode 100644 index 000000000..35e4bc8c8 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.importer; + +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/integration/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/package-info.java deleted file mode 100644 index 27808a300..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.integration; - -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/integration/recipemod/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/package-info.java deleted file mode 100644 index 1eda8b6f8..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod; - -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/integration/recipemod/rei/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/package-info.java deleted file mode 100644 index 5e5ddaadd..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; - -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/integration/trinkets/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/package-info.java deleted file mode 100644 index f247c4b8b..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.integration.trinkets; - -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/internal/energy/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/energy/package-info.java deleted file mode 100644 index 2aeaa6802..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/energy/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.energy; - -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/internal/grid/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/package-info.java deleted file mode 100644 index cac05f870..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid; - -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/internal/grid/view/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/package-info.java deleted file mode 100644 index e1ced9814..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.grid.view; - -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/internal/network/node/exporter/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/package-info.java deleted file mode 100644 index 7952855ae..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.exporter; - -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/internal/network/node/externalstorage/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/package-info.java deleted file mode 100644 index a9df68e1c..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.externalstorage; - -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/internal/network/node/importer/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/package-info.java deleted file mode 100644 index aa24c89a2..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.importer; - -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/internal/storage/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/package-info.java deleted file mode 100644 index e52afd15c..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.internal.storage; - -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/menu/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/package-info.java deleted file mode 100644 index dad60097a..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.menu; - -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/mixin/AbstractModelBakerImplMixin.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/mixin/AbstractModelBakerImplMixin.java index 6660f2943..4755550c0 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/mixin/AbstractModelBakerImplMixin.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/mixin/AbstractModelBakerImplMixin.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.fabric.mixin; import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; -import com.refinedmods.refinedstorage2.platform.fabric.render.model.EmissiveModelRegistry; +import com.refinedmods.refinedstorage2.platform.fabric.support.render.EmissiveModelRegistry; import java.util.Map; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/ModMenuIntegration.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/modmenu/ModMenuApiImpl.java similarity index 79% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/ModMenuIntegration.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/modmenu/ModMenuApiImpl.java index d0375e056..e9d43d3e1 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/ModMenuIntegration.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/modmenu/ModMenuApiImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration; +package com.refinedmods.refinedstorage2.platform.fabric.modmenu; import com.refinedmods.refinedstorage2.platform.fabric.ConfigImpl; @@ -9,7 +9,7 @@ import net.fabricmc.api.Environment; @Environment(EnvType.CLIENT) -public class ModMenuIntegration implements ModMenuApi { +public class ModMenuApiImpl implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { return parent -> AutoConfig.getConfigScreen(ConfigImpl.class, parent).get(); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/modmenu/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/modmenu/package-info.java new file mode 100644 index 000000000..657a0c060 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/modmenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.modmenu; + +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/packet/PacketIds.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java index c0a02ea47..0484186f9 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java @@ -25,6 +25,7 @@ public final class PacketIds { public static final ResourceLocation RESOURCE_SLOT_AMOUNT_CHANGE = createIdentifier("resource_slot_amount_change"); public static final ResourceLocation SINGLE_AMOUNT_CHANGE = createIdentifier("detector_amount_change"); public static final ResourceLocation USE_NETWORK_BOUND_ITEM = createIdentifier("use_network_bound_item"); + public static final ResourceLocation NETWORK_TRANSMITTER_STATUS = createIdentifier("network_transmitter_status"); private PacketIds() { } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java index 1d079ed41..8ca5e7363 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ClientToServerCommunicationsImpl.java @@ -4,11 +4,11 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyType; -import com.refinedmods.refinedstorage2.platform.common.packet.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridClearPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridClearPacket.java index 7e94d5ae5..8660d7e59 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridClearPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridClearPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridRecipeTransferPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridRecipeTransferPacket.java index e3bf37bbb..40e57730e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridRecipeTransferPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/CraftingGridRecipeTransferPacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.ArrayList; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridExtractPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridExtractPacket.java index 566550c86..b548b2eaa 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridExtractPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridExtractPacket.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import net.fabricmc.fabric.api.networking.v1.PacketSender; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridInsertPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridInsertPacket.java index a398baf28..642ac2cc6 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridInsertPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridInsertPacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridScrollPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridScrollPacket.java index 22ffc8bd6..c67e5d2f1 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridScrollPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/GridScrollPacket.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import net.fabricmc.fabric.api.networking.v1.PacketSender; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/PropertyChangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/PropertyChangePacket.java index d4f5b95e0..bce12abfd 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/PropertyChangePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/PropertyChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceFilterSlotChangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceFilterSlotChangePacket.java index 3fd763202..3e1329cf1 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceFilterSlotChangePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceFilterSlotChangePacket.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotAmountChangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotAmountChangePacket.java index 177e449e8..0eb3f38b2 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotAmountChangePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotAmountChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotChangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotChangePacket.java index fa036d7ea..f2f9b011e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotChangePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/ResourceSlotChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/SingleAmountChangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/SingleAmountChangePacket.java index 46f42f452..5559cde29 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/SingleAmountChangePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/SingleAmountChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java index 11396275e..0a32c7fa4 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/c2s/UseNetworkBoundItemPacket.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.c2s; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.Optional; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ControllerEnergyInfoPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ControllerEnergyInfoPacket.java index 0ccd53bd3..5ea8ef168 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ControllerEnergyInfoPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ControllerEnergyInfoPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerContainerMenu; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.networking.v1.PacketSender; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridClearPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridClearPacket.java index 0394fdb16..dd2aae2e6 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridClearPacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridClearPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.networking.v1.PacketSender; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridUpdatePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridUpdatePacket.java index 24fc5cb03..7b0dfcab5 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridUpdatePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/GridUpdatePacket.java @@ -3,7 +3,7 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java new file mode 100644 index 000000000..f174071cd --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; + +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.networking.v1.PacketSender; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientPacketListener; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; + +public class NetworkTransmitterStatusPacket implements ClientPlayNetworking.PlayChannelHandler { + @Override + public void receive(final Minecraft client, + final ClientPacketListener handler, + final FriendlyByteBuf buf, + final PacketSender responseSender) { + final boolean error = buf.readBoolean(); + final Component message = buf.readComponent(); + + client.execute(() -> { + if (client.player.containerMenu instanceof NetworkTransmitterContainerMenu containerMenu) { + containerMenu.setStatus(new NetworkTransmitterStatus(error, message)); + } + }); + } +} diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ResourceSlotUpdatePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ResourceSlotUpdatePacket.java index 891f2db91..572eb8a41 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ResourceSlotUpdatePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ResourceSlotUpdatePacket.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import java.util.function.Consumer; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java index cdb516b4e..7d4c0bde8 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java @@ -3,9 +3,10 @@ import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.packet.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; @@ -102,6 +103,14 @@ public void sendStorageInfoResponse(final ServerPlayer player, final UUID id, fi }); } + @Override + public void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterStatus status) { + sendToPlayer(player, PacketIds.NETWORK_TRANSMITTER_STATUS, buf -> { + buf.writeBoolean(status.error()); + buf.writeComponent(status.message()); + }); + } + private static void sendToPlayer(final ServerPlayer playerEntity, final ResourceLocation id, final Consumer bufConsumer) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/StorageInfoResponsePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/StorageInfoResponsePacket.java index 880f1adbc..a1e9f1558 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/StorageInfoResponsePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/StorageInfoResponsePacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.ClientStorageRepository; +import com.refinedmods.refinedstorage2.platform.common.storage.ClientStorageRepository; import java.util.UUID; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java index 71916e1a2..37f9ea822 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.networking.v1.PacketSender; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/CraftingGridTransferHandler.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java similarity index 94% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/CraftingGridTransferHandler.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java index 399e111bb..9f79443da 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/CraftingGridTransferHandler.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/CraftingGridTransferHandler.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import java.awt.Color; import java.util.List; @@ -22,7 +22,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; -public class CraftingGridTransferHandler implements TransferHandler { +class CraftingGridTransferHandler implements TransferHandler { private static final Color MISSING_COLOR = new Color(1.0f, 0.0f, 0.0f, 0.4f); private static final CategoryIdentifier CRAFTING = CategoryIdentifier.of("minecraft", "plugins/crafting"); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/DraggableStackVisitorImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java similarity index 88% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/DraggableStackVisitorImpl.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java index 40d134b1e..2158f1bbf 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/DraggableStackVisitorImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/DraggableStackVisitorImpl.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; import java.util.ArrayList; import java.util.List; @@ -19,11 +19,11 @@ import me.shedaniel.rei.api.client.gui.drag.DraggingContext; import net.minecraft.client.gui.screens.Screen; -public class DraggableStackVisitorImpl +class DraggableStackVisitorImpl implements DraggableStackVisitor> { private final IngredientConverter ingredientConverter; - public DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { + DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { this.ingredientConverter = ingredientConverter; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ExclusionZonesProviderImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java similarity index 64% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ExclusionZonesProviderImpl.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java index 64b295ae6..822a1532c 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ExclusionZonesProviderImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ExclusionZonesProviderImpl.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import java.util.Collection; import java.util.stream.Collectors; @@ -8,7 +8,7 @@ import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.registry.screen.ExclusionZonesProvider; -public class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { +class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { @Override public Collection provide(final AbstractBaseScreen screen) { return screen.getExclusionZones().stream() diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/GridFocusedStackProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java similarity index 72% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/GridFocusedStackProvider.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java index 660d56625..0809e36cd 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/GridFocusedStackProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridFocusedStackProvider.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.AbstractGridScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen; import dev.architectury.event.CompoundEventResult; import me.shedaniel.math.Point; @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class GridFocusedStackProvider implements FocusedStackProvider { +class GridFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public GridFocusedStackProvider(final IngredientConverter converter) { + GridFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/GridResourceIngredientConverter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java similarity index 69% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/GridResourceIngredientConverter.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java index 16d8a582b..f55b41a25 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/GridResourceIngredientConverter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/GridResourceIngredientConverter.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.FluidGridResource; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.view.FluidGridResource; +import com.refinedmods.refinedstorage2.platform.common.grid.view.ItemGridResource; import java.util.Optional; import dev.architectury.fluid.FluidStack; import me.shedaniel.rei.api.common.util.EntryStacks; -public class GridResourceIngredientConverter implements IngredientConverter { +class GridResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { return Optional.empty(); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/MissingIngredients.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java similarity index 61% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/MissingIngredients.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java index 6f31fae28..6503aefaa 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/MissingIngredients.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/MissingIngredients.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import java.util.ArrayList; import java.util.List; @@ -7,24 +7,24 @@ import it.unimi.dsi.fastutil.ints.IntSet; import me.shedaniel.rei.api.common.entry.EntryIngredient; -public class MissingIngredients { +class MissingIngredients { private final List ingredients = new ArrayList<>(); private final IntSet indices = new IntOpenHashSet(); - public boolean isEmpty() { + boolean isEmpty() { return indices.isEmpty(); } - public void addIngredient(final EntryIngredient ingredient, final int slotIndex) { + void addIngredient(final EntryIngredient ingredient, final int slotIndex) { ingredients.add(ingredient); indices.add(slotIndex); } - public List getIngredients() { + List getIngredients() { return ingredients; } - public boolean isMissing(final int slotIndex) { + boolean isMissing(final int slotIndex) { return indices.contains(slotIndex); } } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java index f11ede392..a1dc1c257 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.block.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.ContentIds; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.Tags; -import com.refinedmods.refinedstorage2.platform.common.internal.item.EnergyItemHelperImpl; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyItemHelperImpl; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -88,6 +88,13 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) ContentIds.WIRELESS_TRANSMITTER, Tags.WIRELESS_TRANSMITTERS ); + groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS); + groupItems( + registry, + Blocks.INSTANCE.getNetworkTransmitter(), + ContentIds.NETWORK_TRANSMITTER, + Tags.NETWORK_TRANSMITTERS + ); } @Override diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ReiGridSynchronizer.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ReiGridSynchronizer.java similarity index 89% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ReiGridSynchronizer.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ReiGridSynchronizer.java index 73ceb2b97..1fcd30c3c 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ReiGridSynchronizer.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ReiGridSynchronizer.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.AbstractGridSynchronizer; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridSynchronizer; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ReiProxy.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ReiProxy.java similarity index 88% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ReiProxy.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ReiProxy.java index c4595058d..444926a43 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ReiProxy.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ReiProxy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ResourceFocusedStackProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java similarity index 77% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ResourceFocusedStackProvider.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java index 20d95e041..e1d68f656 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ResourceFocusedStackProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceFocusedStackProvider.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import dev.architectury.event.CompoundEventResult; import me.shedaniel.math.Point; @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class ResourceFocusedStackProvider implements FocusedStackProvider { +class ResourceFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public ResourceFocusedStackProvider(final IngredientConverter converter) { + ResourceFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ResourceIngredientConverter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java similarity index 76% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ResourceIngredientConverter.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java index 518941d07..4e6debd8c 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/ResourceIngredientConverter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/ResourceIngredientConverter.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; @@ -12,7 +12,7 @@ import me.shedaniel.rei.api.common.util.EntryStacks; import net.minecraft.world.item.ItemStack; -public class ResourceIngredientConverter implements IngredientConverter { +class ResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { if (ingredient instanceof FluidStack fluidStack) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/package-info.java new file mode 100644 index 000000000..54b746da3 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei; + +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/render/entity/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/entity/package-info.java deleted file mode 100644 index e3c2297a8..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/entity/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.render.entity; - -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/render/model/baked/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/package-info.java deleted file mode 100644 index 4590fd75b..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked; - -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/render/model/baked/transform/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/package-info.java deleted file mode 100644 index de4685a33..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform; - -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/render/model/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/package-info.java deleted file mode 100644 index 95ba54b5a..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.render.model; - -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/render/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/package-info.java deleted file mode 100644 index a293ce12d..000000000 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.fabric.render; - -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/internal/storage/StorageExtractableStorage.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageExtractableStorage.java similarity index 74% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/StorageExtractableStorage.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageExtractableStorage.java index 641df5751..d5f1f3b25 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/StorageExtractableStorage.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageExtractableStorage.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.storage; +package com.refinedmods.refinedstorage2.platform.fabric.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; import java.util.function.Function; @@ -15,18 +15,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageExtractableStorage implements ExtractableStorage { +public class FabricStorageExtractableStorage implements ExtractableStorage { private final BlockApiCache, Direction> cache; private final Function toPlatformMapper; private final Direction direction; private final AmountOverride amountOverride; - public StorageExtractableStorage(final BlockApiLookup, Direction> lookup, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction, - final AmountOverride amountOverride) { + public FabricStorageExtractableStorage(final BlockApiLookup, Direction> lookup, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction, + final AmountOverride amountOverride) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.toPlatformMapper = toPlatformMapper; this.direction = direction; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/StorageInsertableStorage.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageInsertableStorage.java similarity index 74% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/StorageInsertableStorage.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageInsertableStorage.java index ad4e95df2..e9bbcf948 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/StorageInsertableStorage.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageInsertableStorage.java @@ -1,9 +1,9 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.storage; +package com.refinedmods.refinedstorage2.platform.fabric.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; import java.util.function.Function; @@ -15,18 +15,18 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StorageInsertableStorage implements InsertableStorage { +public class FabricStorageInsertableStorage implements InsertableStorage { private final BlockApiCache, Direction> cache; private final Function toPlatformMapper; private final Direction direction; private final AmountOverride amountOverride; - public StorageInsertableStorage(final BlockApiLookup, Direction> lookup, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction, - final AmountOverride amountOverride) { + public FabricStorageInsertableStorage(final BlockApiLookup, Direction> lookup, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction, + final AmountOverride amountOverride) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.toPlatformMapper = toPlatformMapper; this.direction = direction; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/FabricStorageUtil.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageUtil.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/FabricStorageUtil.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageUtil.java index 61aa45b6d..e253caa2c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/FabricStorageUtil.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/FabricStorageUtil.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.storage; +package com.refinedmods.refinedstorage2.platform.fabric.storage; import net.fabricmc.fabric.api.transfer.v1.storage.Storage; import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/DiskDriveBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java similarity index 85% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/DiskDriveBakedModel.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java index 039a3351a..69fc70142 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/DiskDriveBakedModel.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBakedModel.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked; +package com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageState; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageStorageState; -import com.refinedmods.refinedstorage2.platform.common.block.DiskDriveBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; -import com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform.QuadRotator; -import com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform.QuadTranslator; +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.support.render.QuadRotator; +import com.refinedmods.refinedstorage2.platform.fabric.support.render.QuadTranslator; import java.util.EnumMap; import java.util.Map; @@ -24,7 +24,7 @@ import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.block.state.BlockState; -public class DiskDriveBakedModel extends ForwardingBakedModel { +class DiskDriveBakedModel extends ForwardingBakedModel { private static final QuadTranslator[] TRANSLATORS = new QuadTranslator[8]; private static final Map ROTATORS = new EnumMap<>(BiDirection.class); @@ -48,9 +48,9 @@ public class DiskDriveBakedModel extends ForwardingBakedModel { private final BakedModel diskModel; private final BakedModel diskInactiveModel; - public DiskDriveBakedModel(final BakedModel baseModel, - final BakedModel diskModel, - final BakedModel diskInactiveModel) { + DiskDriveBakedModel(final BakedModel baseModel, + final BakedModel diskModel, + final BakedModel diskInactiveModel) { this.wrapped = baseModel; this.diskModel = diskModel; this.diskInactiveModel = diskInactiveModel; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/entity/DiskDriveBlockEntityRendererImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java similarity index 78% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/entity/DiskDriveBlockEntityRendererImpl.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java index 68c9ac3ce..b19d5faad 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/entity/DiskDriveBlockEntityRendererImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.entity; +package com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageState; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.render.entity.AbstractDiskDriveBlockEntityRenderer; -import com.refinedmods.refinedstorage2.platform.fabric.block.entity.FabricDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntityRenderer; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveUnbakedModel.java similarity index 92% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveUnbakedModel.java index 21cb2df54..176c7fa6c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/DiskDriveUnbakedModel.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/DiskDriveUnbakedModel.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model; - -import com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.DiskDriveBakedModel; +package com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive; import java.util.Collection; import java.util.Objects; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/block/entity/FabricDiskDriveBlockEntity.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java similarity index 75% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/block/entity/FabricDiskDriveBlockEntity.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java index 6b0f2825e..99903d92d 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/block/entity/FabricDiskDriveBlockEntity.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/FabricDiskDriveBlockEntity.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.block.entity; +package com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/package-info.java new file mode 100644 index 000000000..a2af34b2c --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/diskdrive/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.storage.diskdrive; + +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/internal/network/node/externalstorage/StorageExternalStorageProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java similarity index 67% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/StorageExternalStorageProvider.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java index d78223cf2..442949035 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/StorageExternalStorageProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStorageExternalStorageProvider.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.fabric.internal.storage.StorageExtractableStorage; -import com.refinedmods.refinedstorage2.platform.fabric.internal.storage.StorageInsertableStorage; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageExtractableStorage; +import com.refinedmods.refinedstorage2.platform.fabric.storage.FabricStorageInsertableStorage; import java.util.Collections; import java.util.Iterator; @@ -23,22 +23,22 @@ import static com.google.common.collect.Iterators.filter; import static com.google.common.collect.Iterators.transform; -public class StorageExternalStorageProvider implements ExternalStorageProvider { +class FabricStorageExternalStorageProvider implements ExternalStorageProvider { private final BlockApiCache, Direction> cache; private final Function fromPlatformMapper; - private final StorageExtractableStorage extractTarget; - private final StorageInsertableStorage insertTarget; + private final FabricStorageExtractableStorage extractTarget; + private final FabricStorageInsertableStorage insertTarget; private final Direction direction; - public StorageExternalStorageProvider(final BlockApiLookup, Direction> lookup, - final Function fromPlatformMapper, - final Function toPlatformMapper, - final ServerLevel serverLevel, - final BlockPos pos, - final Direction direction) { + FabricStorageExternalStorageProvider(final BlockApiLookup, Direction> lookup, + final Function fromPlatformMapper, + final Function toPlatformMapper, + final ServerLevel serverLevel, + final BlockPos pos, + final Direction direction) { this.cache = BlockApiCache.create(lookup, serverLevel, pos); this.fromPlatformMapper = fromPlatformMapper; - this.extractTarget = new StorageExtractableStorage<>( + this.extractTarget = new FabricStorageExtractableStorage<>( lookup, toPlatformMapper, serverLevel, @@ -46,7 +46,7 @@ public StorageExternalStorageProvider(final BlockApiLookup, Direction direction, AmountOverride.NONE ); - this.insertTarget = new StorageInsertableStorage<>( + this.insertTarget = new FabricStorageInsertableStorage<>( lookup, toPlatformMapper, serverLevel, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/StoragePlatformExternalStorageProviderFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java similarity index 63% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/StoragePlatformExternalStorageProviderFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java index 520b560b8..658d676dd 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/externalstorage/StoragePlatformExternalStorageProviderFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/FabricStoragePlatformExternalStorageProviderFactory.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; import java.util.Optional; import java.util.function.Function; @@ -13,16 +13,17 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; -public class StoragePlatformExternalStorageProviderFactory implements PlatformExternalStorageProviderFactory { +public class FabricStoragePlatformExternalStorageProviderFactory + implements PlatformExternalStorageProviderFactory { private final StorageChannelType theStorageChannelType; private final BlockApiLookup, Direction> lookup; private final Function fromPlatformMapper; private final Function toPlatformMapper; - public StoragePlatformExternalStorageProviderFactory(final StorageChannelType storageChannelType, - final BlockApiLookup, Direction> lookup, - final Function fromPlatformMapper, - final Function toPlatformMapper) { + public FabricStoragePlatformExternalStorageProviderFactory(final StorageChannelType storageChannelType, + final BlockApiLookup, Direction> lookup, + final Function fromPlatformMapper, + final Function toPlatformMapper) { this.theStorageChannelType = storageChannelType; this.lookup = lookup; this.fromPlatformMapper = fromPlatformMapper; @@ -38,7 +39,7 @@ public Optional> create(final ServerLevel level, if (storageChannelType != theStorageChannelType) { return Optional.empty(); } - return Optional.of((ExternalStorageProvider) new StorageExternalStorageProvider<>( + return Optional.of((ExternalStorageProvider) new FabricStorageExternalStorageProvider<>( lookup, fromPlatformMapper, toPlatformMapper, diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/package-info.java new file mode 100644 index 000000000..45aebfffc --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/externalstorage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.storage.externalstorage; + +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/storage/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/package-info.java new file mode 100644 index 000000000..a7a6f90d6 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/storage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.storage; + +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/containermenu/ContainerTransferDestination.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/ContainerTransferDestination.java similarity index 85% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/containermenu/ContainerTransferDestination.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/ContainerTransferDestination.java index 38af9e26c..2baa0cc84 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/containermenu/ContainerTransferDestination.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/ContainerTransferDestination.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.containermenu; +package com.refinedmods.refinedstorage2.platform.fabric.support.containermenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferDestination; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferDestination; import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java similarity index 75% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java index 57db09ff0..5b4cb22d7 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/FabricExtendedMenuProviderAdapter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/FabricExtendedMenuProviderAdapter.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.menu; +package com.refinedmods.refinedstorage2.platform.fabric.support.containermenu; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; import javax.annotation.Nullable; @@ -12,10 +12,10 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -public class FabricExtendedMenuProviderAdapter implements ExtendedScreenHandlerFactory { +class FabricExtendedMenuProviderAdapter implements ExtendedScreenHandlerFactory { private final ExtendedMenuProvider extendedMenuProvider; - public FabricExtendedMenuProviderAdapter(final ExtendedMenuProvider extendedMenuProvider) { + FabricExtendedMenuProviderAdapter(final ExtendedMenuProvider extendedMenuProvider) { this.extendedMenuProvider = extendedMenuProvider; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/MenuOpenerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/MenuOpenerImpl.java similarity index 64% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/MenuOpenerImpl.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/MenuOpenerImpl.java index 6c8c2851e..0f4c5f790 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/menu/MenuOpenerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/MenuOpenerImpl.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.menu; +package com.refinedmods.refinedstorage2.platform.fabric.support.containermenu; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; -import com.refinedmods.refinedstorage2.platform.common.menu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.MenuProvider; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/package-info.java new file mode 100644 index 000000000..eb5ed88eb --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/containermenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.support.containermenu; + +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/internal/energy/EnergyStorageAdapter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/energy/EnergyStorageAdapter.java similarity index 96% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/energy/EnergyStorageAdapter.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/energy/EnergyStorageAdapter.java index 4441d5559..2d51867f3 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/energy/EnergyStorageAdapter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/energy/EnergyStorageAdapter.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.energy; +package com.refinedmods.refinedstorage2.platform.fabric.support.energy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/energy/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/energy/package-info.java new file mode 100644 index 000000000..0daf46400 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.support.energy; + +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/integration/trinkets/TrinketsSlotReference.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReference.java similarity index 73% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReference.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReference.java index 9eafb71b1..dfdf8fe4e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReference.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.trinkets; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import java.util.Optional; @@ -10,12 +10,12 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -public class TrinketsSlotReference implements SlotReference { +class TrinketsSlotReference implements SlotReference { private final String groupName; private final String slotName; private final int index; - public TrinketsSlotReference(final String groupName, final String slotName, final int index) { + TrinketsSlotReference(final String groupName, final String slotName, final int index) { this.groupName = groupName; this.slotName = slotName; this.index = index; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReferenceFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceFactory.java similarity index 61% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReferenceFactory.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceFactory.java index 54f3aed7c..074058223 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReferenceFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.trinkets; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import net.minecraft.network.FriendlyByteBuf; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReferenceProvider.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceProvider.java similarity index 84% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReferenceProvider.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceProvider.java index 515659b10..8e8f27cac 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/trinkets/TrinketsSlotReferenceProvider.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/TrinketsSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.trinkets; +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.Collections; import java.util.List; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/package-info.java new file mode 100644 index 000000000..557bcaf20 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/network/bounditem/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.support.network.bounditem; + +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/render/model/baked/EmissiveBakedModel.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java similarity index 82% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/EmissiveBakedModel.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java index dd7aeb7d9..ee1845579 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/EmissiveBakedModel.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveBakedModel.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked; - -import com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform.EmissiveTransform; +package com.refinedmods.refinedstorage2.platform.fabric.support.render; import java.util.function.Supplier; @@ -14,10 +12,10 @@ import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.block.state.BlockState; -public class EmissiveBakedModel extends ForwardingBakedModel { +class EmissiveBakedModel extends ForwardingBakedModel { private final EmissiveTransform transform; - public EmissiveBakedModel(final BakedModel wrapped, final ResourceLocation emissiveSprite) { + EmissiveBakedModel(final BakedModel wrapped, final ResourceLocation emissiveSprite) { this.wrapped = wrapped; this.transform = new EmissiveTransform(emissiveSprite); } @@ -31,7 +29,6 @@ public void emitBlockQuads(final BlockAndTintGetter blockView, context.pushTransform(transform); wrapped.emitBlockQuads(blockView, state, pos, randomSupplier, context); context.popTransform(); - } @Override diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveModelRegistry.java similarity index 90% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveModelRegistry.java index 0e45068b4..1087b13ae 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/EmissiveModelRegistry.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveModelRegistry.java @@ -1,6 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model; - -import com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.EmissiveBakedModel; +package com.refinedmods.refinedstorage2.platform.fabric.support.render; import java.util.HashMap; import java.util.Map; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java similarity index 87% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java index d5599cb5a..69a7cad1e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/EmissiveTransform.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/EmissiveTransform.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform; +package com.refinedmods.refinedstorage2.platform.fabric.support.render; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.model.SpriteFinder; @@ -9,10 +9,10 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.resources.ResourceLocation; -public class EmissiveTransform implements RenderContext.QuadTransform { +class EmissiveTransform implements RenderContext.QuadTransform { private final ResourceLocation emissiveSprite; - public EmissiveTransform(final ResourceLocation emissiveSprite) { + EmissiveTransform(final ResourceLocation emissiveSprite) { this.emissiveSprite = emissiveSprite; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/FluidVariantFluidRenderer.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/FluidVariantFluidRenderer.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/FluidVariantFluidRenderer.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/FluidVariantFluidRenderer.java index 85d9db524..063b62e4b 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/FluidVariantFluidRenderer.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/FluidVariantFluidRenderer.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render; +package com.refinedmods.refinedstorage2.platform.fabric.support.render; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.render.model.AbstractFluidRenderer; -import com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.common.support.render.AbstractFluidRenderer; +import com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil; import java.util.HashMap; import java.util.List; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadRotator.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/QuadRotator.java similarity index 92% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadRotator.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/QuadRotator.java index b6342c01f..ddad39f6b 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadRotator.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/QuadRotator.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform; +package com.refinedmods.refinedstorage2.platform.fabric.support.render; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadTranslator.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/QuadTranslator.java similarity index 89% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadTranslator.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/QuadTranslator.java index b8ae0df07..92731a2ec 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/render/model/baked/transform/QuadTranslator.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/QuadTranslator.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.render.model.baked.transform; +package com.refinedmods.refinedstorage2.platform.fabric.support.render; import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView; import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/package-info.java new file mode 100644 index 000000000..ce917d398 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/render/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.support.render; + +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/internal/storage/ResourceContainerFluidStorageAdapter.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/ResourceContainerFluidStorageAdapter.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/ResourceContainerFluidStorageAdapter.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/ResourceContainerFluidStorageAdapter.java index 1e1486889..24fdc375e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/storage/ResourceContainerFluidStorageAdapter.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/ResourceContainerFluidStorageAdapter.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.fabric.internal.storage; +package com.refinedmods.refinedstorage2.platform.fabric.support.resource; import com.refinedmods.refinedstorage2.api.core.Action; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.ArrayList; import java.util.Iterator; @@ -17,8 +17,8 @@ import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext; import net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.ofFluidVariant; -import static com.refinedmods.refinedstorage2.platform.fabric.util.VariantUtil.toFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.ofFluidVariant; +import static com.refinedmods.refinedstorage2.platform.fabric.support.resource.VariantUtil.toFluidVariant; public class ResourceContainerFluidStorageAdapter extends SnapshotParticipant implements Storage { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/VariantUtil.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/VariantUtil.java similarity index 77% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/VariantUtil.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/VariantUtil.java index 11d567a3d..2713c50e9 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/VariantUtil.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/VariantUtil.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.fabric.util; +package com.refinedmods.refinedstorage2.platform.fabric.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/package-info.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/package-info.java new file mode 100644 index 000000000..5aef742c2 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.fabric.support.resource; + +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/util/SingleStackStorageImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/SimpleSingleStackStorage.java similarity index 63% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/SingleStackStorageImpl.java rename to refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/SimpleSingleStackStorage.java index 34289db78..b0a59cd71 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/SingleStackStorageImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/util/SimpleSingleStackStorage.java @@ -4,15 +4,15 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -public final class SingleStackStorageImpl extends SingleStackStorage { +public final class SimpleSingleStackStorage extends SingleStackStorage { private ItemStack stack; - public SingleStackStorageImpl(final ItemStack stack) { + public SimpleSingleStackStorage(final ItemStack stack) { this.stack = stack; } - public static SingleStackStorageImpl forEmptyBucket() { - return new SingleStackStorageImpl(new ItemStack(Items.BUCKET)); + public static SimpleSingleStackStorage forEmptyBucket() { + return new SimpleSingleStackStorage(new ItemStack(Items.BUCKET)); } @Override diff --git a/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json b/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json index db29ddc6a..8b04bc9c4 100644 --- a/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json +++ b/refinedstorage2-platform-fabric/src/main/resources/fabric.mod.json @@ -23,13 +23,13 @@ "com.refinedmods.refinedstorage2.platform.fabric.ClientModInitializerImpl" ], "modmenu": [ - "com.refinedmods.refinedstorage2.platform.fabric.integration.ModMenuIntegration" + "com.refinedmods.refinedstorage2.platform.fabric.modmenu.ModMenuApiImpl" ], "jei_mod_plugin": [ - "com.refinedmods.refinedstorage2.platform.common.integration.recipemod.jei.RefinedStorageJeiModPlugin" + "com.refinedmods.refinedstorage2.platform.common.recipemod.jei.RefinedStorageJeiModPlugin" ], "rei_client": [ - "com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei.RefinedStorageREIClientPlugin" + "com.refinedmods.refinedstorage2.platform.fabric.recipemod.rei.RefinedStorageREIClientPlugin" ] }, "custom": { 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 49d796b16..bfa2b0263 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 @@ -1,26 +1,28 @@ package com.refinedmods.refinedstorage2.platform.forge; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; -import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.upgrade.AbstractUpgradeItem; 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.Items; import com.refinedmods.refinedstorage2.platform.common.content.KeyMappings; -import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.render.NetworkItemItemPropertyFunction; -import com.refinedmods.refinedstorage2.platform.common.render.entity.StorageMonitorBlockEntityRenderer; -import com.refinedmods.refinedstorage2.platform.common.render.model.ControllerModelPredicateProvider; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.CompositeClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.HelpClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.ResourceClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.common.screen.tooltip.UpgradeDestinationClientTooltipComponent; -import com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei.RefinedStorageREIClientPlugin; -import com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei.ReiGridSynchronizer; -import com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei.ReiProxy; -import com.refinedmods.refinedstorage2.platform.forge.render.entity.DiskDriveBlockEntityRendererImpl; -import com.refinedmods.refinedstorage2.platform.forge.render.model.DiskDriveGeometryLoader; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerModelPredicateProvider; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItemPropertyFunction; +import com.refinedmods.refinedstorage2.platform.common.storagemonitor.StorageMonitorBlockEntityRenderer; +import com.refinedmods.refinedstorage2.platform.common.support.network.bounditem.NetworkBoundItemItemPropertyFunction; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.CompositeClientTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.support.tooltip.HelpClientTooltipComponent; +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.forge.recipemod.rei.RefinedStorageREIClientPlugin; +import com.refinedmods.refinedstorage2.platform.forge.recipemod.rei.ReiGridSynchronizer; +import com.refinedmods.refinedstorage2.platform.forge.recipemod.rei.ReiProxy; +import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.DiskDriveBlockEntityRendererImpl; +import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.DiskDriveGeometryLoader; import java.util.List; @@ -208,13 +210,23 @@ private static CompositeClientTooltipComponent createRegulatorUpgradeClientT private static void registerItemProperties() { ItemProperties.register( Items.INSTANCE.getWirelessGrid(), - NetworkItemItemPropertyFunction.NAME, - new NetworkItemItemPropertyFunction() + NetworkBoundItemItemPropertyFunction.NAME, + new NetworkBoundItemItemPropertyFunction() ); ItemProperties.register( Items.INSTANCE.getCreativeWirelessGrid(), - NetworkItemItemPropertyFunction.NAME, - new NetworkItemItemPropertyFunction() + NetworkBoundItemItemPropertyFunction.NAME, + new NetworkBoundItemItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getConfigurationCard(), + ConfigurationCardItemPropertyFunction.NAME, + new ConfigurationCardItemPropertyFunction() + ); + ItemProperties.register( + Items.INSTANCE.getNetworkCard(), + NetworkCardItemPropertyFunction.NAME, + new NetworkCardItemPropertyFunction() ); } } 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 782b8fd36..d7a1309fa 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 @@ -3,9 +3,9 @@ import com.refinedmods.refinedstorage2.api.grid.view.GridSortingDirection; import com.refinedmods.refinedstorage2.platform.common.Config; import com.refinedmods.refinedstorage2.platform.common.content.DefaultEnergyUsage; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.CraftingGridMatrixCloseBehavior; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSize; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.GridSortingTypes; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridMatrixCloseBehavior; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSize; +import com.refinedmods.refinedstorage2.platform.common.grid.GridSortingTypes; import java.util.Optional; @@ -36,6 +36,8 @@ public class ConfigImpl implements Config { private final WirelessGridEntry wirelessGrid; private final WirelessTransmitterEntry wirelessTransmitter; private final SimpleEnergyUsageEntry storageMonitor; + private final SimpleEnergyUsageEntry networkReceiver; + private final SimpleEnergyUsageEntry networkTransmitter; public ConfigImpl() { cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE); @@ -64,6 +66,16 @@ public ConfigImpl() { "Storage Monitor", DefaultEnergyUsage.STORAGE_MONITOR ); + networkReceiver = new SimpleEnergyUsageEntryImpl( + "networkReceiver", + "Network Receiver", + DefaultEnergyUsage.NETWORK_RECEIVER + ); + networkTransmitter = new SimpleEnergyUsageEntryImpl( + "networkTransmitter", + "Network Transmitter", + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); spec = builder.build(); } @@ -161,6 +173,16 @@ public SimpleEnergyUsageEntry getStorageMonitor() { return storageMonitor; } + @Override + public SimpleEnergyUsageEntry getNetworkReceiver() { + return networkReceiver; + } + + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { private final ForgeConfigSpec.LongValue energyUsage; 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 3ebba0e32..d7babe29a 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 @@ -2,39 +2,40 @@ import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.blockentity.EnergyBlockEntity; -import com.refinedmods.refinedstorage2.platform.api.item.EnergyItem; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyBlockEntity; +import com.refinedmods.refinedstorage2.platform.api.support.energy.EnergyItem; import com.refinedmods.refinedstorage2.platform.common.AbstractModInitializer; -import com.refinedmods.refinedstorage2.platform.common.block.AbstractBaseBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.PlatformProxy; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntityTypeFactory; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.CreativeModeTabItems; import com.refinedmods.refinedstorage2.platform.common.content.DirectRegistryCallback; import com.refinedmods.refinedstorage2.platform.common.content.MenuTypeFactory; import com.refinedmods.refinedstorage2.platform.common.content.RegistryCallback; -import com.refinedmods.refinedstorage2.platform.common.internal.network.node.iface.externalstorage.InterfacePlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; -import com.refinedmods.refinedstorage2.platform.common.item.WirelessGridItem; +import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridItem; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.iface.InterfacePlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseBlock; +import com.refinedmods.refinedstorage2.platform.common.upgrade.RegulatorUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil; -import com.refinedmods.refinedstorage2.platform.common.util.TickHandler; -import com.refinedmods.refinedstorage2.platform.forge.block.entity.ForgeDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.forge.integration.curios.CuriosSlotReferenceFactory; -import com.refinedmods.refinedstorage2.platform.forge.integration.curios.CuriosSlotReferenceProvider; -import com.refinedmods.refinedstorage2.platform.forge.internal.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.FluidGridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.FluidGridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.ItemGridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.ItemGridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.exporter.FluidHandlerExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.exporter.ItemHandlerExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage.FluidHandlerPlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage.ItemHandlerPlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer.FluidHandlerImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer.ItemHandlerImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ResourceContainerFluidHandlerAdapter; +import com.refinedmods.refinedstorage2.platform.common.util.ServerEventQueue; +import com.refinedmods.refinedstorage2.platform.forge.exporter.FluidHandlerExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.forge.exporter.ItemHandlerExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.forge.externalstorage.FluidHandlerPlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.forge.externalstorage.ItemHandlerPlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.forge.grid.strategy.FluidGridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.forge.grid.strategy.FluidGridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.forge.grid.strategy.ItemGridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.forge.grid.strategy.ItemGridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.forge.importer.FluidHandlerImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.forge.importer.ItemHandlerImporterTransferStrategyFactory; import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; +import com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive.ForgeDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.forge.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem.CuriosSlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem.CuriosSlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.forge.support.resource.ResourceContainerFluidHandlerAdapter; import java.util.Arrays; import java.util.HashSet; @@ -56,6 +57,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; @@ -102,7 +104,7 @@ public class ModInitializer extends AbstractModInitializer { DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, IdentifierUtil.MOD_ID); public ModInitializer() { - initializePlatform(new PlatformImpl(new NetworkManager())); + PlatformProxy.loadPlatform(new PlatformImpl(new NetworkManager())); initializePlatformApi(); registerAdditionalGridInsertionStrategyFactories(); registerGridExtractionStrategyFactories(); @@ -289,20 +291,21 @@ public void onRegister(final RegisterEvent e) { @SubscribeEvent public void registerWrenchingEvent(final PlayerInteractEvent.RightClickBlock e) { - final BlockState state = e.getLevel().getBlockState(e.getHitVec().getBlockPos()); - - AbstractBaseBlock.tryUseWrench(state, e.getLevel(), e.getHitVec(), e.getEntity(), e.getHand()) - .or(() -> AbstractBaseBlock.tryUpdateColor( - state, - e.getLevel(), - e.getHitVec().getBlockPos(), - e.getEntity(), - e.getHand() - )) - .ifPresent(result -> { - e.setCanceled(true); - e.setCancellationResult(result); - }); + final Level level = e.getLevel(); + final BlockState state = level.getBlockState(e.getHitVec().getBlockPos()); + if (!(state.getBlock() instanceof AbstractBaseBlock block)) { + return; + } + block.tryUseWrench(state, level, e.getHitVec(), e.getEntity(), e.getHand()).or(() -> block.tryUpdateColor( + state, + level, + e.getHitVec().getBlockPos(), + e.getEntity(), + e.getHand() + )).ifPresent(result -> { + e.setCanceled(true); + e.setCancellationResult(result); + }); } @SubscribeEvent @@ -398,7 +401,7 @@ public LazyOptional getCapability(final Capability cap, @SubscribeEvent public void onServerTick(final TickEvent.ServerTickEvent e) { if (e.phase == TickEvent.Phase.START) { - TickHandler.runQueuedActions(); + ServerEventQueue.runQueuedActions(); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java index 29213daac..f9b5af568 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/PlatformImpl.java @@ -4,24 +4,22 @@ import com.refinedmods.refinedstorage2.api.grid.view.GridResourceFactory; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.common.AbstractPlatform; import com.refinedmods.refinedstorage2.platform.common.Config; -import com.refinedmods.refinedstorage2.platform.common.ContainedFluid; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferManager; -import com.refinedmods.refinedstorage2.platform.common.util.BucketAmountFormatting; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferManager; import com.refinedmods.refinedstorage2.platform.common.util.CustomBlockPlaceContext; -import com.refinedmods.refinedstorage2.platform.forge.containermenu.ContainerTransferDestination; -import com.refinedmods.refinedstorage2.platform.forge.internal.energy.EnergyStorageAdapter; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.ItemGridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.view.ForgeFluidGridResourceFactory; -import com.refinedmods.refinedstorage2.platform.forge.internal.grid.view.ForgeItemGridResourceFactory; -import com.refinedmods.refinedstorage2.platform.forge.menu.MenuOpenerImpl; +import com.refinedmods.refinedstorage2.platform.forge.grid.strategy.ItemGridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.forge.grid.view.ForgeFluidGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.forge.grid.view.ForgeItemGridResourceFactory; import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; import com.refinedmods.refinedstorage2.platform.forge.packet.c2s.ClientToServerCommunicationsImpl; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.ServerToClientCommunicationsImpl; -import com.refinedmods.refinedstorage2.platform.forge.render.FluidStackFluidRenderer; +import com.refinedmods.refinedstorage2.platform.forge.support.containermenu.ContainerTransferDestination; +import com.refinedmods.refinedstorage2.platform.forge.support.containermenu.MenuOpenerImpl; +import com.refinedmods.refinedstorage2.platform.forge.support.energy.EnergyStorageAdapter; +import com.refinedmods.refinedstorage2.platform.forge.support.render.FluidStackFluidRenderer; import java.util.ArrayList; import java.util.List; @@ -82,8 +80,8 @@ import net.minecraftforge.items.wrapper.InvWrapper; import net.minecraftforge.registries.ForgeRegistries; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.ofFluidStack; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public final class PlatformImpl extends AbstractPlatform { private static final TagKey WRENCH_TAG = TagKey.create( @@ -98,7 +96,6 @@ public PlatformImpl(final NetworkManager networkManager) { new ServerToClientCommunicationsImpl(networkManager), new ClientToServerCommunicationsImpl(networkManager), new MenuOpenerImpl(), - new BucketAmountFormatting(FluidType.BUCKET_VOLUME), new FluidStackFluidRenderer(), ItemGridInsertionStrategy::new ); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/package-info.java deleted file mode 100644 index 7f72f478b..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.block.entity; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/package-info.java deleted file mode 100644 index 526d4e5d1..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.containermenu; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java index 3b4a672b7..c30c37371 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java @@ -1,8 +1,8 @@ package com.refinedmods.refinedstorage2.platform.forge.datagen; -import com.refinedmods.refinedstorage2.platform.common.block.grid.AbstractGridBlock; 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; @@ -12,6 +12,11 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; public class BlockModelProvider extends net.minecraftforge.client.model.generators.BlockModelProvider { + private static final ResourceLocation EMISSIVE_ALL_CUTOUT = createIdentifier("block/emissive_all_cutout"); + private static final ResourceLocation EMISSIVE_NORTH_CUTOUT = createIdentifier("block/emissive_north_cutout"); + private static final ResourceLocation NORTH_CUTOUT = createIdentifier("block/north_cutout"); + private static final ResourceLocation ALL_CUTOUT = createIdentifier("block/all_cutout"); + public BlockModelProvider(final PackOutput output, final ExistingFileHelper existingFileHelper) { super(output, MOD_ID, existingFileHelper); } @@ -24,6 +29,8 @@ protected void registerModels() { registerGrids(Blocks.INSTANCE.getCraftingGrid(), "crafting_grid"); registerDetectors(); registerWirelessTransmitters(); + registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -41,12 +48,11 @@ private void registerCables() { } private void registerControllers() { - final ResourceLocation base = createIdentifier("block/emissive_all_cutout"); final ResourceLocation off = createIdentifier("block/controller/off"); final ResourceLocation on = createIdentifier("block/controller/on"); Blocks.INSTANCE.getController().forEach((color, id, controller) -> { final ResourceLocation cutout = createIdentifier("block/controller/cutouts/" + color.getName()); - withExistingParent("block/controller/" + color.getName(), base) + withExistingParent("block/controller/" + color.getName(), EMISSIVE_ALL_CUTOUT) .texture("particle", off) .texture("all", on) .texture("cutout", cutout); @@ -59,7 +65,7 @@ private void registerGrids(final BlockColorMap> b registerEmissiveGrids(name, color.getName(), cutout); }); final ResourceLocation inactiveCutout = createIdentifier("block/" + name + "/cutouts/inactive"); - registerGrids(name, "inactive", inactiveCutout, createIdentifier("block/north_cutout")); + registerGrids(name, "inactive", inactiveCutout, NORTH_CUTOUT); } private void registerGrids(final String name, @@ -84,7 +90,7 @@ private void registerGrids(final String name, } private void registerEmissiveGrids(final String name, final String variantName, final ResourceLocation cutout) { - registerGrids(name, variantName, cutout, createIdentifier("block/emissive_north_cutout")); + registerGrids(name, variantName, cutout, EMISSIVE_NORTH_CUTOUT); } private void registerDetectors() { @@ -105,9 +111,43 @@ private void registerDetectors() { } private void registerWirelessTransmitters() { - final ResourceLocation parent = createIdentifier("block/wireless_transmitter/inactive"); - Blocks.INSTANCE.getWirelessTransmitter() - .forEach((color, id, block) -> withExistingParent("block/wireless_transmitter/" + color.getName(), parent) + final ResourceLocation parent = createIdentifier("block/wireless_transmitter/active"); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> + withExistingParent("block/wireless_transmitter/" + color.getName(), parent) .texture("cutout", createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()))); } + + private void registerNetworkReceivers() { + final ResourceLocation baseTexture = createIdentifier("block/network_receiver/base"); + Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, receiver) -> { + final ResourceLocation cutout = createIdentifier("block/network_receiver/cutouts/" + color.getName()); + withExistingParent("block/network_receiver/" + color.getName(), EMISSIVE_ALL_CUTOUT) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", cutout); + }); + withExistingParent("block/network_receiver/inactive", ALL_CUTOUT) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_receiver/cutouts/inactive")); + } + + private void registerNetworkTransmitters() { + final ResourceLocation baseTexture = createIdentifier("block/network_transmitter/base"); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, receiver) -> { + final ResourceLocation cutout = createIdentifier("block/network_transmitter/cutouts/" + color.getName()); + withExistingParent("block/network_transmitter/" + color.getName(), EMISSIVE_ALL_CUTOUT) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", cutout); + }); + withExistingParent("block/network_transmitter/inactive", ALL_CUTOUT) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_transmitter/cutouts/inactive")); + withExistingParent("block/network_transmitter/error", EMISSIVE_ALL_CUTOUT) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_transmitter/cutouts/error")); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java index 208e90ddd..4016e62a1 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java @@ -1,17 +1,19 @@ package com.refinedmods.refinedstorage2.platform.forge.datagen; -import com.refinedmods.refinedstorage2.platform.common.block.AbstractConstructorDestructorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.CableBlockSupport; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerEnergyType; -import com.refinedmods.refinedstorage2.platform.common.block.DetectorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.WirelessTransmitterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.direction.BiDirectionType; -import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionTypeImpl; -import com.refinedmods.refinedstorage2.platform.common.block.grid.AbstractGridBlock; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.AbstractConstructorDestructorBlock; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlock; +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.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.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlock; import java.util.EnumMap; import java.util.Map; @@ -61,6 +63,8 @@ protected void registerStatesAndModels() { registerWirelessTransmitters(); registerConstructorDestructors(Blocks.INSTANCE.getConstructor(), "constructor"); registerConstructorDestructors(Blocks.INSTANCE.getDestructor(), "destructor"); + registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -257,6 +261,40 @@ private ConfiguredModel[] registerDetector(final ModelFile unpowered, return model.build(); } + private void registerNetworkReceivers() { + final ModelFile inactive = modelFile(createIdentifier("block/network_receiver/inactive")); + Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> { + final var builder = getVariantBuilder(block.get()); + builder.forAllStates(blockState -> { + final ConfiguredModel.Builder model = ConfiguredModel.builder(); + if (Boolean.TRUE.equals(blockState.getValue(NetworkReceiverBlock.ACTIVE))) { + model.modelFile(modelFile(createIdentifier("block/network_receiver/" + color.getName()))); + } else { + model.modelFile(inactive); + } + return model.build(); + }); + }); + } + + private void registerNetworkTransmitters() { + final ModelFile inactive = modelFile(createIdentifier("block/network_transmitter/inactive")); + final ModelFile error = modelFile(createIdentifier("block/network_transmitter/error")); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> { + final var builder = getVariantBuilder(block.get()); + builder.forAllStates(blockState -> { + final ConfiguredModel.Builder model = ConfiguredModel.builder(); + switch (blockState.getValue(NetworkTransmitterBlock.STATE)) { + case ACTIVE -> + model.modelFile(modelFile(createIdentifier("block/network_transmitter/" + color.getName()))); + case ERROR -> model.modelFile(error); + case INACTIVE -> model.modelFile(inactive); + } + 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/ItemModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java index 67778356c..c7b4af6f0 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java @@ -1,19 +1,21 @@ package com.refinedmods.refinedstorage2.platform.forge.datagen; -import com.refinedmods.refinedstorage2.platform.common.block.CableBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ConstructorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ControllerBlock; -import com.refinedmods.refinedstorage2.platform.common.block.DestructorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.DetectorBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ExporterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ExternalStorageBlock; -import com.refinedmods.refinedstorage2.platform.common.block.ImporterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.WirelessTransmitterBlock; -import com.refinedmods.refinedstorage2.platform.common.block.grid.CraftingGridBlock; -import com.refinedmods.refinedstorage2.platform.common.block.grid.GridBlock; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.ConstructorBlock; +import com.refinedmods.refinedstorage2.platform.common.constructordestructor.DestructorBlock; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.ColorMap; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerBlock; +import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlock; +import com.refinedmods.refinedstorage2.platform.common.exporter.ExporterBlock; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridBlock; +import com.refinedmods.refinedstorage2.platform.common.grid.GridBlock; +import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.CableBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; +import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageBlock; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlock; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; @@ -24,6 +26,9 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; public class ItemModelProvider extends net.minecraftforge.client.model.generators.ItemModelProvider { + private static final String CUTOUT_TEXTURE_KEY = "cutout"; + private static final String CABLE_TEXTURE_KEY = "cable"; + public ItemModelProvider(final PackOutput output, final ExistingFileHelper existingFileHelper) { super(output, MOD_ID, existingFileHelper); } @@ -42,6 +47,8 @@ protected void registerModels() { registerConstructors(); registerDestructors(); registerWirelessTransmitters(); + registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -50,7 +57,7 @@ private void registerCables() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cable", + CABLE_TEXTURE_KEY, createIdentifier("block/cable/" + color.getName())) ); } @@ -61,7 +68,7 @@ private void registerExporters() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cable", + CABLE_TEXTURE_KEY, createIdentifier("block/cable/" + color.getName()) )); } @@ -72,7 +79,7 @@ private void registerImporters() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cable", + CABLE_TEXTURE_KEY, createIdentifier("block/cable/" + color.getName()) )); } @@ -83,7 +90,7 @@ private void registerExternalStorages() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cable", + CABLE_TEXTURE_KEY, createIdentifier("block/cable/" + color.getName()) )); } @@ -154,7 +161,7 @@ private void registerConstructors() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cable", + CABLE_TEXTURE_KEY, createIdentifier("block/cable/" + color.getName()) )); } @@ -165,7 +172,7 @@ private void registerDestructors() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cable", + CABLE_TEXTURE_KEY, createIdentifier("block/cable/" + color.getName()) )); } @@ -176,11 +183,33 @@ private void registerWirelessTransmitters() { blocks.forEach((color, id, block) -> singleTexture( id.getPath(), base, - "cutout", + CUTOUT_TEXTURE_KEY, createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()) )); } + private void registerNetworkReceivers() { + final ResourceLocation base = createIdentifier("block/network_receiver/inactive"); + final ColorMap blocks = Blocks.INSTANCE.getNetworkReceiver(); + blocks.forEach((color, id, block) -> singleTexture( + id.getPath(), + base, + CUTOUT_TEXTURE_KEY, + createIdentifier("block/network_receiver/cutouts/" + color.getName()) + )); + } + + private void registerNetworkTransmitters() { + final ResourceLocation base = createIdentifier("block/network_transmitter/inactive"); + final ColorMap blocks = Blocks.INSTANCE.getNetworkTransmitter(); + blocks.forEach((color, id, block) -> singleTexture( + id.getPath(), + base, + CUTOUT_TEXTURE_KEY, + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + )); + } + 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 799c7985d..f561592a7 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 @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.forge.datagen.loot; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; -import com.refinedmods.refinedstorage2.platform.common.loot.EnergyLootItemFunction; +import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyLootItemFunction; import java.util.ArrayList; import java.util.List; @@ -30,6 +30,8 @@ protected void generate() { Blocks.INSTANCE.getConstructor().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> dropSelf(block.get())); } @Override @@ -44,6 +46,8 @@ protected Iterable getKnownBlocks() { blocks.addAll(Blocks.INSTANCE.getConstructor().values()); blocks.addAll(Blocks.INSTANCE.getDestructor().values()); blocks.addAll(Blocks.INSTANCE.getWirelessTransmitter().values()); + blocks.addAll(Blocks.INSTANCE.getNetworkReceiver().values()); + blocks.addAll(Blocks.INSTANCE.getNetworkTransmitter().values()); return blocks; } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java index ac0f47cd3..609b24c38 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java @@ -10,9 +10,9 @@ public class LootTableProvider extends net.minecraft.data.loot.LootTableProvider { public LootTableProvider(final PackOutput output) { - super(output, Set.of(), List.of( - new SubProviderEntry(BlockDropProvider::new, - LootContextParamSet.builder().required(EXPLOSION_RADIUS).build()) + super(output, Set.of(), List.of(new SubProviderEntry( + BlockDropProvider::new, + LootContextParamSet.builder().required(EXPLOSION_RADIUS).build()) )); } 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 9d6cd3443..1e302bc06 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 @@ -57,6 +57,12 @@ protected void buildRecipes(final Consumer provider) { Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> recolorItems(Tags.WIRELESS_TRANSMITTERS, block.get().asItem(), color) .save(provider, createIdentifier("coloring/" + color.getName() + "_wireless_transmitter"))); + Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> + recolorItems(Tags.NETWORK_RECEIVERS, block.get().asItem(), color) + .save(provider, createIdentifier("coloring/" + color.getName() + "_network_receiver"))); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> + recolorItems(Tags.NETWORK_TRANSMITTERS, block.get().asItem(), color) + .save(provider, createIdentifier("coloring/" + color.getName() + "_network_transmitter"))); } private ShapelessRecipeBuilder recolorItems(final TagKey dyeable, final Item result, final DyeColor color) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java index 7cd840ee3..f93ae1e0b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java @@ -2,8 +2,8 @@ import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; +import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import java.util.Arrays; import java.util.Collection; @@ -31,6 +31,8 @@ import static com.refinedmods.refinedstorage2.platform.common.content.Tags.FLUID_STORAGE_DISKS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.GRIDS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.IMPORTERS; +import static com.refinedmods.refinedstorage2.platform.common.content.Tags.NETWORK_RECEIVERS; +import static com.refinedmods.refinedstorage2.platform.common.content.Tags.NETWORK_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.STORAGE_DISKS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.WIRELESS_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.MOD_ID; @@ -99,6 +101,14 @@ protected void addTags(final HolderLookup.Provider provider) { Blocks.INSTANCE.getWirelessTransmitter().values().stream() .map(block -> (Supplier) block::asItem) .toList()); + addAllToTag(NETWORK_RECEIVERS, + Blocks.INSTANCE.getNetworkReceiver().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); + addAllToTag(NETWORK_TRANSMITTERS, + Blocks.INSTANCE.getNetworkTransmitter().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/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/FluidHandlerExporterTransferStrategyFactory.java similarity index 72% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/FluidHandlerExporterTransferStrategyFactory.java index 98cb6752b..f56dd7a1d 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/FluidHandlerExporterTransferStrategyFactory.java @@ -1,18 +1,18 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.exporter; +package com.refinedmods.refinedstorage2.platform.forge.exporter; import com.refinedmods.refinedstorage2.api.network.impl.node.exporter.AbstractExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.network.node.AbstractFuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.FluidHandlerInsertableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinatesImpl; +import com.refinedmods.refinedstorage2.platform.common.exporter.AbstractFuzzyExporterTransferStrategy; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.FluidHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinatesImpl; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/ItemHandlerExporterTransferStrategyFactory.java similarity index 73% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/ItemHandlerExporterTransferStrategyFactory.java index c4fd6e416..69d9421dc 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/ItemHandlerExporterTransferStrategyFactory.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.exporter; +package com.refinedmods.refinedstorage2.platform.forge.exporter; import com.refinedmods.refinedstorage2.api.network.impl.node.exporter.AbstractExporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.exporter.ExporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.exporter.ExporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.network.node.AbstractFuzzyExporterTransferStrategy; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinatesImpl; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.common.exporter.AbstractFuzzyExporterTransferStrategy; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinatesImpl; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/package-info.java new file mode 100644 index 000000000..b6d6cf5d7 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/exporter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.exporter; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/FluidHandlerExternalStorageProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java similarity index 66% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/FluidHandlerExternalStorageProvider.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java index 5410da75d..c976243a3 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/FluidHandlerExternalStorageProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerExternalStorageProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.forge.externalstorage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -6,20 +6,20 @@ import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.FluidHandlerExtractableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.FluidHandlerInsertableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.forge.storage.FluidHandlerExtractableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.FluidHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; import java.util.Iterator; -public class FluidHandlerExternalStorageProvider implements ExternalStorageProvider { +class FluidHandlerExternalStorageProvider implements ExternalStorageProvider { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public FluidHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { + FluidHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new FluidHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new FluidHandlerExtractableStorage(interactionCoordinates, AmountOverride.NONE); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java similarity index 71% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java index 4caab3e4c..297ee315c 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/FluidHandlerPlatformExternalStorageProviderFactory.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.forge.externalstorage; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinatesImpl; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinatesImpl; import java.util.Optional; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/ItemHandlerExternalStorageProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java similarity index 66% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/ItemHandlerExternalStorageProvider.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java index 877f3dcff..0080daa6f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/ItemHandlerExternalStorageProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerExternalStorageProvider.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.forge.externalstorage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -6,20 +6,20 @@ import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerExtractableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; import java.util.Iterator; -public class ItemHandlerExternalStorageProvider implements ExternalStorageProvider { +class ItemHandlerExternalStorageProvider implements ExternalStorageProvider { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public ItemHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { + ItemHandlerExternalStorageProvider(final InteractionCoordinates interactionCoordinates) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new ItemHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new ItemHandlerExtractableStorage(interactionCoordinates, AmountOverride.NONE); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java similarity index 71% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java index 2e181684d..37da61f22 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/ItemHandlerPlatformExternalStorageProviderFactory.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage; +package com.refinedmods.refinedstorage2.platform.forge.externalstorage; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.api.storage.external.ExternalStorageProvider; -import com.refinedmods.refinedstorage2.platform.api.network.node.externalstorage.PlatformExternalStorageProviderFactory; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinatesImpl; +import com.refinedmods.refinedstorage2.platform.api.storage.externalstorage.PlatformExternalStorageProviderFactory; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinatesImpl; import java.util.Optional; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/package-info.java new file mode 100644 index 000000000..304720869 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/externalstorage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.externalstorage; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/CursorItemHandler.java similarity index 93% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/CursorItemHandler.java index 7ad3735a3..f20a35695 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/CursorStorage.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/CursorItemHandler.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import javax.annotation.Nonnull; @@ -7,10 +7,10 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -public class CursorStorage implements IItemHandler { +class CursorItemHandler implements IItemHandler { private final AbstractContainerMenu containerMenu; - public CursorStorage(final AbstractContainerMenu containerMenu) { + CursorItemHandler(final AbstractContainerMenu containerMenu) { this.containerMenu = containerMenu; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/FluidGridExtractionStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/FluidGridExtractionStrategy.java similarity index 90% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/FluidGridExtractionStrategy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/FluidGridExtractionStrategy.java index 16becd7e7..07a6ea211 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/FluidGridExtractionStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/FluidGridExtractionStrategy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; @@ -7,12 +7,12 @@ import com.refinedmods.refinedstorage2.api.storage.EmptyActor; import com.refinedmods.refinedstorage2.api.storage.Storage; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import javax.annotation.Nullable; @@ -26,8 +26,8 @@ import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.wrapper.PlayerMainInvWrapper; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public class FluidGridExtractionStrategy implements GridExtractionStrategy { private static final ItemResource BUCKET_ITEM_RESOURCE = new ItemResource(Items.BUCKET, null); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/FluidGridInsertionStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/FluidGridInsertionStrategy.java similarity index 80% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/FluidGridInsertionStrategy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/FluidGridInsertionStrategy.java index 18d394ed9..2c06a5603 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/FluidGridInsertionStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/FluidGridInsertionStrategy.java @@ -1,13 +1,13 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import javax.annotation.Nullable; @@ -18,9 +18,9 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandlerItem; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.ofFluidStack; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public class FluidGridInsertionStrategy implements GridInsertionStrategy { private final AbstractContainerMenu menu; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridExtractionStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java similarity index 68% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridExtractionStrategy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java index ccf65d8b9..0019988ab 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridExtractionStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridExtractionStrategy.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -20,14 +20,14 @@ public class ItemGridExtractionStrategy implements GridExtractionStrategy { private final GridOperations gridOperations; private final PlayerMainInvWrapper playerInventoryStorage; - private final CursorStorage playerCursorStorage; + private final CursorItemHandler playerCursorItemHandler; public ItemGridExtractionStrategy(final AbstractContainerMenu containerMenu, final Player player, final Grid grid) { this.gridOperations = grid.createOperations(StorageChannelTypes.ITEM, new PlayerActor(player)); this.playerInventoryStorage = new PlayerMainInvWrapper(player.getInventory()); - this.playerCursorStorage = new CursorStorage(containerMenu); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); } @Override @@ -36,7 +36,7 @@ public boolean onExtract(final PlatformStorageChannelType storageChannelT final GridExtractMode extractMode, final boolean cursor) { if (resource instanceof ItemResource itemResource) { - final IItemHandler handler = cursor ? playerCursorStorage : playerInventoryStorage; + final IItemHandler handler = cursor ? playerCursorItemHandler : playerInventoryStorage; gridOperations.extract( itemResource, extractMode, diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridInsertionStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java similarity index 75% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridInsertionStrategy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java index 90125ebf8..f2faa680b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridInsertionStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridInsertionStrategy.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerExtractableStorage; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -18,19 +18,19 @@ import net.minecraftforge.items.wrapper.InvWrapper; import net.minecraftforge.items.wrapper.RangedWrapper; -import static com.refinedmods.refinedstorage2.platform.api.resource.ItemResource.ofItemStack; +import static com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource.ofItemStack; public class ItemGridInsertionStrategy implements GridInsertionStrategy { private final AbstractContainerMenu containerMenu; private final GridOperations gridOperations; - private final CursorStorage playerCursorStorage; + private final CursorItemHandler playerCursorItemHandler; public ItemGridInsertionStrategy(final AbstractContainerMenu containerMenu, final Player player, final Grid grid) { this.containerMenu = containerMenu; this.gridOperations = grid.createOperations(StorageChannelTypes.ITEM, new PlayerActor(player)); - this.playerCursorStorage = new CursorStorage(containerMenu); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); } @Override @@ -44,7 +44,7 @@ public boolean onInsert(final GridInsertMode insertMode, final boolean tryAltern itemResource, insertMode, new ItemHandlerExtractableStorage( - InteractionCoordinates.ofItemHandler(playerCursorStorage), + InteractionCoordinates.ofItemHandler(playerCursorItemHandler), AmountOverride.NONE ) ); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridScrollingStrategy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java similarity index 79% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridScrollingStrategy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java index a0a4579fe..f8897e040 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/ItemGridScrollingStrategy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/ItemGridScrollingStrategy.java @@ -1,19 +1,19 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.api.grid.operations.GridOperations; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.PlayerActor; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerExtractableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; @@ -27,7 +27,7 @@ public class ItemGridScrollingStrategy implements GridScrollingStrategy { private final GridOperations gridOperations; private final Inventory playerInventory; private final PlayerMainInvWrapper playerInventoryStorage; - private final CursorStorage playerCursorStorage; + private final CursorItemHandler playerCursorItemHandler; public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, final Player player, @@ -35,7 +35,7 @@ public ItemGridScrollingStrategy(final AbstractContainerMenu containerMenu, this.gridOperations = grid.createOperations(StorageChannelTypes.ITEM, new PlayerActor(player)); this.playerInventory = player.getInventory(); this.playerInventoryStorage = new PlayerMainInvWrapper(playerInventory); - this.playerCursorStorage = new CursorStorage(containerMenu); + this.playerCursorItemHandler = new CursorItemHandler(containerMenu); } @Override @@ -50,7 +50,7 @@ public boolean onScroll(final PlatformStorageChannelType storageChannelTy switch (scrollMode) { case GRID_TO_INVENTORY -> handleGridToInventoryScroll(itemResource, playerStorage); case INVENTORY_TO_GRID -> handleInventoryToGridScroll(itemResource, playerStorage); - case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorStorage); + case GRID_TO_CURSOR -> handleGridToInventoryScroll(itemResource, playerCursorItemHandler); } return true; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/package-info.java new file mode 100644 index 000000000..a993a0085 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/strategy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.grid.strategy; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/ForgeFluidGridResourceFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/ForgeFluidGridResourceFactory.java similarity index 67% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/ForgeFluidGridResourceFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/ForgeFluidGridResourceFactory.java index 666acd7fe..ef83d4c66 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/ForgeFluidGridResourceFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/ForgeFluidGridResourceFactory.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.forge.grid.view; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.AbstractFluidGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.common.grid.view.AbstractFluidGridResourceFactory; import net.minecraftforge.fluids.FluidType; import net.minecraftforge.fml.ModList; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public class ForgeFluidGridResourceFactory extends AbstractFluidGridResourceFactory { @Override diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/ForgeItemGridResourceFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/ForgeItemGridResourceFactory.java similarity index 77% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/ForgeItemGridResourceFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/ForgeItemGridResourceFactory.java index 481321992..2b26546e8 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/ForgeItemGridResourceFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/ForgeItemGridResourceFactory.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.forge.grid.view; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.AbstractItemGridResourceFactory; +import com.refinedmods.refinedstorage2.platform.common.grid.view.AbstractItemGridResourceFactory; import java.util.Objects; import java.util.Optional; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/package-info.java new file mode 100644 index 000000000..9558fc998 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/grid/view/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.grid.view; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterSource.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java similarity index 63% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterSource.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java index 5a8c63d1a..38db50f8f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterSource.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterSource.java @@ -1,25 +1,25 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer; +package com.refinedmods.refinedstorage2.platform.forge.importer; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.FluidHandlerExtractableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.FluidHandlerInsertableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.forge.storage.FluidHandlerExtractableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.FluidHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; import java.util.Iterator; -public class FluidHandlerImporterSource implements ImporterSource { +class FluidHandlerImporterSource implements ImporterSource { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public FluidHandlerImporterSource(final InteractionCoordinates interactionCoordinates, - final AmountOverride amountOverride) { + FluidHandlerImporterSource(final InteractionCoordinates interactionCoordinates, + final AmountOverride amountOverride) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new FluidHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new FluidHandlerExtractableStorage(interactionCoordinates, amountOverride); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterTransferStrategyFactory.java similarity index 73% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterTransferStrategyFactory.java index c23b0a57e..2dfd7152f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/FluidHandlerImporterTransferStrategyFactory.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer; +package com.refinedmods.refinedstorage2.platform.forge.importer; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategyImpl; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinatesImpl; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinatesImpl; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterSource.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java similarity index 63% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterSource.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java index c1cef9f04..3f7f61b0f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterSource.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterSource.java @@ -1,25 +1,25 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer; +package com.refinedmods.refinedstorage2.platform.forge.importer; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinates; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerExtractableStorage; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.ItemHandlerInsertableStorage; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinates; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerExtractableStorage; +import com.refinedmods.refinedstorage2.platform.forge.storage.ItemHandlerInsertableStorage; import java.util.Iterator; -public class ItemHandlerImporterSource implements ImporterSource { +class ItemHandlerImporterSource implements ImporterSource { private final InteractionCoordinates interactionCoordinates; private final InsertableStorage insertTarget; private final ExtractableStorage extractTarget; - public ItemHandlerImporterSource(final InteractionCoordinates interactionCoordinates, - final AmountOverride amountOverride) { + ItemHandlerImporterSource(final InteractionCoordinates interactionCoordinates, + final AmountOverride amountOverride) { this.interactionCoordinates = interactionCoordinates; this.insertTarget = new ItemHandlerInsertableStorage(interactionCoordinates, AmountOverride.NONE); this.extractTarget = new ItemHandlerExtractableStorage(interactionCoordinates, amountOverride); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterTransferStrategyFactory.java similarity index 71% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterTransferStrategyFactory.java index d0091d49f..deefb2463 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/ItemHandlerImporterTransferStrategyFactory.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer; +package com.refinedmods.refinedstorage2.platform.forge.importer; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterSource; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategy; import com.refinedmods.refinedstorage2.api.network.node.importer.ImporterTransferStrategyImpl; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.network.node.importer.ImporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.importer.ImporterTransferStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.content.Items; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; -import com.refinedmods.refinedstorage2.platform.forge.internal.storage.InteractionCoordinatesImpl; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.forge.storage.InteractionCoordinatesImpl; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/package-info.java new file mode 100644 index 000000000..6ca708383 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/importer/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.importer; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/package-info.java deleted file mode 100644 index 9fa3e224b..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.integration.curios; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/package-info.java deleted file mode 100644 index ee57bb50f..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.integration; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/package-info.java deleted file mode 100644 index 59a81cce8..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/package-info.java deleted file mode 100644 index 79cff5cdb..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/package-info.java deleted file mode 100644 index 599227a34..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.grid; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/package-info.java deleted file mode 100644 index a2f9c5394..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/grid/view/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.grid.view; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/package-info.java deleted file mode 100644 index 6efda9a28..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.exporter; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/package-info.java deleted file mode 100644 index 419a7449c..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/externalstorage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.externalstorage; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/package-info.java deleted file mode 100644 index ef97578ad..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.network.node.importer; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/package-info.java deleted file mode 100644 index 2c9213700..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/menu/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/menu/package-info.java deleted file mode 100644 index a04ae9025..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/menu/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.menu; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java index c93624a61..90d63b97d 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java @@ -16,6 +16,7 @@ import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridClearPacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.NetworkTransmitterStatusPacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.StorageInfoResponsePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.WirelessTransmitterRangePacket; @@ -175,6 +176,13 @@ public NetworkManager() { UseNetworkBoundItemPacket::decode, UseNetworkBoundItemPacket::handle ); + handler.registerMessage( + id++, + NetworkTransmitterStatusPacket.class, + NetworkTransmitterStatusPacket::encode, + NetworkTransmitterStatusPacket::decode, + NetworkTransmitterStatusPacket::handle + ); } public void send(final ServerPlayer player, final Object message) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java index 75df46c38..e4139b303 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ClientToServerCommunicationsImpl.java @@ -4,11 +4,11 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyType; -import com.refinedmods.refinedstorage2.platform.common.packet.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.support.ClientToServerCommunications; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyType; import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; import java.util.List; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridClearPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridClearPacket.java index 559dbff80..ce1c0161b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridClearPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridClearPacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridRecipeTransferPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridRecipeTransferPacket.java index 88ff45f22..2916db592 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridRecipeTransferPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/CraftingGridRecipeTransferPacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.ArrayList; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridExtractPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridExtractPacket.java index 2a3d73130..27ab57c38 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridExtractPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridExtractPacket.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridInsertPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridInsertPacket.java index 628caf98b..244cd205a 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridInsertPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridInsertPacket.java @@ -1,7 +1,7 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; import com.refinedmods.refinedstorage2.api.grid.operations.GridInsertMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridInsertionStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridInsertionStrategy; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridScrollPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridScrollPacket.java index 941bfd7dc..44a8a7130 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridScrollPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/GridScrollPacket.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; -import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollingStrategy; +import com.refinedmods.refinedstorage2.platform.api.grid.strategy.GridScrollingStrategy; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/PropertyChangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/PropertyChangePacket.java index 13866cbda..199f204d8 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/PropertyChangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/PropertyChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceFilterSlotChangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceFilterSlotChangePacket.java index 2ca12f2fe..a46a439a9 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceFilterSlotChangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceFilterSlotChangePacket.java @@ -2,7 +2,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import java.util.Objects; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotAmountChangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotAmountChangePacket.java index 699831bef..9244a94f6 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotAmountChangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotAmountChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotChangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotChangePacket.java index d782daa85..f4766cc0f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotChangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/ResourceSlotChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/SingleAmountChangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/SingleAmountChangePacket.java index 12f94fb29..a7615cd73 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/SingleAmountChangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/SingleAmountChangePacket.java @@ -1,6 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractSingleAmountContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractSingleAmountContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java index 9eeb6fe31..f13e0139f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/c2s/UseNetworkBoundItemPacket.java @@ -1,9 +1,9 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.c2s; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.item.AbstractNetworkBoundEnergyItem; -import com.refinedmods.refinedstorage2.platform.api.item.NetworkBoundItemSession; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.energy.AbstractNetworkBoundEnergyItem; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.NetworkBoundItemSession; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ClientProxy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ClientProxy.java similarity index 67% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ClientProxy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ClientProxy.java index 966265f0d..af5d7ba85 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/util/ClientProxy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ClientProxy.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.common.util; +package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import java.util.Optional; import net.minecraft.client.Minecraft; import net.minecraft.world.entity.player.Player; -public final class ClientProxy { +final class ClientProxy { private ClientProxy() { } // This method exists to avoid classloading errors on LocalPlayer. - public static Optional getPlayer() { + static Optional getPlayer() { return Optional.ofNullable(Minecraft.getInstance().player); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java index 8afed8890..4dd6e0bce 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ControllerEnergyInfoPacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.common.controller.ControllerContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java index 01de33bf3..e0b5a0cd6 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridActivePacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import com.refinedmods.refinedstorage2.api.grid.GridWatcher; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java index 9eeda92dd..fd6664637 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridClearPacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java index d55cbe7c8..fcb25ae42 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/GridUpdatePacket.java @@ -3,8 +3,7 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.AbstractGridContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java new file mode 100644 index 000000000..400c4a751 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java @@ -0,0 +1,43 @@ +package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; + +import java.util.function.Supplier; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraftforge.network.NetworkEvent; + +public class NetworkTransmitterStatusPacket { + private final boolean error; + private final Component message; + + public NetworkTransmitterStatusPacket(final boolean error, final Component message) { + this.error = error; + this.message = message; + } + + public static NetworkTransmitterStatusPacket decode(final FriendlyByteBuf buf) { + return new NetworkTransmitterStatusPacket(buf.readBoolean(), buf.readComponent()); + } + + public static void encode(final NetworkTransmitterStatusPacket packet, final FriendlyByteBuf buf) { + buf.writeBoolean(packet.error); + buf.writeComponent(packet.message); + } + + public static void handle(final NetworkTransmitterStatusPacket packet, final Supplier ctx) { + ctx.get().enqueueWork(() -> ClientProxy.getPlayer().ifPresent(player -> handle(player, packet))); + ctx.get().setPacketHandled(true); + } + + private static void handle(final Player player, final NetworkTransmitterStatusPacket packet) { + final AbstractContainerMenu menu = player.containerMenu; + if (menu instanceof NetworkTransmitterContainerMenu containerMenu) { + containerMenu.setStatus(new NetworkTransmitterStatus(packet.error, packet.message)); + } + } +} diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java index 161c8ec3a..850bb7704 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ResourceSlotUpdatePacket.java @@ -1,10 +1,9 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; import java.util.function.Supplier; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java index e96402395..b825e0921 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java @@ -3,9 +3,10 @@ import com.refinedmods.refinedstorage2.api.storage.StorageInfo; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.packet.ServerToClientCommunications; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; +import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; import java.util.UUID; @@ -85,4 +86,9 @@ public void sendStorageInfoResponse(final ServerPlayer player, final StorageInfo storageInfo) { networkManager.send(player, new StorageInfoResponsePacket(id, storageInfo.stored(), storageInfo.capacity())); } + + @Override + public void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterStatus status) { + networkManager.send(player, new NetworkTransmitterStatusPacket(status.error(), status.message())); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java index c58f8a6ac..3886ec311 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/StorageInfoResponsePacket.java @@ -1,8 +1,7 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.ClientStorageRepository; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.common.storage.ClientStorageRepository; import java.util.UUID; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java index d751be18a..44ebeb71f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; -import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; +import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterContainerMenu; import java.util.function.Supplier; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/CraftingGridTransferHandler.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java similarity index 94% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/CraftingGridTransferHandler.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java index 5d4d6b534..57ceed741 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/CraftingGridTransferHandler.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/CraftingGridTransferHandler.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.api.resource.list.ResourceList; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.grid.CraftingGridContainerMenu; import java.awt.Color; import java.util.List; @@ -22,7 +22,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; -public class CraftingGridTransferHandler implements TransferHandler { +class CraftingGridTransferHandler implements TransferHandler { private static final Color MISSING_COLOR = new Color(1.0f, 0.0f, 0.0f, 0.4f); private static final CategoryIdentifier CRAFTING = CategoryIdentifier.of("minecraft", "plugins/crafting"); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/DraggableStackVisitorImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/DraggableStackVisitorImpl.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java index e864f80ab..58f4215b4 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/DraggableStackVisitorImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/DraggableStackVisitorImpl.java @@ -1,12 +1,12 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.common.Platform; -import com.refinedmods.refinedstorage2.platform.common.containermenu.AbstractResourceContainerMenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.ResourceSlot; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.AbstractResourceContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ResourceSlot; import java.util.ArrayList; import java.util.List; @@ -19,11 +19,11 @@ import me.shedaniel.rei.api.client.gui.drag.DraggingContext; import net.minecraft.client.gui.screens.Screen; -public class DraggableStackVisitorImpl +class DraggableStackVisitorImpl implements DraggableStackVisitor> { private final IngredientConverter ingredientConverter; - public DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { + DraggableStackVisitorImpl(final IngredientConverter ingredientConverter) { this.ingredientConverter = ingredientConverter; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ExclusionZonesProviderImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java similarity index 64% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ExclusionZonesProviderImpl.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java index d29c1eefb..d3b4cde20 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ExclusionZonesProviderImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ExclusionZonesProviderImpl.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import java.util.Collection; import java.util.stream.Collectors; @@ -8,7 +8,7 @@ import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.client.registry.screen.ExclusionZonesProvider; -public class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { +class ExclusionZonesProviderImpl implements ExclusionZonesProvider> { @Override public Collection provide(final AbstractBaseScreen screen) { return screen.getExclusionZones().stream() diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/GridFocusedStackProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java similarity index 72% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/GridFocusedStackProvider.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java index d58b0ec7c..0ed91efad 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/GridFocusedStackProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridFocusedStackProvider.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.api.grid.view.GridResource; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.grid.AbstractGridScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.screen.AbstractGridScreen; import dev.architectury.event.CompoundEventResult; import me.shedaniel.math.Point; @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class GridFocusedStackProvider implements FocusedStackProvider { +class GridFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public GridFocusedStackProvider(final IngredientConverter converter) { + GridFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/GridResourceIngredientConverter.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java similarity index 69% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/GridResourceIngredientConverter.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java index a7d29fdd1..e83e1b518 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/GridResourceIngredientConverter.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/GridResourceIngredientConverter.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.FluidGridResource; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.view.ItemGridResource; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.grid.view.FluidGridResource; +import com.refinedmods.refinedstorage2.platform.common.grid.view.ItemGridResource; import java.util.Optional; import dev.architectury.fluid.FluidStack; import me.shedaniel.rei.api.common.util.EntryStacks; -public class GridResourceIngredientConverter implements IngredientConverter { +class GridResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { return Optional.empty(); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/MissingIngredients.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java similarity index 61% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/MissingIngredients.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java index 4aea2a1f1..9f8f5a9f0 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/MissingIngredients.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/MissingIngredients.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import java.util.ArrayList; import java.util.List; @@ -7,24 +7,24 @@ import it.unimi.dsi.fastutil.ints.IntSet; import me.shedaniel.rei.api.common.entry.EntryIngredient; -public class MissingIngredients { +class MissingIngredients { private final List ingredients = new ArrayList<>(); private final IntSet indices = new IntOpenHashSet(); - public boolean isEmpty() { + boolean isEmpty() { return indices.isEmpty(); } - public void addIngredient(final EntryIngredient ingredient, final int slotIndex) { + void addIngredient(final EntryIngredient ingredient, final int slotIndex) { ingredients.add(ingredient); indices.add(slotIndex); } - public List getIngredients() { + List getIngredients() { return ingredients; } - public boolean isMissing(final int slotIndex) { + boolean isMissing(final int slotIndex) { return indices.contains(slotIndex); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java similarity index 88% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java index 95f94a182..55e345c93 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.block.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.ContentIds; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.Tags; -import com.refinedmods.refinedstorage2.platform.common.internal.item.EnergyItemHelperImpl; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.ColorableBlock; +import com.refinedmods.refinedstorage2.platform.common.support.energy.EnergyItemHelperImpl; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -87,6 +87,13 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) ContentIds.WIRELESS_TRANSMITTER, Tags.WIRELESS_TRANSMITTERS ); + groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS); + groupItems( + registry, + Blocks.INSTANCE.getNetworkTransmitter(), + ContentIds.NETWORK_TRANSMITTER, + Tags.NETWORK_TRANSMITTERS + ); } @Override diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ReiGridSynchronizer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ReiGridSynchronizer.java similarity index 89% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ReiGridSynchronizer.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ReiGridSynchronizer.java index 47043a7c0..e3cea565a 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ReiGridSynchronizer.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ReiGridSynchronizer.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; -import com.refinedmods.refinedstorage2.platform.common.internal.grid.AbstractGridSynchronizer; +import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridSynchronizer; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ReiProxy.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ReiProxy.java similarity index 88% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ReiProxy.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ReiProxy.java index 20ce8216a..9195e3df8 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ReiProxy.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ReiProxy.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import javax.annotation.Nullable; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ResourceFocusedStackProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java similarity index 77% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ResourceFocusedStackProvider.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java index c424fc3da..cb2e21ade 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ResourceFocusedStackProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceFocusedStackProvider.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; import dev.architectury.event.CompoundEventResult; import me.shedaniel.math.Point; @@ -10,10 +10,10 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.minecraft.client.gui.screens.Screen; -public class ResourceFocusedStackProvider implements FocusedStackProvider { +class ResourceFocusedStackProvider implements FocusedStackProvider { private final IngredientConverter converter; - public ResourceFocusedStackProvider(final IngredientConverter converter) { + ResourceFocusedStackProvider(final IngredientConverter converter) { this.converter = converter; } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ResourceIngredientConverter.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java similarity index 76% rename from refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ResourceIngredientConverter.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java index 38d302f15..ce2273584 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/ResourceIngredientConverter.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/ResourceIngredientConverter.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.fabric.integration.recipemod.rei; +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; import com.refinedmods.refinedstorage2.api.storage.ResourceTemplate; -import com.refinedmods.refinedstorage2.platform.api.integration.recipemod.IngredientConverter; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.recipemod.IngredientConverter; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import java.util.Optional; @@ -12,7 +12,7 @@ import me.shedaniel.rei.api.common.util.EntryStacks; import net.minecraft.world.item.ItemStack; -public class ResourceIngredientConverter implements IngredientConverter { +class ResourceIngredientConverter implements IngredientConverter { @Override public Optional> convertToResource(final Object ingredient) { if (ingredient instanceof FluidStack fluidStack) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/package-info.java new file mode 100644 index 000000000..a157b3201 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.recipemod.rei; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/entity/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/entity/package-info.java deleted file mode 100644 index dc054a6b7..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/entity/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.render.entity; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/package-info.java deleted file mode 100644 index d1971c8a0..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.render.model.baked; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/package-info.java deleted file mode 100644 index 56dc98908..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.render.model; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/package-info.java deleted file mode 100644 index d154d43d1..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.render; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/FluidHandlerExtractableStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/FluidHandlerExtractableStorage.java similarity index 72% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/FluidHandlerExtractableStorage.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/FluidHandlerExtractableStorage.java index 46c580072..ea15717c6 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/FluidHandlerExtractableStorage.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/FluidHandlerExtractableStorage.java @@ -1,15 +1,15 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import net.minecraftforge.fluids.FluidStack; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public class FluidHandlerExtractableStorage implements ExtractableStorage { private final InteractionCoordinates interactionCoordinates; @@ -27,7 +27,7 @@ public long extract(final FluidResource resource, final long amount, final Actio final long correctedAmount = amountOverride.overrideAmount( resource, amount, - () -> HandlerUtil.getCurrentAmount(fluidHandler, resource) + () -> ForgeHandlerUtil.getCurrentAmount(fluidHandler, resource) ); if (correctedAmount == 0) { return 0L; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/FluidHandlerInsertableStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/FluidHandlerInsertableStorage.java similarity index 77% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/FluidHandlerInsertableStorage.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/FluidHandlerInsertableStorage.java index ccad67f37..152f07317 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/FluidHandlerInsertableStorage.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/FluidHandlerInsertableStorage.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidAction; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidAction; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public class FluidHandlerInsertableStorage implements InsertableStorage { private final InteractionCoordinates interactionCoordinates; @@ -30,7 +30,7 @@ public long insert(final FluidResource resource, final long amount, final Action final long correctedAmount = amountOverride.overrideAmount( resource, amount, - () -> HandlerUtil.getCurrentAmount(fluidHandler, resource) + () -> ForgeHandlerUtil.getCurrentAmount(fluidHandler, resource) ); if (correctedAmount == 0) { return 0L; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/HandlerUtil.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ForgeHandlerUtil.java similarity index 76% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/HandlerUtil.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ForgeHandlerUtil.java index 2d78fa4d2..515b84658 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/HandlerUtil.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ForgeHandlerUtil.java @@ -1,16 +1,16 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import net.minecraft.world.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.items.IItemHandler; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.isSame; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.isSame; -final class HandlerUtil { - private HandlerUtil() { +final class ForgeHandlerUtil { + private ForgeHandlerUtil() { } static long getCurrentAmount(final IItemHandler itemHandler, final ItemStack stack) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/InteractionCoordinates.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/InteractionCoordinates.java similarity index 91% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/InteractionCoordinates.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/InteractionCoordinates.java index 796fcfc66..21b9690e9 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/InteractionCoordinates.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/InteractionCoordinates.java @@ -1,8 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import java.util.Collections; import java.util.Iterator; @@ -15,8 +15,8 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.items.IItemHandler; -import static com.refinedmods.refinedstorage2.platform.api.resource.ItemResource.ofItemStack; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource.ofItemStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.ofFluidStack; public interface InteractionCoordinates { default LazyOptional getItemHandler() { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/InteractionCoordinatesImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/InteractionCoordinatesImpl.java similarity index 95% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/InteractionCoordinatesImpl.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/InteractionCoordinatesImpl.java index b100db73b..fc22d8bc0 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/InteractionCoordinatesImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/InteractionCoordinatesImpl.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ItemHandlerExtractableStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ItemHandlerExtractableStorage.java similarity index 87% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ItemHandlerExtractableStorage.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ItemHandlerExtractableStorage.java index 8ac1b2116..8a362a8d7 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ItemHandlerExtractableStorage.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ItemHandlerExtractableStorage.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.ExtractableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; @@ -26,7 +26,7 @@ public long extract(final ItemResource resource, final long amount, final Action final long correctedAmount = amountOverride.overrideAmount( resource, amount, - () -> HandlerUtil.getCurrentAmount(itemHandler, toExtractStack) + () -> ForgeHandlerUtil.getCurrentAmount(itemHandler, toExtractStack) ); if (correctedAmount == 0) { return 0L; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ItemHandlerInsertableStorage.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ItemHandlerInsertableStorage.java similarity index 85% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ItemHandlerInsertableStorage.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ItemHandlerInsertableStorage.java index 64355fda9..5c0bbac8f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ItemHandlerInsertableStorage.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/ItemHandlerInsertableStorage.java @@ -1,10 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.storage; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.storage.Actor; import com.refinedmods.refinedstorage2.api.storage.InsertableStorage; -import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; -import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; +import com.refinedmods.refinedstorage2.platform.api.exporter.AmountOverride; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ItemResource; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; @@ -28,7 +28,7 @@ public long insert(final ItemResource resource, final long amount, final Action final long correctedAmount = amountOverride.overrideAmount( resource, amount, - () -> HandlerUtil.getCurrentAmount(itemHandler, resource.toItemStack()) + () -> ForgeHandlerUtil.getCurrentAmount(itemHandler, resource.toItemStack()) ); if (correctedAmount == 0) { return 0L; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java similarity index 90% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java index f9904b3ad..bc889914f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveBakedModel.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBakedModel.java @@ -1,11 +1,10 @@ -package com.refinedmods.refinedstorage2.platform.forge.render.model.baked; +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageState; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageStorageState; -import com.refinedmods.refinedstorage2.platform.common.block.DiskDriveBlock; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; -import com.refinedmods.refinedstorage2.platform.forge.block.entity.ForgeDiskDriveBlockEntity; +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 java.util.ArrayList; import java.util.Arrays; @@ -37,7 +36,7 @@ import net.minecraftforge.client.model.data.ModelData; import org.joml.Vector3f; -public class DiskDriveBakedModel extends BakedModelWrapper { +class DiskDriveBakedModel extends BakedModelWrapper { private static final Vector3f[] TRANSLATORS = new Vector3f[8]; static { @@ -65,10 +64,10 @@ public class DiskDriveBakedModel extends BakedModelWrapper { .build(new DiskDriveCacheLoader()); private final Map itemCache = new HashMap<>(); - public DiskDriveBakedModel(final Function baseModelBakery, - final BakedModel baseModel, - final BiFunction diskModelBakery, - final Function diskItemModelBakery) { + DiskDriveBakedModel(final Function baseModelBakery, + final BakedModel baseModel, + final BiFunction diskModelBakery, + final Function diskItemModelBakery) { super(baseModel); this.baseModel = baseModel; this.baseModelBakery = baseModelBakery; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/entity/DiskDriveBlockEntityRendererImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java similarity index 75% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/entity/DiskDriveBlockEntityRendererImpl.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java index 1681528d4..dd9daf228 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/entity/DiskDriveBlockEntityRendererImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveBlockEntityRendererImpl.java @@ -1,9 +1,8 @@ -package com.refinedmods.refinedstorage2.platform.forge.render.entity; +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageState; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; -import com.refinedmods.refinedstorage2.platform.common.render.entity.AbstractDiskDriveBlockEntityRenderer; -import com.refinedmods.refinedstorage2.platform.forge.block.entity.ForgeDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntityRenderer; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.VertexFormat; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveGeometryLoader.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveGeometryLoader.java similarity index 86% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveGeometryLoader.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveGeometryLoader.java index e5e6d8b09..dd6b3cfd4 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveGeometryLoader.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveGeometryLoader.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.render.model; +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonObject; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java similarity index 87% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java index 4817af872..047ae31f8 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/baked/DiskDriveItemBakedModel.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveItemBakedModel.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.render.model.baked; +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; import java.util.ArrayList; import java.util.EnumMap; @@ -20,7 +20,7 @@ import net.minecraftforge.client.model.BakedModelWrapper; import org.joml.Vector3f; -public class DiskDriveItemBakedModel extends BakedModelWrapper { +class DiskDriveItemBakedModel extends BakedModelWrapper { private final BakedModel baseModel; private final Function diskBakery; private final Vector3f[] translators; @@ -29,10 +29,10 @@ public class DiskDriveItemBakedModel extends BakedModelWrapper { @Nullable private List noSideCache; - public DiskDriveItemBakedModel(final BakedModel baseModel, - final Function diskBakery, - final Vector3f[] translators, - final long disks) { + DiskDriveItemBakedModel(final BakedModel baseModel, + final Function diskBakery, + final Vector3f[] translators, + final long disks) { super(baseModel); this.baseModel = baseModel; this.diskBakery = diskBakery; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java similarity index 95% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java index 429aeabc8..16171bb7f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/model/DiskDriveUnbakedGeometry.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/DiskDriveUnbakedGeometry.java @@ -1,7 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.forge.render.model; +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; -import com.refinedmods.refinedstorage2.platform.common.util.BiDirection; -import com.refinedmods.refinedstorage2.platform.forge.render.model.baked.DiskDriveBakedModel; +import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; import java.util.Objects; import java.util.function.BiFunction; @@ -28,6 +27,9 @@ public class DiskDriveUnbakedGeometry implements IUnbakedGeometry modelGetter, final IGeometryBakingContext context) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/ForgeDiskDriveBlockEntity.java similarity index 83% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/ForgeDiskDriveBlockEntity.java index 3ed78ff2d..9b76198f2 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/block/entity/ForgeDiskDriveBlockEntity.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/ForgeDiskDriveBlockEntity.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.block.entity; +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; import com.refinedmods.refinedstorage2.api.network.impl.node.multistorage.MultiStorageState; -import com.refinedmods.refinedstorage2.platform.common.block.entity.diskdrive.AbstractDiskDriveBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; import javax.annotation.Nonnull; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/package-info.java new file mode 100644 index 000000000..85c0f7486 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/diskdrive/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.storage.diskdrive; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/package-info.java new file mode 100644 index 000000000..64a1e40c2 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/storage/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.storage; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/ContainerTransferDestination.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/ContainerTransferDestination.java similarity index 74% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/ContainerTransferDestination.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/ContainerTransferDestination.java index 7740bba7c..949780b95 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/containermenu/ContainerTransferDestination.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/ContainerTransferDestination.java @@ -1,6 +1,6 @@ -package com.refinedmods.refinedstorage2.platform.forge.containermenu; +package com.refinedmods.refinedstorage2.platform.forge.support.containermenu; -import com.refinedmods.refinedstorage2.platform.common.containermenu.transfer.TransferDestination; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.TransferDestination; import net.minecraft.world.Container; import net.minecraft.world.item.ItemStack; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/menu/MenuOpenerImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/MenuOpenerImpl.java similarity index 70% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/menu/MenuOpenerImpl.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/MenuOpenerImpl.java index 08ba1c50e..5e979946e 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/menu/MenuOpenerImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/MenuOpenerImpl.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.menu; +package com.refinedmods.refinedstorage2.platform.forge.support.containermenu; -import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; -import com.refinedmods.refinedstorage2.platform.common.menu.MenuOpener; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.MenuOpener; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.MenuProvider; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/package-info.java new file mode 100644 index 000000000..7cd95f468 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/containermenu/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.support.containermenu; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/energy/EnergyStorageAdapter.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/energy/EnergyStorageAdapter.java similarity index 94% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/energy/EnergyStorageAdapter.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/energy/EnergyStorageAdapter.java index 77edd7796..18ec4d73f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/energy/EnergyStorageAdapter.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/energy/EnergyStorageAdapter.java @@ -1,4 +1,4 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.energy; +package com.refinedmods.refinedstorage2.platform.forge.support.energy; import com.refinedmods.refinedstorage2.api.core.Action; import com.refinedmods.refinedstorage2.api.network.energy.EnergyStorage; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/energy/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/energy/package-info.java new file mode 100644 index 000000000..08446aa01 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/energy/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.support.energy; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReference.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReference.java similarity index 72% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReference.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReference.java index ab5589eaf..d382c2bcc 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReference.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReference.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.curios; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import java.util.Optional; @@ -11,11 +11,11 @@ import top.theillusivec4.curios.api.CuriosApi; import top.theillusivec4.curios.api.SlotResult; -public class CuriosSlotReference implements SlotReference { +class CuriosSlotReference implements SlotReference { private final String identifier; private final int index; - public CuriosSlotReference(final String identifier, final int index) { + CuriosSlotReference(final String identifier, final int index) { this.identifier = identifier; this.index = index; } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReferenceFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceFactory.java similarity index 60% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReferenceFactory.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceFactory.java index 5cc8274e8..be9e2362b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReferenceFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceFactory.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.curios; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceFactory; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceFactory; import net.minecraft.network.FriendlyByteBuf; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReferenceProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceProvider.java similarity index 82% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReferenceProvider.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceProvider.java index a9a7bcb2b..a0486d21a 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/curios/CuriosSlotReferenceProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/CuriosSlotReferenceProvider.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.integration.curios; +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReference; -import com.refinedmods.refinedstorage2.platform.api.item.SlotReferenceProvider; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReference; +import com.refinedmods.refinedstorage2.platform.api.support.network.bounditem.SlotReferenceProvider; import java.util.Collections; import java.util.List; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/package-info.java new file mode 100644 index 000000000..0f09ee47e --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/network/bounditem/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.support.network.bounditem; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/FluidStackFluidRenderer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/render/FluidStackFluidRenderer.java similarity index 92% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/FluidStackFluidRenderer.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/render/FluidStackFluidRenderer.java index 64bf8246e..0a798ccc7 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/render/FluidStackFluidRenderer.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/render/FluidStackFluidRenderer.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.render; +package com.refinedmods.refinedstorage2.platform.forge.support.render; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.common.render.model.AbstractFluidRenderer; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.common.support.render.AbstractFluidRenderer; import java.util.Collections; import java.util.HashMap; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/render/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/render/package-info.java new file mode 100644 index 000000000..fbbef2d45 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/render/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.support.render; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ResourceContainerFluidHandlerAdapter.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/ResourceContainerFluidHandlerAdapter.java similarity index 79% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ResourceContainerFluidHandlerAdapter.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/ResourceContainerFluidHandlerAdapter.java index 1c7b6639c..8c79a48ad 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/storage/ResourceContainerFluidHandlerAdapter.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/ResourceContainerFluidHandlerAdapter.java @@ -1,18 +1,18 @@ -package com.refinedmods.refinedstorage2.platform.forge.internal.storage; +package com.refinedmods.refinedstorage2.platform.forge.support.resource; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceAmountTemplate; -import com.refinedmods.refinedstorage2.platform.api.resource.ResourceContainer; -import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceContainer; +import com.refinedmods.refinedstorage2.platform.common.storage.channel.StorageChannelTypes; import javax.annotation.Nullable; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.ofFluidStack; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toAction; -import static com.refinedmods.refinedstorage2.platform.forge.util.VariantUtil.toFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.ofFluidStack; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toAction; +import static com.refinedmods.refinedstorage2.platform.forge.support.resource.VariantUtil.toFluidStack; public class ResourceContainerFluidHandlerAdapter implements IFluidHandler { private final ResourceContainer container; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/util/VariantUtil.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/VariantUtil.java similarity index 90% rename from refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/util/VariantUtil.java rename to refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/VariantUtil.java index a6f6e7076..2e8fc5d99 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/util/VariantUtil.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/VariantUtil.java @@ -1,7 +1,7 @@ -package com.refinedmods.refinedstorage2.platform.forge.util; +package com.refinedmods.refinedstorage2.platform.forge.support.resource; import com.refinedmods.refinedstorage2.api.core.Action; -import com.refinedmods.refinedstorage2.platform.api.resource.FluidResource; +import com.refinedmods.refinedstorage2.platform.api.support.resource.FluidResource; import java.util.Objects; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/package-info.java new file mode 100644 index 000000000..48edca2fd --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/support/resource/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.forge.support.resource; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/util/package-info.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/util/package-info.java deleted file mode 100644 index e327f7d72..000000000 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/util/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -@ParametersAreNonnullByDefault -@FieldsAndMethodsAreNonnullByDefault -package com.refinedmods.refinedstorage2.platform.forge.util; - -import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/settings.gradle b/settings.gradle index 48e8abd26..142a92e09 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -gradle.ext.refinedArchitectVersion = "0.9.0" +gradle.ext.refinedArchitectVersion = "0.9.1" dependencyResolutionManagement { repositories {