diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ca687a57..bf783ec17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Wireless Grid - Creative Wireless Grid +- Wireless Transmitter +- Range Upgrade +- Creative Range Upgrade +- Fully charged Controller variants to the creative mode tab. ### Changed @@ -22,6 +26,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed inactive Grid slots still rendering resources. - Fixed being able to interact with inactive Grid. +- Fixed nearly on/off Controller model not being rendered correctly on Forge. +- Fixed Controller energy tooltip not working. ## [2.0.0-milestone.2.14] - 2023-08-19 diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml index c5a308304..b0d870283 100644 --- a/config/checkstyle/checkstyle-suppressions.xml +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -5,8 +5,8 @@ - - + + 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/GraphNetworkComponent.java index 665101d10..18bda8c72 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/GraphNetworkComponent.java @@ -5,7 +5,9 @@ import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; import org.slf4j.Logger; @@ -16,6 +18,7 @@ public class GraphNetworkComponent implements NetworkComponent { private final Network network; private final Set containers = new HashSet<>(); + private final Map, Set> containerIndex = new HashMap<>(); public GraphNetworkComponent(final Network network) { this.network = network; @@ -25,16 +28,53 @@ public Set getContainers() { return Collections.unmodifiableSet(containers); } + @SuppressWarnings("unchecked") + public Set getContainers(final Class clazz) { + return (Set) Collections.unmodifiableSet(containerIndex.getOrDefault(clazz, Collections.emptySet())); + } + @Override public void onContainerAdded(final NetworkNodeContainer container) { LOGGER.debug("Container {} added to network {}", container, network.hashCode()); containers.add(container); + addToIndex(container); } @Override public void onContainerRemoved(final NetworkNodeContainer container) { LOGGER.debug("Container {} removed from network {}", container, network.hashCode()); containers.remove(container); + deleteFromIndex(container); + } + + private void addToIndex(final NetworkNodeContainer container) { + final Class clazz = container.getClass(); + addToIndex(clazz, container); + for (final Class iface : clazz.getInterfaces()) { + addToIndex(iface, container); + } + } + + private void addToIndex(final Class indexKey, final NetworkNodeContainer container) { + containerIndex.computeIfAbsent(indexKey, k -> new HashSet<>()).add(container); + } + + private void deleteFromIndex(final NetworkNodeContainer container) { + final Class clazz = container.getClass(); + deleteFromIndex(clazz, container); + for (final Class iface : clazz.getInterfaces()) { + deleteFromIndex(iface, container); + } + } + + private void deleteFromIndex(final Class indexKey, final NetworkNodeContainer container) { + final Set index = containerIndex.get(indexKey); + if (index != null) { + index.remove(container); + if (index.isEmpty()) { + containerIndex.remove(indexKey); + } + } } @Override 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/GraphNetworkComponentTest.java new file mode 100644 index 000000000..dc9b2ab61 --- /dev/null +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java @@ -0,0 +1,210 @@ +package com.refinedmods.refinedstorage2.api.network.impl.component; + +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; +import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; +import com.refinedmods.refinedstorage2.network.test.NetworkTestFixtures; + +import java.util.Set; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class GraphNetworkComponentTest { + GraphNetworkComponent sut; + + @BeforeEach + void setUp() { + sut = new GraphNetworkComponent(new NetworkImpl(NetworkTestFixtures.NETWORK_COMPONENT_MAP_FACTORY)); + } + + @Test + void shouldAddContainer() { + // Arrange + final NetworkNodeContainer container1 = () -> new SimpleNetworkNode(0); + final NetworkNodeContainer container2 = () -> new SimpleNetworkNode(0); + + // Act + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Assert + assertThat(sut.getContainers()).containsExactlyInAnyOrder(container1, container2); + } + + @Test + void shouldRemoveContainer() { + // Arrange + final NetworkNodeContainer container1 = () -> new SimpleNetworkNode(0); + final NetworkNodeContainer container2 = () -> new SimpleNetworkNode(0); + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container1); + + // Assert + assertThat(sut.getContainers()).containsExactly(container2); + } + + @Test + void shouldNotRetrieveContainersByClassThatDontExist() { + // Act + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).isEmpty(); + } + + @Test + void shouldAddAndRetrieveSingleContainerByClass() { + // Arrange + final NetworkNodeContainer1 container1 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Act + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).containsExactly(container1); + } + + @Test + void shouldAddAndRetrieveMultipleContainersByClass() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).containsExactlyInAnyOrder(container11, container12); + } + + @Test + void shouldAddAndRetrieveMultipleContainersByInterface() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + final Set containers = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers).containsExactlyInAnyOrder(container11, container12, container2); + } + + @Test + void shouldRemoveSingleContainerAndRetrieveByClass() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container12); + + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).containsExactly(container11); + } + + @Test + void shouldRemoveSingleContainerAndRetrieveByInterface() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container12); + + final Set containers = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers).containsExactlyInAnyOrder(container11, container2); + } + + @Test + void shouldRemoveMultipleContainersAndRetrieveByClass() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container11); + sut.onContainerRemoved(container12); + + final Set containers1 = sut.getContainers(NetworkNodeContainer1.class); + final Set containers2 = sut.getContainers(NetworkNodeContainer2.class); + final Set containersByIface = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers1).isEmpty(); + assertThat(containers2).containsExactly(container2); + assertThat(containersByIface).containsExactly(container2); + } + + @Test + void shouldRemoveMultipleContainersAndRetrieveByInterface() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container11); + sut.onContainerRemoved(container12); + sut.onContainerRemoved(container2); + + final Set containers = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers).isEmpty(); + } + + private static class NetworkNodeContainer1 implements NetworkNodeContainer, BothImplements { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + } + + private static class NetworkNodeContainer2 implements NetworkNodeContainer, BothImplements { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + } + + private interface BothImplements { + } +} 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 4d08529c5..f47607570 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 @@ -6,6 +6,7 @@ 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.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; @@ -29,6 +30,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import java.util.Collection; @@ -76,6 +78,8 @@ public interface PlatformApi { UpgradeRegistry getUpgradeRegistry(); + BuiltinUpgradeDestinations getBuiltinUpgradeDestinations(); + void requestNetworkNodeInitialization(NetworkNodeContainer container, Level level, Runnable callback); void requestNetworkNodeRemoval(NetworkNodeContainer container, Level level); @@ -127,4 +131,8 @@ GridScrollingStrategy createGridScrollingStrategy(AbstractContainerMenu containe void registerIngredientConverter(IngredientConverter converter); IngredientConverter getIngredientConverter(); + + void addWirelessTransmitterRangeModifier(WirelessTransmitterRangeModifier rangeModifier); + + WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier(); } 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 0dad49244..a379d5b8e 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 @@ -6,6 +6,7 @@ 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.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; @@ -29,6 +30,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import java.util.Collection; @@ -131,6 +133,11 @@ public UpgradeRegistry getUpgradeRegistry() { return ensureLoaded().getUpgradeRegistry(); } + @Override + public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { + return ensureLoaded().getBuiltinUpgradeDestinations(); + } + @Override public void requestNetworkNodeInitialization(final NetworkNodeContainer container, final Level level, @@ -254,6 +261,16 @@ public IngredientConverter getIngredientConverter() { return ensureLoaded().getIngredientConverter(); } + @Override + public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { + ensureLoaded().addWirelessTransmitterRangeModifier(rangeModifier); + } + + @Override + public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { + return ensureLoaded().getWirelessTransmitterRangeModifier(); + } + private PlatformApi ensureLoaded() { if (delegate == null) { throw new IllegalStateException("Platform API not loaded yet"); 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/blockentity/wirelesstransmitter/WirelessTransmitter.java new file mode 100644 index 000000000..d405201a5 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; + +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +@FunctionalInterface +public interface WirelessTransmitter { + boolean isInRange(ResourceKey dimension, Vec3 position); +} 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/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..d3a241f95 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +@FunctionalInterface +public interface WirelessTransmitterRangeModifier { + int modifyRange(UpgradeState upgradeState, int range); + + default int getPriority() { + return 0; + } +} 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 new file mode 100644 index 000000000..71e76a806 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@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-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java index d790ab9f9..2383f6e8b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java @@ -1,25 +1,27 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.api.grid; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceAttributeKey; import com.refinedmods.refinedstorage2.api.grid.view.GridView; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage2.platform.api.grid.PlatformGridResource; import java.util.Collections; import java.util.Map; import java.util.Optional; import java.util.Set; -public abstract class AbstractGridResource implements PlatformGridResource { +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +public abstract class AbstractPlatformGridResource implements PlatformGridResource { protected final ResourceAmount resourceAmount; private final String name; private final Map> attributes; private boolean zeroed; - protected AbstractGridResource(final ResourceAmount resourceAmount, - final String name, - final Map> attributes) { + protected AbstractPlatformGridResource(final ResourceAmount resourceAmount, + final String name, + final Map> attributes) { this.resourceAmount = resourceAmount; this.name = name; this.attributes = attributes; @@ -61,7 +63,7 @@ public void setZeroed(final boolean zeroed) { @Override public String toString() { - return "AbstractGridResource{" + return "AbstractPlatformGridResource{" + "resourceAmount=" + resourceAmount + ", name='" + name + '\'' + ", attributes=" + attributes diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java new file mode 100644 index 000000000..26ecda3d4 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage2.platform.api.upgrade; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +public interface BuiltinUpgradeDestinations { + UpgradeDestination getImporter(); + + UpgradeDestination getExporter(); + + UpgradeDestination getDestructor(); + + UpgradeDestination getConstructor(); + + UpgradeDestination getWirelessTransmitter(); +} diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java index ffe8758af..277d7944a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java @@ -3,7 +3,8 @@ import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") -@FunctionalInterface public interface UpgradeState { - boolean hasUpgrade(UpgradeItem upgradeItem); + boolean has(UpgradeItem upgradeItem); + + int getAmount(UpgradeItem upgradeItem); } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json new file mode 100644 index 000000000..cf655c2c7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/black" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json new file mode 100644 index 000000000..a937ae334 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/blue" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json new file mode 100644 index 000000000..ec87ad816 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/brown" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json new file mode 100644 index 000000000..601db88a7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/cyan" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json new file mode 100644 index 000000000..6f2994d89 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/gray" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json new file mode 100644 index 000000000..de7d61c01 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/green" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..ff3ae52e7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json new file mode 100644 index 000000000..5d975ed16 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/lime" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json new file mode 100644 index 000000000..c114a2514 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/magenta" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json new file mode 100644 index 000000000..df7228375 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/orange" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json new file mode 100644 index 000000000..744c8852f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/pink" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json new file mode 100644 index 000000000..b2d30a531 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/purple" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json new file mode 100644 index 000000000..8e18d1e4c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/red" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json new file mode 100644 index 000000000..5e8c29e49 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/white" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json new file mode 100644 index 000000000..25d401ac6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json new file mode 100644 index 000000000..1fdb6428c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/yellow" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90, + "y": 90 + } + } +} \ 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 new file mode 100644 index 000000000..e1ff55758 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/black" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..65cfb5050 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/blue" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..c025eb4ca --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/brown" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..09e3a6d52 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/cyan" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..22092dae1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/gray" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..fcf5eb934 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/green" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..4d994ede4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_blue" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..79d7f8f33 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_gray" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..18066c311 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/lime" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..55e545d09 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/magenta" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..3d53d67e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/orange" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..2f33a8fe5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/pink" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..80c889144 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/purple" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..ddd8adffa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/red" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..fa1e3b66d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/white" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..fa82c3620 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json new file mode 100644 index 000000000..e1ff55758 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json new file mode 100644 index 000000000..65cfb5050 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json new file mode 100644 index 000000000..c025eb4ca --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json new file mode 100644 index 000000000..09e3a6d52 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json new file mode 100644 index 000000000..22092dae1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json new file mode 100644 index 000000000..fcf5eb934 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..79d7f8f33 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json new file mode 100644 index 000000000..18066c311 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json new file mode 100644 index 000000000..55e545d09 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json new file mode 100644 index 000000000..3d53d67e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json new file mode 100644 index 000000000..2f33a8fe5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json new file mode 100644 index 000000000..80c889144 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json new file mode 100644 index 000000000..ddd8adffa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json new file mode 100644 index 000000000..fa1e3b66d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json new file mode 100644 index 000000000..4d994ede4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json new file mode 100644 index 000000000..fa82c3620 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_wireless_transmitter.json new file mode 100644 index 000000000..2f85c7a7c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/black_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/black_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_wireless_transmitter.json new file mode 100644 index 000000000..c26a239fa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/blue_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/blue_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_wireless_transmitter.json new file mode 100644 index 000000000..9147d3182 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/brown_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/brown_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_wireless_transmitter.json new file mode 100644 index 000000000..5b6e8dcee --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/cyan_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/cyan_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_wireless_transmitter.json new file mode 100644 index 000000000..81b0f4c6f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/gray_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/gray_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_wireless_transmitter.json new file mode 100644 index 000000000..b4e0ca28e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/green_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/green_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_wireless_transmitter.json new file mode 100644 index 000000000..c7b4ed99b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_blue_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_blue_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..5909bc045 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_gray_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_gray_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_wireless_transmitter.json new file mode 100644 index 000000000..73ca47661 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/lime_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/lime_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_wireless_transmitter.json new file mode 100644 index 000000000..c75ed2bcc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/magenta_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/magenta_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_wireless_transmitter.json new file mode 100644 index 000000000..490111439 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/orange_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/orange_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_wireless_transmitter.json new file mode 100644 index 000000000..9b36d5e85 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/pink_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/pink_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_wireless_transmitter.json new file mode 100644 index 000000000..7fbd3a1fa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/purple_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/purple_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_wireless_transmitter.json new file mode 100644 index 000000000..fcd5ba77d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/red_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/red_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_wireless_transmitter.json new file mode 100644 index 000000000..dac38efab --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/white_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/white_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_wireless_transmitter.json new file mode 100644 index 000000000..7441aac81 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/yellow_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/yellow_wireless_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_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_wireless_transmitter.json new file mode 100644 index 000000000..aac4414b8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:black_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/black_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json new file mode 100644 index 000000000..700a5b4d5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:blue_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/blue_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json new file mode 100644 index 000000000..999709155 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:brown_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/brown_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json new file mode 100644 index 000000000..bc519e8f2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:cyan_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/cyan_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json new file mode 100644 index 000000000..57a970c1b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:gray_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/gray_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json new file mode 100644 index 000000000..fcdf20e4f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:green_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/green_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..63a18bdc3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:light_gray_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/light_gray_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json new file mode 100644 index 000000000..49c297dc6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:lime_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/lime_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json new file mode 100644 index 000000000..5694135d2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:magenta_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/magenta_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json new file mode 100644 index 000000000..86becf6e7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:orange_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/orange_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json new file mode 100644 index 000000000..162626eaa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:pink_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/pink_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json new file mode 100644 index 000000000..a39f427aa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:purple_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/purple_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json new file mode 100644 index 000000000..aaaee6423 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:red_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/red_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json new file mode 100644 index 000000000..0ef3b6fb2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:white_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/white_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json new file mode 100644 index 000000000..193747431 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json new file mode 100644 index 000000000..a977b9fbb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:yellow_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/yellow_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json new file mode 100644 index 000000000..1b63b86cb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:black_dye" + } + ], + "result": { + "item": "refinedstorage2:black_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json new file mode 100644 index 000000000..50622ac43 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:blue_dye" + } + ], + "result": { + "item": "refinedstorage2:blue_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json new file mode 100644 index 000000000..1766affaa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:brown_dye" + } + ], + "result": { + "item": "refinedstorage2:brown_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json new file mode 100644 index 000000000..23b00b985 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:cyan_dye" + } + ], + "result": { + "item": "refinedstorage2:cyan_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json new file mode 100644 index 000000000..bbf671537 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:gray_dye" + } + ], + "result": { + "item": "refinedstorage2:gray_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json new file mode 100644 index 000000000..3424885f4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:green_dye" + } + ], + "result": { + "item": "refinedstorage2:green_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json new file mode 100644 index 000000000..079c8c7c6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:light_blue_dye" + } + ], + "result": { + "item": "refinedstorage2:wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..842a8f574 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:light_gray_dye" + } + ], + "result": { + "item": "refinedstorage2:light_gray_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json new file mode 100644 index 000000000..433477fa0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:lime_dye" + } + ], + "result": { + "item": "refinedstorage2:lime_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json new file mode 100644 index 000000000..ac923b7ab --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:magenta_dye" + } + ], + "result": { + "item": "refinedstorage2:magenta_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json new file mode 100644 index 000000000..bf313bc0a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:orange_dye" + } + ], + "result": { + "item": "refinedstorage2:orange_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json new file mode 100644 index 000000000..1cadb50c8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:pink_dye" + } + ], + "result": { + "item": "refinedstorage2:pink_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json new file mode 100644 index 000000000..3988644af --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:purple_dye" + } + ], + "result": { + "item": "refinedstorage2:purple_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json new file mode 100644 index 000000000..97575a878 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:red_dye" + } + ], + "result": { + "item": "refinedstorage2:red_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json new file mode 100644 index 000000000..72ec2e841 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:white_dye" + } + ], + "result": { + "item": "refinedstorage2:white_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json new file mode 100644 index 000000000..f3b6744ca --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:yellow_dye" + } + ], + "result": { + "item": "refinedstorage2:yellow_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json new file mode 100644 index 000000000..0d8e90a5e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage2:white_wireless_transmitter", + "refinedstorage2:orange_wireless_transmitter", + "refinedstorage2:magenta_wireless_transmitter", + "refinedstorage2:wireless_transmitter", + "refinedstorage2:yellow_wireless_transmitter", + "refinedstorage2:lime_wireless_transmitter", + "refinedstorage2:pink_wireless_transmitter", + "refinedstorage2:gray_wireless_transmitter", + "refinedstorage2:light_gray_wireless_transmitter", + "refinedstorage2:cyan_wireless_transmitter", + "refinedstorage2:purple_wireless_transmitter", + "refinedstorage2:blue_wireless_transmitter", + "refinedstorage2:brown_wireless_transmitter", + "refinedstorage2:green_wireless_transmitter", + "refinedstorage2:red_wireless_transmitter", + "refinedstorage2:black_wireless_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 b5a709626..fde55a532 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 @@ -19,6 +19,7 @@ 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.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; @@ -48,6 +49,7 @@ protected static void registerScreens(final ScreenRegistration registration) { registration.register(Menus.INSTANCE.getDestructor(), DestructorScreen::new); registration.register(Menus.INSTANCE.getConstructor(), ConstructorScreen::new); registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); + registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::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 3b64c1e01..56e152038 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 @@ -35,6 +35,10 @@ 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.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; @@ -42,6 +46,7 @@ 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.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; @@ -70,6 +75,7 @@ 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; @@ -121,6 +127,7 @@ import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STORAGE_BLOCK; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STORAGE_HOUSING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WIRELESS_GRID; +import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WIRELESS_TRANSMITTER; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WRENCH; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.forFluidStorageBlock; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.forFluidStorageDisk; @@ -146,6 +153,7 @@ protected final void initializePlatformApi() { registerDestructorStrategyFactories(); registerConstructorStrategyFactories(); registerNetworkComponents(); + registerWirelessTransmitterRangeModifiers(); } private void registerAdditionalStorageTypes() { @@ -199,6 +207,14 @@ private void registerNetworkComponents() { ); } + private void registerWirelessTransmitterRangeModifiers() { + PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new BaseWirelessTransmitterRangeModifier()); + PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new RangeUpgradeWirelessTransmitterRangeModifier()); + PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier( + new CreativeRangeUpgradeWirelessTransmitterRangeModifier() + ); + } + protected final void registerBlocks( final RegistryCallback callback, final BiFunction diskDriveBlockEntityFactory @@ -232,6 +248,7 @@ protected final void registerBlocks( Blocks.INSTANCE.getConstructor().registerBlocks(callback); Blocks.INSTANCE.getDestructor().registerBlocks(callback); Blocks.INSTANCE.setInterface(callback.register(INTERFACE, InterfaceBlock::new)); + Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); } protected final void registerItems( @@ -244,14 +261,15 @@ protected final void registerItems( Blocks.INSTANCE.getGrid().registerItems(callback); Blocks.INSTANCE.getCraftingGrid().registerItems(callback); Blocks.INSTANCE.getCable().registerItems(callback, Items.INSTANCE::addCable); - Blocks.INSTANCE.getController().registerItems(callback, Items.INSTANCE::addRegularController); - Blocks.INSTANCE.getCreativeController().registerItems(callback, Items.INSTANCE::addController); + Blocks.INSTANCE.getController().registerItems(callback, Items.INSTANCE::addController); + Blocks.INSTANCE.getCreativeController().registerItems(callback, Items.INSTANCE::addCreativeController); Blocks.INSTANCE.getDetector().registerItems(callback, Items.INSTANCE::addDetector); Blocks.INSTANCE.getImporter().registerItems(callback, Items.INSTANCE::addImporter); Blocks.INSTANCE.getExporter().registerItems(callback, Items.INSTANCE::addExporter); Blocks.INSTANCE.getExternalStorage().registerItems(callback, Items.INSTANCE::addExternalStorage); Blocks.INSTANCE.getConstructor().registerItems(callback, Items.INSTANCE::addConstructor); Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); + Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); registerStorageItems(callback); registerUpgrades(callback, regulatorUpgradeItemSupplier); Items.INSTANCE.setWirelessGrid(callback.register(ContentIds.WIRELESS_GRID, wirelessGridItemSupplier)); @@ -384,6 +402,14 @@ private void registerUpgrades( ContentIds.REGULATOR_UPGRADE, regulatorUpgradeItemSupplier )); + Items.INSTANCE.setRangeUpgrade(callback.register( + ContentIds.RANGE_UPGRADE, + () -> new RangeUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), false) + )); + Items.INSTANCE.setCreativeRangeUpgrade(callback.register( + ContentIds.CREATIVE_RANGE_UPGRADE, + () -> new RangeUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), true) + )); } protected final void registerUpgradeMappings() { @@ -407,6 +433,10 @@ protected final void registerUpgradeMappings() { PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.CONSTRUCTOR) .add(Items.INSTANCE.getSpeedUpgrade(), 4) .add(Items.INSTANCE.getStackUpgrade()); + + PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.WIRELESS_TRANSMITTER) + .add(Items.INSTANCE.getRangeUpgrade(), 4) + .add(Items.INSTANCE.getCreativeRangeUpgrade()); } protected final void registerBlockEntities( @@ -493,6 +523,13 @@ protected final void registerBlockEntities( DESTRUCTOR, () -> typeFactory.create(DestructorBlockEntity::new, Blocks.INSTANCE.getDestructor().toArray()) )); + BlockEntities.INSTANCE.setWirelessTransmitter(callback.register( + WIRELESS_TRANSMITTER, + () -> typeFactory.create( + WirelessTransmitterBlockEntity::new, + Blocks.INSTANCE.getWirelessTransmitter().toArray() + ) + )); } protected final void registerMenus(final RegistryCallback> callback, @@ -557,6 +594,10 @@ protected final void registerMenus(final RegistryCallback> callback, REGULATOR_UPGRADE, () -> menuTypeFactory.create(RegulatorUpgradeContainerMenu::new) )); + Menus.INSTANCE.setWirelessTransmitter(callback.register( + WIRELESS_TRANSMITTER, + () -> menuTypeFactory.create(WirelessTransmitterContainerMenu::new) + )); } protected final void registerLootFunctions(final RegistryCallback callback) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java index 2a43e5b8a..865bbf8d0 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 @@ -42,6 +42,8 @@ public interface Config { WirelessGridEntry getWirelessGrid(); + WirelessTransmitterEntry getWirelessTransmitter(); + interface SimpleEnergyUsageEntry { long getEnergyUsage(); } @@ -138,6 +140,12 @@ interface UpgradeEntry { long getSilkTouchUpgradeEnergyUsage(); long getRegulatorUpgradeEnergyUsage(); + + long getRangeUpgradeEnergyUsage(); + + long getCreativeRangeUpgradeEnergyUsage(); + + int getRangeUpgradeRange(); } interface WirelessGridEntry { @@ -151,4 +159,8 @@ interface WirelessGridEntry { long getExtractEnergyUsage(); } + + interface WirelessTransmitterEntry extends SimpleEnergyUsageEntry { + int getBaseRange(); + } } 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 e8d46135a..2a61e639c 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 @@ -10,6 +10,7 @@ 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.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; @@ -33,7 +34,9 @@ import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +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.grid.CompositeGridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridInsertionStrategy; @@ -48,6 +51,7 @@ 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; @@ -98,6 +102,7 @@ public class PlatformApiImpl implements PlatformApi { new PlatformRegistryImpl<>(createIdentifier("noop"), (level, pos, direction, upgradeState, amountOverride, fuzzyMode) -> (resource, actor, network) -> false); private final UpgradeRegistry upgradeRegistry = new UpgradeRegistryImpl(); + private final BuiltinUpgradeDestinations builtinUpgradeDestinations = new BuiltinUpgradeDestinationsImpl(); private final Queue externalStorageProviderFactories = new PriorityQueue<>( Comparator.comparingInt(PlatformExternalStorageProviderFactory::getPriority) ); @@ -120,6 +125,8 @@ public class PlatformApiImpl implements PlatformApi { private final ResourceFactory fluidResourceFactory = new FluidResourceFactory(); private final Set> resourceFactories = new HashSet<>(); private final Map, ResourceRendering> resourceRenderingMap = new HashMap<>(); + private final CompositeWirelessTransmitterRangeModifier wirelessTransmitterRangeModifier = + new CompositeWirelessTransmitterRangeModifier(); @Override public PlatformRegistry> getStorageTypeRegistry() { @@ -221,6 +228,11 @@ public UpgradeRegistry getUpgradeRegistry() { return upgradeRegistry; } + @Override + public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { + return builtinUpgradeDestinations; + } + @Override public void requestNetworkNodeInitialization(final NetworkNodeContainer container, final Level level, @@ -369,4 +381,14 @@ public void registerIngredientConverter(final IngredientConverter converter) { public IngredientConverter getIngredientConverter() { return compositeConverter; } + + @Override + public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { + wirelessTransmitterRangeModifier.addModifier(rangeModifier); + } + + @Override + public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { + return wirelessTransmitterRangeModifier; + } } 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/block/WirelessTransmitterBlock.java new file mode 100644 index 000000000..6f069a0d5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java @@ -0,0 +1,131 @@ +package com.refinedmods.refinedstorage2.platform.common.block; + +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.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +public class WirelessTransmitterBlock extends AbstractDirectionalBlock + implements ColorableBlock, BlockItemProvider, EntityBlock { + public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getWirelessTransmitter, ACTIVE); + private static final Component HELP = createTranslation("item", "wireless_transmitter.help"); + + private static final VoxelShape SHAPE_DOWN = box(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_UP = box(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D); + private static final VoxelShape SHAPE_EAST = box(6.0D, 6.0D, 6.0D, 16.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_WEST = box(0.0D, 6.0D, 6.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_NORTH = box(6.0D, 6.0D, 0.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_SOUTH = box(6.0D, 6.0D, 6.0D, 10.0D, 10.0D, 16.0D); + + private final DyeColor color; + private final MutableComponent name; + + public WirelessTransmitterBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES); + this.color = color; + this.name = name; + } + + @Override + protected BlockState getDefaultState() { + return super.getDefaultState().setValue(ACTIVE, false); + } + + @Override + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(ACTIVE); + } + + @Override + protected DirectionType getDirectionType() { + return DirectionTypeImpl.INSTANCE; + } + + @Override + @SuppressWarnings("deprecation") + public VoxelShape getShape(final BlockState state, + final BlockGetter world, + final BlockPos pos, + final CollisionContext context) { + final Direction direction = getDirection(state); + if (direction == null) { + return Shapes.empty(); + } + return switch (direction) { + case DOWN -> SHAPE_DOWN; + case UP -> SHAPE_UP; + case NORTH -> SHAPE_NORTH; + case SOUTH -> SHAPE_SOUTH; + case WEST -> SHAPE_WEST; + case EAST -> SHAPE_EAST; + }; + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getWirelessTransmitter(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new WirelessTransmitterBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public DyeColor getColor() { + return color; + } + + @Override + public MutableComponent getName() { + return name; + } + + @Override + public BlockItem createBlockItem() { + return new NamedBlockItem(this, new Item.Properties(), getName(), HELP); + } +} 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/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java index 42bd57ead..c1a725fe3 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/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java @@ -2,30 +2,31 @@ import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeItem; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; import com.google.common.util.concurrent.RateLimiter; -import it.unimi.dsi.fastutil.objects.Object2IntMap; -import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; 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; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractUpgradeableNetworkNodeContainerBlockEntity extends AbstractLevelInteractingNetworkNodeContainerBlockEntity implements BlockEntityWithDrops { + private static final Logger LOGGER = LoggerFactory.getLogger( + AbstractUpgradeableNetworkNodeContainerBlockEntity.class + ); + private static final String TAG_UPGRADES = "u"; protected final UpgradeContainer upgradeContainer; - private final Object2IntMap upgradeState = new Object2IntOpenHashMap<>(); private RateLimiter rateLimiter = createRateLimiter(0); protected AbstractUpgradeableNetworkNodeContainerBlockEntity( @@ -78,34 +79,10 @@ public void load(final CompoundTag tag) { } private void configureAccordingToUpgrades() { - updateUpgradeState(); - final int amountOfSpeedUpgrades = upgradeState.getInt(Items.INSTANCE.getSpeedUpgrade()); + LOGGER.info("Reconfiguring {} for upgrades", getBlockPos()); + final int amountOfSpeedUpgrades = upgradeContainer.getAmount(Items.INSTANCE.getSpeedUpgrade()); this.rateLimiter = createRateLimiter(amountOfSpeedUpgrades); - final long upgradeEnergyUsage = upgradeState.keySet().stream().mapToLong(UpgradeItem::getEnergyUsage).sum(); - this.setEnergyUsage(upgradeEnergyUsage); - } - - private void updateUpgradeState() { - this.upgradeState.clear(); - for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { - updateUpgradeState(i); - } - } - - private void updateUpgradeState(final int index) { - final ItemStack stack = upgradeContainer.getItem(index); - if (stack.isEmpty()) { - return; - } - final Item item = stack.getItem(); - if (!(item instanceof UpgradeItem upgradeItem)) { - return; - } - upgradeState.put(upgradeItem, upgradeState.getInt(upgradeItem) + 1); - } - - public final boolean hasUpgrade(final UpgradeItem upgradeItem) { - return upgradeState.containsKey(upgradeItem); + this.setEnergyUsage(upgradeContainer.getEnergyUsage()); } protected abstract void setEnergyUsage(long upgradeEnergyUsage); 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/block/entity/ControllerBlockEntity.java index fd93ccb1d..609795f5d 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/block/entity/ControllerBlockEntity.java @@ -56,10 +56,18 @@ public static long getStored(final CompoundTag tag) { return tag.contains(TAG_STORED) ? tag.getLong(TAG_STORED) : 0; } + public static void setStored(final CompoundTag tag, final long stored) { + tag.putLong(TAG_STORED, stored); + } + public static long getCapacity(final CompoundTag tag) { return tag.contains(TAG_CAPACITY) ? tag.getLong(TAG_CAPACITY) : 0; } + public static void setCapacity(final CompoundTag tag, final long capacity) { + tag.putLong(TAG_CAPACITY, capacity); + } + public static boolean hasEnergy(@Nullable final CompoundTag tag) { return tag != null && tag.contains(TAG_STORED) && tag.contains(TAG_CAPACITY); } 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/block/entity/ImporterBlockEntity.java index 94e7c1373..f283e7c8e 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/block/entity/ImporterBlockEntity.java @@ -74,7 +74,7 @@ private CompositeImporterTransferStrategy createStrategy(final ServerLevel serve PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().getAll(); final List strategies = factories .stream() - .map(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, this::hasUpgrade, this)) + .map(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, upgradeContainer, this)) .toList(); return new CompositeImporterTransferStrategy(strategies); } @@ -140,7 +140,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent public long overrideAmount(final T resource, final long amount, final LongSupplier currentAmount) { - if (!hasUpgrade(Items.INSTANCE.getRegulatorUpgrade())) { + if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { return amount; } return upgradeContainer.getRegulatedAmount(resource) 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/block/entity/UpgradeContainer.java index cbef71ee9..bd80803be 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/block/entity/UpgradeContainer.java @@ -1,20 +1,31 @@ package com.refinedmods.refinedstorage2.platform.common.block.entity; 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; import java.util.stream.IntStream; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import net.minecraft.nbt.ListTag; import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class UpgradeContainer extends SimpleContainer implements UpgradeState { + private static final Logger LOGGER = LoggerFactory.getLogger(UpgradeContainer.class); -public class UpgradeContainer extends SimpleContainer { private final UpgradeDestination destination; private final UpgradeRegistry registry; + private final Object2IntMap index = new Object2IntOpenHashMap<>(); public UpgradeContainer(final UpgradeDestination destination, final UpgradeRegistry registry) { @@ -28,6 +39,7 @@ public UpgradeContainer(final UpgradeDestination destination, super(4); this.destination = destination; this.registry = registry; + this.addListener(container -> updateIndex()); this.addListener(container -> listener.run()); } @@ -63,4 +75,52 @@ public OptionalLong getRegulatedAmount(final T resource) { .flatMapToLong(stack -> ((RegulatorUpgradeItem) stack.getItem()).getDesiredAmount(stack, resource).stream()) .findFirst(); } + + @Override + public void fromTag(final ListTag tag) { + super.fromTag(tag); + updateIndex(); + } + + private void updateIndex() { + LOGGER.info("Updating upgrade index for {}", destination); + index.clear(); + for (int i = 0; i < getContainerSize(); ++i) { + updateIndex(i); + } + } + + private void updateIndex(final int slotIndex) { + final ItemStack stack = getItem(slotIndex); + if (stack.isEmpty()) { + return; + } + final Item item = stack.getItem(); + if (!(item instanceof UpgradeItem upgradeItem)) { + return; + } + index.put(upgradeItem, index.getInt(upgradeItem) + 1); + } + + @Override + public boolean has(final UpgradeItem upgradeItem) { + return index.containsKey(upgradeItem); + } + + @Override + public int getAmount(final UpgradeItem upgradeItem) { + return index.getInt(upgradeItem); + } + + public long getEnergyUsage() { + long usage = 0; + for (int i = 0; i < getContainerSize(); ++i) { + final ItemStack stack = getItem(i); + if (!(stack.getItem() instanceof UpgradeItem upgradeItem)) { + continue; + } + usage += upgradeItem.getEnergyUsage(); + } + return usage; + } } 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/block/entity/constructor/ConstructorBlockEntity.java index 4b9627bf5..83bc15bcf 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/block/entity/constructor/ConstructorBlockEntity.java @@ -77,7 +77,7 @@ private ConstructorStrategy createStrategy(final ServerLevel serverLevel, final serverLevel, sourcePosition, incomingDirection, - this::hasUpgrade, + upgradeContainer, dropItems ).stream()) .toList(); 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/block/entity/constructor/ItemDropConstructorStrategyFactory.java index d4b5ddbd2..849711b6d 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/block/entity/constructor/ItemDropConstructorStrategyFactory.java @@ -25,7 +25,7 @@ public Optional create(final ServerLevel level, level, pos, direction, - upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) + upgradeState.has(Items.INSTANCE.getStackUpgrade()) )); } 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/block/entity/destructor/BlockBreakDestructorStrategyFactory.java index a046265bc..df66a81f9 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/block/entity/destructor/BlockBreakDestructorStrategyFactory.java @@ -38,7 +38,7 @@ public Optional create(final ServerLevel level, private ItemStack createTool(final UpgradeState state) { for (final Tool tool : TOOLS) { - if (state.hasUpgrade(tool.itemSupplier.get())) { + if (state.has(tool.itemSupplier.get())) { return tool.tool; } } 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/block/entity/destructor/DestructorBlockEntity.java index db37d0828..5cff0b162 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/block/entity/destructor/DestructorBlockEntity.java @@ -137,7 +137,7 @@ protected void initialize(final ServerLevel level, final Direction direction) { final Direction incomingDirection = direction.getOpposite(); final List strategies = PlatformApi.INSTANCE.getDestructorStrategyFactories() .stream() - .flatMap(factory -> factory.create(level, pos, incomingDirection, this::hasUpgrade, pickupItems).stream()) + .flatMap(factory -> factory.create(level, pos, incomingDirection, upgradeContainer, pickupItems).stream()) .toList(); this.strategy = new CompositeDestructorStrategy(strategies); } 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/block/entity/exporter/ExporterBlockEntity.java index 63d527261..cd9be6ecb 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/block/entity/exporter/ExporterBlockEntity.java @@ -7,7 +7,6 @@ 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.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractSchedulingNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.containermenu.ExporterContainerMenu; @@ -34,7 +33,7 @@ public class ExporterBlockEntity extends AbstractSchedulingNetworkNodeContainerBlockEntity - implements AmountOverride, UpgradeState { + implements AmountOverride { private static final Logger LOGGER = LoggerFactory.getLogger(ExporterBlockEntity.class); public ExporterBlockEntity(final BlockPos pos, final BlockState state) { @@ -65,7 +64,7 @@ private ExporterTransferStrategy createStrategy(final ServerLevel serverLevel, f serverLevel, sourcePosition, incomingDirection, - this, + upgradeContainer, this, filter.isFuzzyMode() )) @@ -102,7 +101,7 @@ protected void setFilterTemplates(final List templates) { @Override public long overrideAmount(final T resource, final long amount, final LongSupplier currentAmount) { - if (!hasUpgrade(Items.INSTANCE.getRegulatorUpgrade())) { + if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { return amount; } return upgradeContainer.getRegulatedAmount(resource) 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/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..a284249d5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.common.Platform; + +public class BaseWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + return Platform.INSTANCE.getConfig().getWirelessTransmitter().getBaseRange() + range; + } +} 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/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..377779e3c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; + +import java.util.Comparator; +import java.util.PriorityQueue; +import java.util.Queue; + +public class CompositeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + private final Queue modifiers = new PriorityQueue<>( + Comparator.comparingInt(WirelessTransmitterRangeModifier::getPriority) + ); + + public void addModifier(final WirelessTransmitterRangeModifier rangeModifier) { + modifiers.add(rangeModifier); + } + + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + int result = range; + for (final WirelessTransmitterRangeModifier rangeModifier : modifiers) { + result = rangeModifier.modifyRange(upgradeState, result); + } + return result; + } +} 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/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..4933e6295 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.common.content.Items; + +public class CreativeRangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + if (upgradeState.has(Items.INSTANCE.getCreativeRangeUpgrade())) { + return Integer.MAX_VALUE; + } + return range; + } + + @Override + public int getPriority() { + return Integer.MAX_VALUE; + } +} 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/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..5a2b1b9c0 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.Items; + +public class RangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + final int amountOfRangeUpgrades = upgradeState.getAmount(Items.INSTANCE.getRangeUpgrade()); + final int rangePerUpgrade = Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeRange(); + return range + (amountOfRangeUpgrades * rangePerUpgrade); + } +} 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/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java new file mode 100644 index 000000000..a45aede31 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -0,0 +1,119 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.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.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 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.resources.ResourceKey; +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.Level; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec3; + +public class WirelessTransmitterBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity + implements ExtendedMenuProvider, WirelessTransmitter { + private static final String TAG_UPGRADES = "u"; + + private final UpgradeContainer upgradeContainer = new UpgradeContainer( + UpgradeDestinations.WIRELESS_TRANSMITTER, + PlatformApi.INSTANCE.getUpgradeRegistry(), + this::upgradeContainerChanged + ); + + public WirelessTransmitterBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getWirelessTransmitter(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage() + )); + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + tag.put(TAG_UPGRADES, upgradeContainer.createTag()); + } + + @Override + public void load(final CompoundTag tag) { + if (tag.contains(TAG_UPGRADES)) { + upgradeContainer.fromTag(tag.getList(TAG_UPGRADES, Tag.TAG_COMPOUND)); + } + configureAccordingToUpgrades(); + super.load(tag); + } + + @Override + public boolean canPerformOutgoingConnection(final Direction direction) { + return direction == getDirection(); + } + + @Override + public boolean canAcceptIncomingConnection(final Direction direction, final BlockState other) { + return colorsAllowConnecting(other) && direction.getOpposite() == getDirection(); + } + + @Override + public Component getDisplayName() { + return ContentNames.WIRELESS_TRANSMITTER; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new WirelessTransmitterContainerMenu(syncId, inventory, this, upgradeContainer); + } + + public int getRange() { + return PlatformApi.INSTANCE.getWirelessTransmitterRangeModifier().modifyRange(upgradeContainer, 0); + } + + @Override + public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { + buf.writeInt(getRange()); + } + + private void upgradeContainerChanged() { + setChanged(); + configureAccordingToUpgrades(); + } + + private void configureAccordingToUpgrades() { + final long baseUsage = Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage(); + getNode().setEnergyUsage(baseUsage + upgradeContainer.getEnergyUsage()); + } + + @Override + public boolean isInRange(final ResourceKey dimension, final Vec3 position) { + final Level level = getLevel(); + if (level == null || level.dimension() != dimension) { + return false; + } + if (!getNode().isActive()) { + return false; + } + final double distance = Math.sqrt( + Math.pow(getBlockPos().getX() - position.x(), 2) + + Math.pow(getBlockPos().getY() - position.y(), 2) + + Math.pow(getBlockPos().getZ() - position.z(), 2) + ); + return distance <= getRange(); + } +} 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 new file mode 100644 index 000000000..feb736764 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@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/containermenu/WirelessTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java new file mode 100644 index 000000000..bc6e1de5f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java @@ -0,0 +1,93 @@ +package com.refinedmods.refinedstorage2.platform.common.containermenu; + +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 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.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class WirelessTransmitterContainerMenu extends AbstractBaseContainerMenu { + private final RateLimiter rangeRateLimiter = RateLimiter.create(4); + + private int range; + @Nullable + private final WirelessTransmitterBlockEntity wirelessTransmitter; + private final Player player; + + public WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final FriendlyByteBuf buf) { + super(Menus.INSTANCE.getWirelessTransmitter(), syncId); + addSlots(playerInventory, new UpgradeContainer( + UpgradeDestinations.WIRELESS_TRANSMITTER, + PlatformApi.INSTANCE.getUpgradeRegistry() + )); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.range = buf.readInt(); + this.wirelessTransmitter = null; + this.player = playerInventory.player; + } + + public WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final WirelessTransmitterBlockEntity wirelessTransmitter, + final UpgradeContainer upgradeContainer) { + super(Menus.INSTANCE.getWirelessTransmitter(), syncId); + addSlots(playerInventory, upgradeContainer); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + wirelessTransmitter::getRedstoneMode, + wirelessTransmitter::setRedstoneMode + )); + this.range = wirelessTransmitter.getRange(); + this.wirelessTransmitter = wirelessTransmitter; + this.player = playerInventory.player; + } + + private void addSlots(final Inventory playerInventory, final UpgradeContainer upgradeContainer) { + addPlayerInventory(playerInventory, 8, 55); + for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { + addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18))); + } + transferManager.addBiTransfer(playerInventory, upgradeContainer); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + if (wirelessTransmitter == null) { + return; + } + final int newRange = wirelessTransmitter.getRange(); + final boolean changed = range != newRange; + if (changed && rangeRateLimiter.tryAcquire()) { + this.range = newRange; + Platform.INSTANCE.getServerToClientCommunications().sendWirelessTransmitterRange( + (ServerPlayer) player, + range + ); + } + } + + public int getRange() { + return range; + } + + public void setRange(final int range) { + this.range = range; + } +} 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 b6ffa50f7..9ca78ce92 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 @@ -14,6 +14,7 @@ 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.wirelesstransmitter.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; @@ -58,6 +59,8 @@ public final class BlockEntities { private Supplier> destructor; @Nullable private Supplier> constructor; + @Nullable + private Supplier> wirelessTransmitter; private BlockEntities() { } @@ -183,4 +186,12 @@ public BlockEntityType getConstructor() { public void setConstructor(final Supplier> supplier) { this.constructor = supplier; } + + public BlockEntityType getWirelessTransmitter() { + return Objects.requireNonNull(wirelessTransmitter).get(); + } + + public void setWirelessTransmitter(final Supplier> supplier) { + this.wirelessTransmitter = 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 90700b7ac..c4da073cc 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 @@ -14,6 +14,7 @@ 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.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; @@ -109,6 +110,12 @@ public final class Blocks { ContentNames.CONSTRUCTOR, CABLE_LIKE_COLOR ); + private final BlockColorMap wirelessTransmitter = new BlockColorMap<>( + WirelessTransmitterBlock::new, + ContentIds.WIRELESS_TRANSMITTER, + ContentNames.WIRELESS_TRANSMITTER, + COLOR + ); @Nullable private Supplier quartzEnrichedIronBlock; @@ -218,4 +225,8 @@ public BlockColorMap getDestructor() { public BlockColorMap getConstructor() { return constructor; } + + public BlockColorMap getWirelessTransmitter() { + return wirelessTransmitter; + } } 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 4b7850122..1ea0d646c 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 @@ -44,6 +44,9 @@ public final class ContentIds { public static final ResourceLocation CONSTRUCTOR = createIdentifier("constructor"); public static final ResourceLocation WIRELESS_GRID = createIdentifier("wireless_grid"); public static final ResourceLocation CREATIVE_WIRELESS_GRID = createIdentifier("creative_wireless_grid"); + public static final ResourceLocation WIRELESS_TRANSMITTER = createIdentifier("wireless_transmitter"); + public static final ResourceLocation RANGE_UPGRADE = createIdentifier("range_upgrade"); + public static final ResourceLocation CREATIVE_RANGE_UPGRADE = createIdentifier("creative_range_upgrade"); 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 3feb4311d..f4227d9d3 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 @@ -17,6 +17,7 @@ public final class ContentNames { public static final MutableComponent CONTROLLER = createTranslation("block", "controller"); public static final MutableComponent CREATIVE_CONTROLLER = createTranslation("block", "creative_controller"); public static final MutableComponent WIRELESS_GRID = createTranslation("item", "wireless_grid"); + public static final MutableComponent WIRELESS_TRANSMITTER = createTranslation("block", "wireless_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 d4e9fff53..44508cd5b 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 @@ -4,6 +4,7 @@ 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.block.ControllerBlockItem; import java.util.Arrays; import java.util.function.Consumer; @@ -23,13 +24,16 @@ public static void append(final Consumer consumer) { private static void appendBlocks(final Consumer consumer) { final Consumer itemConsumer = item -> consumer.accept(new ItemStack(item)); - Items.INSTANCE.getAllControllers().stream().map(Supplier::get).forEach(itemConsumer); + Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(itemConsumer); + ControllerBlockItem.getAllAtCapacity().forEach(consumer); + Items.INSTANCE.getCreativeControllers().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getCables().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getImporters().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getExporters().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getExternalStorages().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getConstructors().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getDestructors().stream().map(Supplier::get).forEach(itemConsumer); + Items.INSTANCE.getWirelessTransmitters().stream().map(Supplier::get).forEach(itemConsumer); itemConsumer.accept(Blocks.INSTANCE.getDiskDrive()); appendBlockColors(consumer, Blocks.INSTANCE.getGrid()); appendBlockColors(consumer, Blocks.INSTANCE.getCraftingGrid()); @@ -86,6 +90,8 @@ private static void appendItems(final Consumer consumer) { itemConsumer.accept(Items.INSTANCE.getFortune3Upgrade()); itemConsumer.accept(Items.INSTANCE.getSilkTouchUpgrade()); itemConsumer.accept(Items.INSTANCE.getRegulatorUpgrade()); + itemConsumer.accept(Items.INSTANCE.getRangeUpgrade()); + itemConsumer.accept(Items.INSTANCE.getCreativeRangeUpgrade()); itemConsumer.accept(Items.INSTANCE.getWirelessGrid()); if (Platform.INSTANCE.getConfig().getWirelessGrid().getUseEnergy()) { consumer.accept(Items.INSTANCE.getWirelessGrid().getAtCapacity()); 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 2f2c93fb9..86f47ed85 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 @@ -34,12 +34,18 @@ public final class DefaultEnergyUsage { public static final long FORTUNE_3_UPGRADE = 14; public static final long SILK_TOUCH_UPGRADE = 16; public static final long REGULATOR_UPGRADE = 16; + public static final long RANGE_UPGRADE = 8; + public static final long CREATIVE_RANGE_UPGRADE = 0; + public static final int RANGE_UPGRADE_RANGE = 8; public static final long WIRELESS_GRID_CAPACITY = 1000; public static final long WIRELESS_GRID_OPEN = 5; public static final long WIRELESS_GRID_INSERT = 5; public static final long WIRELESS_GRID_EXTRACT = 5; + public static final long WIRELESS_TRANSMITTER = 16; + public static final int WIRELESS_TRANSMITTER_BASE_RANGE = 16; + private DefaultEnergyUsage() { } } 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 a6bf1c7b3..6734b231a 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 @@ -29,8 +29,8 @@ public final class Items { = new EnumMap<>(ItemStorageType.Variant.class); private final Map> fluidStorageDisks = new EnumMap<>(FluidStorageType.Variant.class); - private final List> regularControllers = new ArrayList<>(); - private final List> allControllers = new ArrayList<>(); + private final List> allControllers = new ArrayList<>(); + private final List> allCreativeControllers = new ArrayList<>(); private final List> allCables = new ArrayList<>(); private final List> allExporters = new ArrayList<>(); private final List> allImporters = new ArrayList<>(); @@ -38,6 +38,7 @@ public final class Items { private final List> allDetectors = new ArrayList<>(); private final List> allDestructors = new ArrayList<>(); private final List> allConstructors = new ArrayList<>(); + private final List> allWirelessTransmitters = new ArrayList<>(); @Nullable private Supplier quartzEnrichedIron; @Nullable @@ -70,6 +71,10 @@ public final class Items { @Nullable private Supplier regulatorUpgrade; @Nullable + private Supplier rangeUpgrade; + @Nullable + private Supplier creativeRangeUpgrade; + @Nullable private Supplier wirelessGrid; @Nullable private Supplier creativeWirelessGrid; @@ -165,21 +170,20 @@ public Item getDestructionCore() { return Objects.requireNonNull(destructionCore).get(); } - public void addController(final Supplier supplier) { - allControllers.add(supplier); + public void addCreativeController(final Supplier supplier) { + allCreativeControllers.add(supplier); } - public List> getAllControllers() { - return Collections.unmodifiableList(allControllers); + public List> getCreativeControllers() { + return Collections.unmodifiableList(allCreativeControllers); } - public void addRegularController(final Supplier supplier) { - addController(supplier); - regularControllers.add(supplier); + public void addController(final Supplier supplier) { + allControllers.add(supplier); } - public List> getRegularControllers() { - return Collections.unmodifiableList(regularControllers); + public List> getControllers() { + return Collections.unmodifiableList(allControllers); } public void addCable(final Supplier supplier) { @@ -238,6 +242,14 @@ public List> getConstructors() { return Collections.unmodifiableList(allConstructors); } + public void addWirelessTransmitter(final Supplier supplier) { + allWirelessTransmitters.add(supplier); + } + + public List> getWirelessTransmitters() { + return Collections.unmodifiableList(allWirelessTransmitters); + } + public Item getStorageHousing() { return Objects.requireNonNull(storageHousing).get(); } @@ -310,6 +322,22 @@ public void setRegulatorUpgrade(final Supplier re this.regulatorUpgrade = regulatorUpgrade; } + public AbstractUpgradeItem getRangeUpgrade() { + return Objects.requireNonNull(rangeUpgrade).get(); + } + + public void setRangeUpgrade(final Supplier rangeUpgrade) { + this.rangeUpgrade = rangeUpgrade; + } + + public AbstractUpgradeItem getCreativeRangeUpgrade() { + return Objects.requireNonNull(creativeRangeUpgrade).get(); + } + + public void setCreativeRangeUpgrade(final Supplier creativeRangeUpgrade) { + this.creativeRangeUpgrade = creativeRangeUpgrade; + } + public WirelessGridItem getWirelessGrid() { return Objects.requireNonNull(wirelessGrid).get(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java index 4c063bc99..881c21eec 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 @@ -7,6 +7,7 @@ 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.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; @@ -55,6 +56,8 @@ public final class Menus { private Supplier> constructor; @Nullable private Supplier> regulatorUpgrade; + @Nullable + private Supplier> wirelessTransmitter; private Menus() { } @@ -178,4 +181,12 @@ public MenuType getRegulatorUpgrade() { public void setRegulatorUpgrade(final Supplier> supplier) { this.regulatorUpgrade = supplier; } + + public MenuType getWirelessTransmitter() { + return Objects.requireNonNull(wirelessTransmitter).get(); + } + + public void setWirelessTransmitter(final Supplier> supplier) { + this.wirelessTransmitter = 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 eed52d99a..658435383 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 @@ -20,6 +20,7 @@ public final class Tags { public static final TagKey DETECTORS = createTag("detectors"); public static final TagKey CONSTRUCTORS = createTag("constructors"); public static final TagKey DESTRUCTORS = createTag("destructors"); + public static final TagKey WIRELESS_TRANSMITTERS = createTag("wireless_transmitters"); private Tags() { } 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/internal/grid/WirelessGrid.java index 718b18a73..86e5ef01e 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/internal/grid/WirelessGrid.java @@ -8,6 +8,7 @@ import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; 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.grid.GridWatchers; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -18,6 +19,7 @@ import com.refinedmods.refinedstorage2.api.storage.TrackedResourceAmount; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; @@ -48,11 +50,23 @@ private Optional getNetwork() { return Optional.empty(); } return Optional.ofNullable(server.getLevel(ctx.getNetworkReference().dimensionKey())) + .filter(level -> level.isLoaded(ctx.getNetworkReference().pos())) .map(level -> level.getBlockEntity(ctx.getNetworkReference().pos())) .filter(PlatformNetworkNodeContainer.class::isInstance) .map(PlatformNetworkNodeContainer.class::cast) .map(PlatformNetworkNodeContainer::getNode) - .map(NetworkNode::getNetwork); + .map(NetworkNode::getNetwork) + .filter(this::isInRange); + } + + private boolean isInRange(final Network network) { + return network.getComponent(GraphNetworkComponent.class) + .getContainers(WirelessTransmitter.class) + .stream() + .anyMatch(wirelessTransmitter -> wirelessTransmitter.isInRange( + ctx.getPlayerLevel(), + ctx.getPlayerPosition() + )); } private Optional getStorage() { 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/internal/grid/view/FluidGridResource.java index fa89652c7..ac68dd07b 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/internal/grid/view/FluidGridResource.java @@ -2,6 +2,7 @@ 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; @@ -22,7 +23,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.tooltip.TooltipComponent; -public class FluidGridResource extends AbstractGridResource { +public class FluidGridResource extends AbstractPlatformGridResource { private final FluidResource fluidResource; private final int id; 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/internal/grid/view/ItemGridResource.java index 0ecce143f..84729ae2c 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/internal/grid/view/ItemGridResource.java @@ -2,6 +2,7 @@ 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; @@ -26,7 +27,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -public class ItemGridResource extends AbstractGridResource { +public class ItemGridResource extends AbstractPlatformGridResource { private final int id; private final ItemStack itemStack; 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/internal/upgrade/BuiltinUpgradeDestinationsImpl.java new file mode 100644 index 000000000..9da555b11 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java @@ -0,0 +1,31 @@ +package com.refinedmods.refinedstorage2.platform.common.internal.upgrade; + +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; + +public class BuiltinUpgradeDestinationsImpl implements BuiltinUpgradeDestinations { + @Override + public UpgradeDestination getImporter() { + return UpgradeDestinations.IMPORTER; + } + + @Override + public UpgradeDestination getExporter() { + return UpgradeDestinations.EXPORTER; + } + + @Override + public UpgradeDestination getDestructor() { + return UpgradeDestinations.DESTRUCTOR; + } + + @Override + public UpgradeDestination getConstructor() { + return UpgradeDestinations.CONSTRUCTOR; + } + + @Override + public UpgradeDestination getWirelessTransmitter() { + return UpgradeDestinations.WIRELESS_TRANSMITTER; + } +} diff --git a/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/internal/upgrade/UpgradeDestinations.java index f39356117..0058a6aa9 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/internal/upgrade/UpgradeDestinations.java @@ -14,7 +14,9 @@ public enum UpgradeDestinations implements UpgradeDestination { IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().get(0).get())), EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().get(0).get())), DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().get(0).get())), - CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())); + CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())), + WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER, + () -> new ItemStack(Items.INSTANCE.getWirelessTransmitters().get(0).get())); private final Component name; private final Supplier stackFactory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java index fec2e3638..3e5a5749e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java @@ -8,9 +8,11 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; public class NetworkBoundItemContext { private final Player player; + private final Vec3 playerPosition; private final PlayerSlotReference playerSlotReference; private final ItemEnergyProvider energyProvider; @Nullable @@ -23,11 +25,24 @@ public NetworkBoundItemContext( @Nullable final NetworkReference networkReference ) { this.player = player; + // We copy the player position as it can change after opening the network bound item (opening while walking) + // and could cause the network not being accessible anymore (due to being out of range of a transmitter). + // If the network is no longer accessible, certain assumptions will break (e.g. grid watcher can no longer + // be removed after it was added). + this.playerPosition = new Vec3(player.position().x, player.position().y, player.position().z); this.playerSlotReference = playerSlotReference; this.energyProvider = energyProvider; this.networkReference = networkReference; } + public Vec3 getPlayerPosition() { + return playerPosition; + } + + public ResourceKey getPlayerLevel() { + return player.level().dimension(); + } + public boolean isActive() { if (!energyProvider.isEnabled()) { return true; 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/item/RangeUpgradeItem.java new file mode 100644 index 000000000..afe3894b4 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage2.platform.common.item; + +import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage2.platform.common.Platform; + +import net.minecraft.world.item.Item; + +// TODO: improved creative texture. +public class RangeUpgradeItem extends AbstractUpgradeItem { + private final boolean creative; + + public RangeUpgradeItem(final UpgradeRegistry registry, final boolean creative) { + super(new Item.Properties(), registry); + this.creative = creative; + } + + @Override + public long getEnergyUsage() { + if (creative) { + return Platform.INSTANCE.getConfig().getUpgrade().getCreativeRangeUpgradeEnergyUsage(); + } + return Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeEnergyUsage(); + } +} 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/item/block/ControllerBlockItem.java index fcc8dbc5b..25e4f4e15 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/item/block/ControllerBlockItem.java @@ -1,11 +1,15 @@ package com.refinedmods.refinedstorage2.platform.common.item.block; import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; +import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.Items; import java.util.List; import java.util.Optional; +import java.util.function.Supplier; +import java.util.stream.Stream; import javax.annotation.Nullable; import net.minecraft.ChatFormatting; @@ -18,6 +22,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createStoredWithCapacityTranslation; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; public class ControllerBlockItem extends CreativeControllerBlockItem { @@ -38,6 +43,24 @@ public static float getPercentFull(final ItemStack stack) { return (float) stored / (float) capacity; } + public ItemStack getAtCapacity() { + final long capacity = Platform.INSTANCE.getConfig().getController().getEnergyCapacity(); + final ItemStack result = new ItemStack(this); + final CompoundTag blockEntityData = new CompoundTag(); + ControllerBlockEntity.setStored(blockEntityData, capacity); + ControllerBlockEntity.setCapacity(blockEntityData, capacity); + setBlockEntityData(result, BlockEntities.INSTANCE.getController(), blockEntityData); + return result; + } + + public static Stream getAllAtCapacity() { + return Items.INSTANCE.getControllers().stream() + .map(Supplier::get) + .filter(ControllerBlockItem.class::isInstance) + .map(ControllerBlockItem.class::cast) + .map(ControllerBlockItem::getAtCapacity); + } + @Override public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(createTranslation("item", "controller.help"))); @@ -68,12 +91,8 @@ public void appendHoverText(final ItemStack stack, if (ControllerBlockEntity.hasEnergy(data)) { final long stored = ControllerBlockEntity.getStored(data); final long capacity = ControllerBlockEntity.getCapacity(data); - tooltip.add(createTranslation( - "misc", - "stored_with_capacity", - AmountFormatting.format(stored), - AmountFormatting.format(capacity) - ).withStyle(ChatFormatting.GRAY)); + tooltip.add(createStoredWithCapacityTranslation(stored, capacity, getPercentFull(stack)) + .withStyle(ChatFormatting.GRAY)); } } } 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/packet/ServerToClientCommunications.java index 97ae1970b..5022943f3 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/packet/ServerToClientCommunications.java @@ -13,6 +13,8 @@ public interface ServerToClientCommunications { void sendControllerEnergyInfo(ServerPlayer player, long stored, long capacity); + void sendWirelessTransmitterRange(ServerPlayer player, int range); + void sendGridActiveness(ServerPlayer player, boolean active); void sendGridUpdate(ServerPlayer player, 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/screen/WirelessTransmitterScreen.java new file mode 100644 index 000000000..f889a4c23 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java @@ -0,0 +1,50 @@ +package com.refinedmods.refinedstorage2.platform.common.screen; + +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 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; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +public class WirelessTransmitterScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/wireless_transmitter.png"); + + public WirelessTransmitterScreen(final WirelessTransmitterContainerMenu containerMenu, + final Inventory inventory, + final Component title) { + super(containerMenu, inventory, title); + this.inventoryLabelY = 43; + this.imageWidth = 211; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + graphics.drawString( + font, + createTranslation("gui", "wireless_transmitter.distance", getMenu().getRange()), + 28, + 25, + 4210752, + false + ); + } +} 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 f10b5053a..5242626a9 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 @@ -7,6 +7,7 @@ "block.refinedstorage2.grid": "Grid", "block.refinedstorage2.crafting_grid": "Crafting Grid", "block.refinedstorage2.controller": "Controller", + "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller", "block.refinedstorage2.creative_controller": "Creative Controller", "block.refinedstorage2.1k_storage_block": "1K Storage Block", "block.refinedstorage2.4k_storage_block": "4K Storage Block", @@ -25,6 +26,7 @@ "block.refinedstorage2.detector": "Detector", "block.refinedstorage2.constructor": "Constructor", "block.refinedstorage2.destructor": "Destructor", + "block.refinedstorage2.wireless_transmitter": "Wireless 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.", @@ -80,6 +82,7 @@ "gui.refinedstorage2.importer.filter_help": "The resources that may be imported from the target inventory.", "gui.refinedstorage2.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.", "gui.refinedstorage2.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.", + "gui.refinedstorage2.wireless_transmitter.distance": "%d block(s)", "gui.refinedstorage2.redstone_mode": "Redstone mode", "gui.refinedstorage2.redstone_mode.ignore": "Ignore", "gui.refinedstorage2.redstone_mode.ignore.help": "This device will always be active, regardless of redstone signal.", @@ -179,8 +182,11 @@ "item.refinedstorage2.fortune_upgrade.3": "Fortune III Upgrade", "item.refinedstorage2.regulator_upgrade": "Regulator Upgrade", "item.refinedstorage2.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.", + "item.refinedstorage2.range_upgrade": "Range Upgrade", + "item.refinedstorage2.creative_range_upgrade": "Creative Range Upgrade", "item.refinedstorage2.wireless_grid": "Wireless Grid", "item.refinedstorage2.creative_wireless_grid": "Creative Wireless Grid", + "item.refinedstorage2.wireless_transmitter.help": "Provides wireless network access for items like the Wireless Grid. Multiple are allowed in an area for wider coverage.", "item.refinedstorage2.network_item.unbound": "Unbound.", "item.refinedstorage2.network_item.unbound.help": "Use on any storage network device to bind.", "item.refinedstorage2.network_item.bound_to": "Bound to %d, %d, %d.", @@ -263,6 +269,9 @@ "text.autoconfig.refinedstorage2.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeRange": "Range Upgrade range", "text.autoconfig.refinedstorage2.option.iface": "Interface", "text.autoconfig.refinedstorage2.option.iface.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.externalStorage": "External Storage", @@ -273,6 +282,9 @@ "text.autoconfig.refinedstorage2.option.wirelessGrid.openEnergyUsage": "Open energy usage", "text.autoconfig.refinedstorage2.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", "text.autoconfig.refinedstorage2.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage2.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage2.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.wirelessTransmitter.baseRange": "Base range", "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", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json index d8525b1a0..2f98b8b0e 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json @@ -1,4 +1,5 @@ { + "render_type": "cutout", "parent": "block/cube", "elements": [ { 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 new file mode 100644 index 000000000..ecfb994fd --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json @@ -0,0 +1,234 @@ +{ + "render_type": "cutout", + "parent": "block/cube", + "ambientocclusion": false, + "textures": { + "particle": "refinedstorage2:block/wireless_transmitter/base", + "torch": "refinedstorage2:block/wireless_transmitter/base", + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/inactive" + }, + "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/item/creative_range_upgrade.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/creative_range_upgrade.json new file mode 100644 index 000000000..dbf07ee4e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/creative_range_upgrade.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/creative_range_upgrade" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json new file mode 100644 index 000000000..a5e8376b4 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/range_upgrade" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/base.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/base.png new file mode 100644 index 000000000..ba68cb972 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/base.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/black.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/black.png new file mode 100644 index 000000000..dbddddb8d Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/black.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/blue.png new file mode 100644 index 000000000..478a8a302 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/brown.png new file mode 100644 index 000000000..ce63d437d Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/brown.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/cyan.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/cyan.png new file mode 100644 index 000000000..13661765d Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/cyan.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/gray.png new file mode 100644 index 000000000..882771890 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/green.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/green.png new file mode 100644 index 000000000..bce4cff22 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/green.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/inactive.png new file mode 100644 index 000000000..b107779a2 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/inactive.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_blue.png new file mode 100644 index 000000000..2e4caed4a Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_gray.png new file mode 100644 index 000000000..3da038500 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/lime.png new file mode 100644 index 000000000..f97f56886 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/lime.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/magenta.png new file mode 100644 index 000000000..631b91da0 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/magenta.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/orange.png new file mode 100644 index 000000000..7d7536d3b Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/orange.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/pink.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/pink.png new file mode 100644 index 000000000..f727ec39b Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/pink.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/purple.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/purple.png new file mode 100644 index 000000000..160fd8ff3 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/purple.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/red.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/red.png new file mode 100644 index 000000000..95a1c5830 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/red.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/white.png new file mode 100644 index 000000000..7a6855188 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/white.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/yellow.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/yellow.png new file mode 100644 index 000000000..314330ada Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/yellow.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/wireless_transmitter.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/wireless_transmitter.png new file mode 100644 index 000000000..bd9fe3393 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/wireless_transmitter.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/creative_range_upgrade.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/creative_range_upgrade.png new file mode 100644 index 000000000..fb8f1da0e Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/creative_range_upgrade.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/range_upgrade.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/range_upgrade.png new file mode 100644 index 000000000..d1d7f1ac1 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/range_upgrade.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json index 605971517..29b9fe2e9 100644 --- a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json @@ -20,6 +20,9 @@ "items": [ "refinedstorage2:wireless_grid" ] + }, + { + "tag": "refinedstorage2:wireless_transmitters" } ] } diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/range_upgrade.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/range_upgrade.json new file mode 100644 index 000000000..7f20bcb19 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/range_upgrade.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EPE", + "PUP", + "EEE" + ], + "key": { + "E": { + "item": "refinedstorage2:quartz_enriched_iron" + }, + "P": { + "item": "minecraft:ender_pearl" + }, + "U": { + "item": "refinedstorage2:upgrade" + } + }, + "result": { + "item": "refinedstorage2:range_upgrade" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json new file mode 100644 index 000000000..52e8f90d1 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json @@ -0,0 +1,25 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EPE", + "EME", + "EAE" + ], + "key": { + "E": { + "item": "refinedstorage2:quartz_enriched_iron" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + }, + "M": { + "item": "refinedstorage2:machine_casing" + }, + "P": { + "item": "minecraft:ender_pearl" + } + }, + "result": { + "item": "refinedstorage2:wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java index 4845a2739..50e9fbff1 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 @@ -28,6 +28,7 @@ import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridUpdatePacket; 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; @@ -103,6 +104,7 @@ private void setRenderLayers() { setCutout(Blocks.INSTANCE.getDetector()); setCutout(Blocks.INSTANCE.getConstructor()); setCutout(Blocks.INSTANCE.getDestructor()); + setCutout(Blocks.INSTANCE.getWirelessTransmitter()); } private void setCutout(final BlockColorMap blockMap) { @@ -136,6 +138,9 @@ private void registerEmissiveModels() { Blocks.INSTANCE.getDestructor().forEach( (color, id, block) -> registerEmissiveDestructorModels(color, id) ); + Blocks.INSTANCE.getWirelessTransmitter().forEach( + (color, id, block) -> registerEmissiveWirelessTransmitterModels(color, id) + ); } private void registerEmissiveControllerModels(final DyeColor color) { @@ -202,12 +207,29 @@ private void registerEmissiveDestructorModels(final DyeColor color, final Resour EmissiveModelRegistry.INSTANCE.register(id, createIdentifier("block/destructor/cutouts/active")); } + private void registerEmissiveWirelessTransmitterModels(final DyeColor color, final ResourceLocation id) { + // Block + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/wireless_transmitter/" + color.getName()), + createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()) + ); + // Item + EmissiveModelRegistry.INSTANCE.register( + id, + createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()) + ); + } + private void registerPackets() { ClientPlayNetworking.registerGlobalReceiver(PacketIds.STORAGE_INFO_RESPONSE, new StorageInfoResponsePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_UPDATE, new GridUpdatePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_CLEAR, new GridClearPacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_ACTIVE, new GridActivePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.CONTROLLER_ENERGY_INFO, new ControllerEnergyInfoPacket()); + ClientPlayNetworking.registerGlobalReceiver( + PacketIds.WIRELESS_TRANSMITTER_RANGE, + new WirelessTransmitterRangePacket() + ); ClientPlayNetworking.registerGlobalReceiver(PacketIds.RESOURCE_SLOT_UPDATE, new ResourceSlotUpdatePacket()); } @@ -268,7 +290,7 @@ private void registerKeyBindings() { } private void registerModelPredicates() { - Items.INSTANCE.getRegularControllers().forEach(controllerBlockItem -> ItemPropertiesAccessor.register( + Items.INSTANCE.getControllers().forEach(controllerBlockItem -> ItemPropertiesAccessor.register( controllerBlockItem.get(), createIdentifier("stored_in_controller"), new ControllerModelPredicateProvider() 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 198f01772..58fa9635b 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 @@ -67,6 +67,9 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage2.p @ConfigEntry.Gui.CollapsibleObject private WirelessGridEntryImpl wirelessGrid = new WirelessGridEntryImpl(); + @ConfigEntry.Gui.CollapsibleObject + private WirelessTransmitterEntryImpl wirelessTransmitter = new WirelessTransmitterEntryImpl(); + public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); } @@ -151,6 +154,11 @@ public WirelessGridEntry getWirelessGrid() { return wirelessGrid; } + @Override + public WirelessTransmitterEntry getWirelessTransmitter() { + return wirelessTransmitter; + } + private static class GridEntryImpl implements GridEntry { private boolean largeFont = false; @@ -438,6 +446,12 @@ private static class UpgradeEntryImpl implements UpgradeEntry { private long regulatorUpgradeEnergyUsage = DefaultEnergyUsage.REGULATOR_UPGRADE; + private long rangeUpgradeEnergyUsage = DefaultEnergyUsage.RANGE_UPGRADE; + + private long creativeRangeUpgradeEnergyUsage = DefaultEnergyUsage.CREATIVE_RANGE_UPGRADE; + + private int rangeUpgradeRange = DefaultEnergyUsage.RANGE_UPGRADE_RANGE; + @Override public long getSpeedUpgradeEnergyUsage() { return speedUpgradeEnergyUsage; @@ -472,6 +486,21 @@ public long getSilkTouchUpgradeEnergyUsage() { public long getRegulatorUpgradeEnergyUsage() { return regulatorUpgradeEnergyUsage; } + + @Override + public long getRangeUpgradeEnergyUsage() { + return rangeUpgradeEnergyUsage; + } + + @Override + public long getCreativeRangeUpgradeEnergyUsage() { + return creativeRangeUpgradeEnergyUsage; + } + + @Override + public int getRangeUpgradeRange() { + return rangeUpgradeRange; + } } private static class WirelessGridEntryImpl implements WirelessGridEntry { @@ -510,4 +539,20 @@ public long getExtractEnergyUsage() { return extractEnergyUsage; } } + + private static class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { + private long energyUsage = DefaultEnergyUsage.WIRELESS_TRANSMITTER; + + private int baseRange = DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE; + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public int getBaseRange() { + return baseRange; + } + } } 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/integration/recipemod/rei/RefinedStorageREIClientPlugin.java index d14d4bda6..16c174845 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/integration/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -6,15 +6,22 @@ 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.item.block.ControllerBlockItem; import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import java.util.function.Supplier; +import java.util.stream.Collectors; + import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.CollapsibleEntryRegistry; import me.shedaniel.rei.api.client.registry.screen.ExclusionZones; import me.shedaniel.rei.api.client.registry.screen.ScreenRegistry; import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry; +import me.shedaniel.rei.api.common.entry.comparison.ItemComparatorRegistry; import me.shedaniel.rei.api.common.util.EntryIngredients; +import me.shedaniel.rei.api.common.util.EntryStacks; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.resources.ResourceLocation; @@ -22,6 +29,9 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + @Environment(EnvType.CLIENT) public class RefinedStorageREIClientPlugin implements REIClientPlugin { @Override @@ -42,6 +52,11 @@ public static void registerIngredientConverters() { PlatformApi.INSTANCE.registerIngredientConverter(new ResourceIngredientConverter()); } + @Override + public void registerItemComparators(final ItemComparatorRegistry registry) { + Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(registry::registerNbt); + } + @SuppressWarnings("UnstableApiUsage") @Override public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) { @@ -55,8 +70,23 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS); groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES); groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS); - groupItems(registry, Blocks.INSTANCE.getCreativeController(), - ContentIds.CREATIVE_CONTROLLER, Tags.CREATIVE_CONTROLLERS); + registry.group( + createIdentifier("fully_charged_controller"), + createTranslation("block", "controller.rei_fully_charged"), + ControllerBlockItem.getAllAtCapacity().map(EntryStacks::of).collect(Collectors.toList()) + ); + groupItems( + registry, + Blocks.INSTANCE.getCreativeController(), + ContentIds.CREATIVE_CONTROLLER, + Tags.CREATIVE_CONTROLLERS + ); + groupItems( + registry, + Blocks.INSTANCE.getWirelessTransmitter(), + ContentIds.WIRELESS_TRANSMITTER, + Tags.WIRELESS_TRANSMITTERS + ); } @Override 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/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java index 58b80da62..2a72c1593 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/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java @@ -54,7 +54,7 @@ public ExporterTransferStrategy create(final ServerLevel level, direction, amountOverride ); - final long transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) + final long transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? singleAmount * 64 : singleAmount; return create(fuzzyMode, insertTarget, transferQuota); 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/internal/network/node/importer/StorageImporterTransferStrategyFactory.java index 9498457f0..a8fb85eee 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/internal/network/node/importer/StorageImporterTransferStrategyFactory.java @@ -54,7 +54,7 @@ public ImporterTransferStrategy create(final ServerLevel level, return new ImporterTransferStrategyImpl<>( source, storageChannelType, - upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? singleAmount * 64 : singleAmount + upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? singleAmount * 64 : singleAmount ); } } 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 0a4984b97..59d290461 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 @@ -8,6 +8,7 @@ public final class PacketIds { public static final ResourceLocation STORAGE_INFO_RESPONSE = createIdentifier("storage_info_response"); public static final ResourceLocation STORAGE_INFO_REQUEST = createIdentifier("storage_info_request"); public static final ResourceLocation CONTROLLER_ENERGY_INFO = createIdentifier("controller_energy"); + public static final ResourceLocation WIRELESS_TRANSMITTER_RANGE = createIdentifier("wireless_transmitter_range"); public static final ResourceLocation GRID_ACTIVE = createIdentifier("grid_active"); public static final ResourceLocation GRID_UPDATE = createIdentifier("grid_update"); public static final ResourceLocation GRID_CLEAR = createIdentifier("grid_clear"); 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 e9b1997d4..cdb516b4e 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 @@ -28,6 +28,11 @@ public void sendControllerEnergyInfo(final ServerPlayer player, final long store }); } + @Override + public void sendWirelessTransmitterRange(final ServerPlayer player, final int range) { + sendToPlayer(player, PacketIds.WIRELESS_TRANSMITTER_RANGE, buf -> buf.writeInt(range)); + } + @Override public void sendGridActiveness(final ServerPlayer player, final boolean active) { sendToPlayer(player, PacketIds.GRID_ACTIVE, buf -> buf.writeBoolean(active)); 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 new file mode 100644 index 000000000..71916e1a2 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; + +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; + +public class WirelessTransmitterRangePacket implements ClientPlayNetworking.PlayChannelHandler { + @Override + public void receive(final Minecraft client, + final ClientPacketListener handler, + final FriendlyByteBuf buf, + final PacketSender responseSender) { + final int range = buf.readInt(); + client.execute(() -> { + if (client.player.containerMenu instanceof WirelessTransmitterContainerMenu containerMenu) { + containerMenu.setRange(range); + } + }); + } +} 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 a445c4e4f..68ce41a57 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 @@ -76,7 +76,7 @@ public > void } private static void registerModelPredicates() { - Items.INSTANCE.getRegularControllers().forEach(controllerBlockItem -> ItemProperties.register( + Items.INSTANCE.getControllers().forEach(controllerBlockItem -> ItemProperties.register( controllerBlockItem.get(), createIdentifier("stored_in_controller"), new ControllerModelPredicateProvider() 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 cb67f1fd6..06e681ee8 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 @@ -34,6 +34,7 @@ public class ConfigImpl implements Config { private final SimpleEnergyUsageEntry destructor; private final SimpleEnergyUsageEntry constructor; private final WirelessGridEntry wirelessGrid; + private final WirelessTransmitterEntry wirelessTransmitter; public ConfigImpl() { cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE); @@ -56,6 +57,7 @@ public ConfigImpl() { destructor = new SimpleEnergyUsageEntryImpl("destructor", "Destructor", DefaultEnergyUsage.DESTRUCTOR); constructor = new SimpleEnergyUsageEntryImpl("constructor", "Constructor", DefaultEnergyUsage.CONSTRUCTOR); wirelessGrid = new WirelessGridEntryImpl(); + wirelessTransmitter = new WirelessTransmitterEntryImpl(); spec = builder.build(); } @@ -143,6 +145,11 @@ public WirelessGridEntry getWirelessGrid() { return wirelessGrid; } + @Override + public WirelessTransmitterEntry getWirelessTransmitter() { + return wirelessTransmitter; + } + private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { private final ForgeConfigSpec.LongValue energyUsage; @@ -536,6 +543,9 @@ private class UpgradeEntryImpl implements UpgradeEntry { private final ForgeConfigSpec.LongValue fortune3UpgradeEnergyUsage; private final ForgeConfigSpec.LongValue silkTouchUpgradeEnergyUsage; private final ForgeConfigSpec.LongValue regulatorUpgradeEnergyUsage; + private final ForgeConfigSpec.LongValue rangeUpgradeEnergyUsage; + private final ForgeConfigSpec.LongValue creativeRangeUpgradeEnergyUsage; + private final ForgeConfigSpec.IntValue rangeUpgradeRange; UpgradeEntryImpl() { builder.push("upgrade"); @@ -560,6 +570,20 @@ private class UpgradeEntryImpl implements UpgradeEntry { regulatorUpgradeEnergyUsage = builder .comment("The additional energy used by the Regulator Upgrade") .defineInRange("regulatorUpgradeEnergyUsage", DefaultEnergyUsage.REGULATOR_UPGRADE, 0, Long.MAX_VALUE); + rangeUpgradeEnergyUsage = builder + .comment("The additional energy used by the Range Upgrade") + .defineInRange("rangeUpgradeEnergyUsage", DefaultEnergyUsage.RANGE_UPGRADE, 0, Long.MAX_VALUE); + creativeRangeUpgradeEnergyUsage = builder + .comment("The additional energy used by the Creative Range Upgrade") + .defineInRange( + "creativeRangeUpgradeEnergyUsage", + DefaultEnergyUsage.CREATIVE_RANGE_UPGRADE, + 0, + Long.MAX_VALUE + ); + rangeUpgradeRange = builder + .comment("The additional range by the Range Upgrade") + .defineInRange("rangeUpgradeRange", DefaultEnergyUsage.RANGE_UPGRADE_RANGE, 0, Integer.MAX_VALUE); builder.pop(); } @@ -597,6 +621,21 @@ public long getSilkTouchUpgradeEnergyUsage() { public long getRegulatorUpgradeEnergyUsage() { return regulatorUpgradeEnergyUsage.get(); } + + @Override + public long getRangeUpgradeEnergyUsage() { + return rangeUpgradeEnergyUsage.get(); + } + + @Override + public long getCreativeRangeUpgradeEnergyUsage() { + return creativeRangeUpgradeEnergyUsage.get(); + } + + @Override + public int getRangeUpgradeRange() { + return rangeUpgradeRange.get(); + } } private class WirelessGridEntryImpl implements WirelessGridEntry { @@ -640,4 +679,28 @@ public long getInsertEnergyUsage() { return insertEnergyUsage.get(); } } + + private class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { + private final ForgeConfigSpec.LongValue energyUsage; + private final ForgeConfigSpec.IntValue baseRange; + + WirelessTransmitterEntryImpl() { + builder.push("wirelessTransmitter"); + + energyUsage = builder.comment("The energy used by the Wireless Transmitter") + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.WIRELESS_TRANSMITTER, 0, Long.MAX_VALUE); + baseRange = builder.comment("The base range of the Wireless Transmitter") + .defineInRange("baseRange", DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE, 0, Integer.MAX_VALUE); + + builder.pop(); + } + + public long getEnergyUsage() { + return energyUsage.get(); + } + + public int getBaseRange() { + return baseRange.get(); + } + } } 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 c079da094..3b4a672b7 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 @@ -23,6 +23,7 @@ protected void registerModels() { registerGrids(Blocks.INSTANCE.getGrid(), "grid"); registerGrids(Blocks.INSTANCE.getCraftingGrid(), "crafting_grid"); registerDetectors(); + registerWirelessTransmitters(); } private void registerCables() { @@ -102,4 +103,11 @@ private void registerDetectors() { .texture("torch", torch); }); } + + 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) + .texture("cutout", createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()))); + } } 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 634ffef74..208e90ddd 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 @@ -5,6 +5,7 @@ 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; @@ -57,6 +58,7 @@ protected void registerStatesAndModels() { registerControllers(); registerGrids(); registerDetectors(); + registerWirelessTransmitters(); registerConstructorDestructors(Blocks.INSTANCE.getConstructor(), "constructor"); registerConstructorDestructors(Blocks.INSTANCE.getDestructor(), "destructor"); } @@ -201,6 +203,24 @@ private void registerDetectors() { }); } + private void registerWirelessTransmitters() { + final ModelFile inactive = modelFile(createIdentifier("block/wireless_transmitter/inactive")); + Blocks.INSTANCE.getWirelessTransmitter().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(WirelessTransmitterBlock.ACTIVE))) { + model.modelFile(modelFile(createIdentifier("block/wireless_transmitter/" + color.getName()))); + } else { + model.modelFile(inactive); + } + final Direction direction = blockState.getValue(DirectionTypeImpl.INSTANCE.getProperty()); + addRotation(model, direction); + return model.build(); + }); + }); + } + private void registerConstructorDestructors(final BlockColorMap blockMap, final String type) { blockMap.forEach((color, id, block) -> { final MultiPartBlockStateBuilder builder = addCableWithExtensions(block.get(), color); 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 43fdac7ea..67778356c 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 @@ -8,6 +8,7 @@ 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.content.BlockColorMap; @@ -40,6 +41,7 @@ protected void registerModels() { registerDetectors(); registerConstructors(); registerDestructors(); + registerWirelessTransmitters(); } private void registerCables() { @@ -168,6 +170,17 @@ private void registerDestructors() { )); } + private void registerWirelessTransmitters() { + final ResourceLocation base = createIdentifier("block/wireless_transmitter/inactive"); + final ColorMap blocks = Blocks.INSTANCE.getWirelessTransmitter(); + blocks.forEach((color, id, block) -> singleTexture( + id.getPath(), + base, + "cutout", + createIdentifier("block/wireless_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 c5b29c452..74947c19e 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 @@ -25,6 +25,7 @@ protected void generate() { Blocks.INSTANCE.getDetector().forEach((color, id, block) -> dropSelf(block.get())); 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())); } @Override @@ -38,6 +39,7 @@ protected Iterable getKnownBlocks() { blocks.addAll(Blocks.INSTANCE.getDetector().values()); blocks.addAll(Blocks.INSTANCE.getConstructor().values()); blocks.addAll(Blocks.INSTANCE.getDestructor().values()); + blocks.addAll(Blocks.INSTANCE.getWirelessTransmitter().values()); return blocks; } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java index 527390c15..9d6cd3443 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 @@ -54,6 +54,9 @@ protected void buildRecipes(final Consumer provider) { Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> recolorItems(Tags.DESTRUCTORS, block.get().asItem(), color) .save(provider, createIdentifier("coloring/" + color.getName() + "_destructor"))); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> + recolorItems(Tags.WIRELESS_TRANSMITTERS, block.get().asItem(), color) + .save(provider, createIdentifier("coloring/" + color.getName() + "_wireless_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 64f5711b5..7cd840ee3 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 @@ -32,6 +32,7 @@ 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.STORAGE_DISKS; +import static com.refinedmods.refinedstorage2.platform.common.content.Tags.WIRELESS_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.MOD_ID; public class ItemTagGenerator extends ItemTagsProvider { @@ -45,7 +46,7 @@ public ItemTagGenerator(final PackOutput packOutput, @Override protected void addTags(final HolderLookup.Provider provider) { addAllToTag(CABLES, Items.INSTANCE.getCables()); - addAllToTag(CONTROLLERS, Items.INSTANCE.getRegularControllers()); + addAllToTag(CONTROLLERS, Items.INSTANCE.getControllers()); addAllToTag(CREATIVE_CONTROLLERS, Blocks.INSTANCE.getCreativeController().values().stream() .map(Block::asItem) .map(c -> (Supplier) () -> c) @@ -94,6 +95,10 @@ protected void addTags(final HolderLookup.Provider provider) { Blocks.INSTANCE.getDestructor().values().stream() .map(block -> (Supplier) block::asItem) .toList()); + addAllToTag(WIRELESS_TRANSMITTERS, + Blocks.INSTANCE.getWirelessTransmitter().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/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java index 3c6836009..345c25822 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/integration/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -7,8 +7,11 @@ import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.ContentIds; import com.refinedmods.refinedstorage2.platform.common.content.Tags; +import com.refinedmods.refinedstorage2.platform.common.item.block.ControllerBlockItem; import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import java.util.stream.Collectors; + import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.CollapsibleEntryRegistry; import me.shedaniel.rei.api.client.registry.screen.ExclusionZones; @@ -21,6 +24,9 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + @REIPluginClient public class RefinedStorageREIClientPlugin implements REIClientPlugin { @Override @@ -54,8 +60,23 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS); groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES); groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS); - groupItems(registry, Blocks.INSTANCE.getCreativeController(), - ContentIds.CREATIVE_CONTROLLER, Tags.CREATIVE_CONTROLLERS); + registry.group( + createIdentifier("fully_charged_controller"), + createTranslation("block", "controller.rei_fully_charged"), + EntryIngredients.ofItemStacks(ControllerBlockItem.getAllAtCapacity().collect(Collectors.toSet())) + ); + groupItems( + registry, + Blocks.INSTANCE.getCreativeController(), + ContentIds.CREATIVE_CONTROLLER, + Tags.CREATIVE_CONTROLLERS + ); + groupItems( + registry, + Blocks.INSTANCE.getWirelessTransmitter(), + ContentIds.WIRELESS_TRANSMITTER, + Tags.WIRELESS_TRANSMITTERS + ); } @Override 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/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java index 2bcc807de..98cb6752b 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/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java @@ -33,7 +33,7 @@ public ExporterTransferStrategy create(final ServerLevel level, coordinates, amountOverride ); - final long transferQuota = (upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? 64 : 1) + final long transferQuota = (upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1) * Platform.INSTANCE.getBucketAmount(); if (fuzzyMode) { return new AbstractFuzzyExporterTransferStrategy<>(destination, StorageChannelTypes.FLUID, transferQuota) { 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/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java index fb1772b60..c4fd6e416 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/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java @@ -28,7 +28,7 @@ public ExporterTransferStrategy create(final ServerLevel level, final boolean fuzzyMode) { final InteractionCoordinatesImpl coordinates = new InteractionCoordinatesImpl(level, pos, direction); final ItemHandlerInsertableStorage destination = new ItemHandlerInsertableStorage(coordinates, amountOverride); - final int transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; if (fuzzyMode) { return new AbstractFuzzyExporterTransferStrategy<>(destination, StorageChannelTypes.ITEM, transferQuota) { @Nullable 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/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java index a1c92c282..c23b0a57e 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/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java @@ -28,7 +28,7 @@ public ImporterTransferStrategy create(final ServerLevel level, pos, direction ), amountOverride); - final int transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? FluidType.BUCKET_VOLUME * 64 : FluidType.BUCKET_VOLUME; return new ImporterTransferStrategyImpl<>(source, StorageChannelTypes.FLUID, transferQuota); 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/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java index 8de016083..d0091d49f 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/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java @@ -27,7 +27,7 @@ public ImporterTransferStrategy create(final ServerLevel level, pos, direction ), amountOverride); - final int transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; return new ImporterTransferStrategyImpl<>(source, StorageChannelTypes.ITEM, transferQuota); } } 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 e861a5b82..00eb6722a 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 @@ -17,6 +17,7 @@ import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridUpdatePacket; 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; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; @@ -46,6 +47,13 @@ public NetworkManager() { ControllerEnergyInfoPacket::decode, ControllerEnergyInfoPacket::handle ); + handler.registerMessage( + id++, + WirelessTransmitterRangePacket.class, + WirelessTransmitterRangePacket::encode, + WirelessTransmitterRangePacket::decode, + WirelessTransmitterRangePacket::handle + ); handler.registerMessage( id++, PropertyChangePacket.class, 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 8849e8f80..e96402395 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 @@ -25,6 +25,11 @@ public void sendControllerEnergyInfo(final ServerPlayer player, final long store networkManager.send(player, new ControllerEnergyInfoPacket(stored, capacity)); } + @Override + public void sendWirelessTransmitterRange(final ServerPlayer player, final int range) { + networkManager.send(player, new WirelessTransmitterRangePacket(range)); + } + @Override public void sendGridActiveness(final ServerPlayer player, final boolean active) { networkManager.send(player, new GridActivePacket(active)); 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 new file mode 100644 index 000000000..d751be18a --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java @@ -0,0 +1,39 @@ +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 java.util.function.Supplier; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraftforge.network.NetworkEvent; + +public class WirelessTransmitterRangePacket { + private final int range; + + public WirelessTransmitterRangePacket(final int range) { + this.range = range; + } + + public static WirelessTransmitterRangePacket decode(final FriendlyByteBuf buf) { + return new WirelessTransmitterRangePacket(buf.readInt()); + } + + public static void encode(final WirelessTransmitterRangePacket packet, final FriendlyByteBuf buf) { + buf.writeInt(packet.range); + } + + public static void handle(final WirelessTransmitterRangePacket 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 WirelessTransmitterRangePacket packet) { + final AbstractContainerMenu menu = player.containerMenu; + if (menu instanceof WirelessTransmitterContainerMenu containerMenu) { + containerMenu.setRange(packet.range); + } + } +}