From cb071db1e58d415e44537d7b00686badb58808ba Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Wed, 1 Nov 2023 13:03:14 +0100 Subject: [PATCH] feat: network transmitter The network transmitter now has an indicator on the block state whether the connection with the receiver is active. With not enough energy, it's inactive. Without network card or without connection, it's in errored state. Otherwise, it's in active state. The network transmitter will actively retry to reconnect if the connection is lost (for example due to chunk unloading). --- CHANGELOG.md | 6 + .../api/support/network/ConnectionSink.java | 4 +- .../black_network_transmitter.json | 13 + .../blockstates/blue_network_transmitter.json | 13 + .../brown_network_transmitter.json | 13 + .../blockstates/cyan_network_transmitter.json | 13 + .../blockstates/gray_network_transmitter.json | 13 + .../green_network_transmitter.json | 13 + .../light_gray_network_transmitter.json | 13 + .../blockstates/lime_network_transmitter.json | 13 + .../magenta_network_transmitter.json | 13 + .../blockstates/network_transmitter.json | 13 + .../orange_network_transmitter.json | 13 + .../blockstates/pink_network_transmitter.json | 13 + .../purple_network_transmitter.json | 13 + .../blockstates/red_network_transmitter.json | 13 + .../white_network_transmitter.json | 13 + .../yellow_network_transmitter.json | 13 + .../block/network_transmitter/black.json | 8 + .../block/network_transmitter/blue.json | 8 + .../block/network_transmitter/brown.json | 8 + .../block/network_transmitter/cyan.json | 8 + .../block/network_transmitter/error.json | 8 + .../block/network_transmitter/gray.json | 8 + .../block/network_transmitter/green.json | 8 + .../block/network_transmitter/inactive.json | 8 + .../block/network_transmitter/light_blue.json | 8 + .../block/network_transmitter/light_gray.json | 8 + .../block/network_transmitter/lime.json | 8 + .../block/network_transmitter/magenta.json | 8 + .../block/network_transmitter/orange.json | 8 + .../block/network_transmitter/pink.json | 8 + .../block/network_transmitter/purple.json | 8 + .../models/block/network_transmitter/red.json | 8 + .../block/network_transmitter/white.json | 8 + .../block/network_transmitter/yellow.json | 8 + .../item/black_network_transmitter.json | 6 + .../models/item/blue_network_transmitter.json | 6 + .../item/brown_network_transmitter.json | 6 + .../models/item/cyan_network_transmitter.json | 6 + .../models/item/gray_network_transmitter.json | 6 + .../item/green_network_transmitter.json | 6 + .../item/light_gray_network_transmitter.json | 6 + .../models/item/lime_network_transmitter.json | 6 + .../item/magenta_network_transmitter.json | 6 + .../models/item/network_transmitter.json | 6 + .../item/orange_network_transmitter.json | 6 + .../models/item/pink_network_transmitter.json | 6 + .../item/purple_network_transmitter.json | 6 + .../models/item/red_network_transmitter.json | 6 + .../item/white_network_transmitter.json | 6 + .../item/yellow_network_transmitter.json | 6 + .../coloring/black_network_transmitter.json | 33 +++ .../coloring/blue_network_transmitter.json | 33 +++ .../coloring/brown_network_transmitter.json | 33 +++ .../coloring/cyan_network_transmitter.json | 33 +++ .../coloring/gray_network_transmitter.json | 33 +++ .../coloring/green_network_transmitter.json | 33 +++ .../light_blue_network_transmitter.json | 33 +++ .../light_gray_network_transmitter.json | 33 +++ .../coloring/lime_network_transmitter.json | 33 +++ .../coloring/magenta_network_transmitter.json | 33 +++ .../coloring/orange_network_transmitter.json | 33 +++ .../coloring/pink_network_transmitter.json | 33 +++ .../coloring/purple_network_transmitter.json | 33 +++ .../coloring/red_network_transmitter.json | 33 +++ .../coloring/white_network_transmitter.json | 33 +++ .../coloring/yellow_network_transmitter.json | 33 +++ .../blocks/black_network_transmitter.json | 20 ++ .../blocks/blue_network_transmitter.json | 20 ++ .../blocks/brown_network_transmitter.json | 20 ++ .../blocks/cyan_network_transmitter.json | 20 ++ .../blocks/gray_network_transmitter.json | 20 ++ .../blocks/green_network_transmitter.json | 20 ++ .../light_gray_network_transmitter.json | 20 ++ .../blocks/lime_network_transmitter.json | 20 ++ .../blocks/magenta_network_transmitter.json | 20 ++ .../blocks/network_transmitter.json | 20 ++ .../blocks/orange_network_transmitter.json | 20 ++ .../blocks/pink_network_transmitter.json | 20 ++ .../blocks/purple_network_transmitter.json | 20 ++ .../blocks/red_network_transmitter.json | 20 ++ .../blocks/white_network_transmitter.json | 20 ++ .../blocks/yellow_network_transmitter.json | 20 ++ .../coloring/black_network_transmitter.json | 15 ++ .../coloring/blue_network_transmitter.json | 15 ++ .../coloring/brown_network_transmitter.json | 15 ++ .../coloring/cyan_network_transmitter.json | 15 ++ .../coloring/gray_network_transmitter.json | 15 ++ .../coloring/green_network_transmitter.json | 15 ++ .../light_blue_network_transmitter.json | 15 ++ .../light_gray_network_transmitter.json | 15 ++ .../coloring/lime_network_transmitter.json | 15 ++ .../coloring/magenta_network_transmitter.json | 15 ++ .../coloring/orange_network_transmitter.json | 15 ++ .../coloring/pink_network_transmitter.json | 15 ++ .../coloring/purple_network_transmitter.json | 15 ++ .../coloring/red_network_transmitter.json | 15 ++ .../coloring/white_network_transmitter.json | 15 ++ .../coloring/yellow_network_transmitter.json | 15 ++ .../tags/items/network_transmitters.json | 20 ++ .../common/AbstractClientModInitializer.java | 2 + .../common/AbstractModInitializer.java | 24 +- .../platform/common/Config.java | 2 + .../common/content/BlockEntities.java | 22 +- .../platform/common/content/Blocks.java | 11 + .../platform/common/content/ContentIds.java | 1 + .../platform/common/content/ContentNames.java | 1 + .../common/content/CreativeModeTabItems.java | 1 + .../common/content/DefaultEnergyUsage.java | 1 + .../platform/common/content/Items.java | 11 +- .../common/content/MenuTypeFactory.java | 1 + .../platform/common/content/Menus.java | 11 + .../platform/common/content/Tags.java | 1 + .../controller/ControllerBlockEntity.java | 21 +- .../common/networking/NetworkCardItem.java | 52 ++-- .../networking/NetworkReceiverBlock.java | 12 +- .../NetworkReceiverBlockEntity.java | 28 +++ .../common/networking/NetworkReceiverKey.java | 35 +++ .../networking/NetworkTransmitterBlock.java | 66 ++++++ .../NetworkTransmitterBlockEntity.java | 222 ++++++++++++++++++ .../NetworkTransmitterBlockEntityTicker.java | 25 ++ .../NetworkTransmitterContainerMenu.java | 98 ++++++++ .../networking/NetworkTransmitterScreen.java | 48 ++++ .../networking/NetworkTransmitterState.java | 20 ++ .../networking/NetworkTransmitterStatus.java | 13 + .../support/ServerToClientCommunications.java | 3 + .../network/ConnectionProviderImpl.java | 3 + .../support/network/ConnectionSinkImpl.java | 8 +- .../common/upgrade/UpgradeContainer.java | 3 +- .../assets/refinedstorage2/lang/en_us.json | 11 +- .../block/network_transmitter/base.png | Bin 0 -> 701 bytes .../network_transmitter/cutouts/black.png | Bin 0 -> 2958 bytes .../network_transmitter/cutouts/blue.png | Bin 0 -> 2975 bytes .../network_transmitter/cutouts/brown.png | Bin 0 -> 2976 bytes .../network_transmitter/cutouts/cyan.png | Bin 0 -> 2984 bytes .../network_transmitter/cutouts/error.png | Bin 0 -> 622 bytes .../network_transmitter/cutouts/gray.png | Bin 0 -> 2967 bytes .../network_transmitter/cutouts/green.png | Bin 0 -> 2986 bytes .../network_transmitter/cutouts/inactive.png | Bin 0 -> 270 bytes .../cutouts/light_blue.png | Bin 0 -> 342 bytes .../cutouts/light_gray.png | Bin 0 -> 2961 bytes .../network_transmitter/cutouts/lime.png | Bin 0 -> 2983 bytes .../network_transmitter/cutouts/magenta.png | Bin 0 -> 2976 bytes .../network_transmitter/cutouts/orange.png | Bin 0 -> 2951 bytes .../network_transmitter/cutouts/pink.png | Bin 0 -> 2933 bytes .../network_transmitter/cutouts/purple.png | Bin 0 -> 2982 bytes .../block/network_transmitter/cutouts/red.png | Bin 0 -> 2966 bytes .../network_transmitter/cutouts/white.png | Bin 0 -> 2950 bytes .../network_transmitter/cutouts/yellow.png | Bin 0 -> 2960 bytes .../textures/gui/network_transmitter.png | Bin 0 -> 1899 bytes .../advancements/no_cables_required.json | 34 +++ .../recipes/network_transmitter.json | 31 +++ .../fabric/ClientModInitializerImpl.java | 26 ++ .../platform/fabric/ConfigImpl.java | 10 + .../platform/fabric/packet/PacketIds.java | 1 + .../s2c/NetworkTransmitterStatusPacket.java | 28 +++ .../s2c/ServerToClientCommunicationsImpl.java | 9 + .../rei/RefinedStorageREIClientPlugin.java | 6 + .../platform/forge/ConfigImpl.java | 11 + .../forge/datagen/BlockModelProvider.java | 21 ++ .../forge/datagen/BlockStateProvider.java | 20 ++ .../forge/datagen/ItemModelProvider.java | 13 + .../forge/datagen/loot/BlockDropProvider.java | 2 + .../forge/datagen/loot/LootTableProvider.java | 6 +- .../recipe/RecoloringRecipeProvider.java | 3 + .../forge/datagen/tag/ItemTagGenerator.java | 5 + .../platform/forge/packet/NetworkManager.java | 8 + .../s2c/NetworkTransmitterStatusPacket.java | 43 ++++ .../s2c/ServerToClientCommunicationsImpl.java | 6 + .../rei/RefinedStorageREIClientPlugin.java | 6 + 171 files changed, 2548 insertions(+), 64 deletions(-) create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png create mode 100755 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png create mode 100644 refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json create mode 100644 refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json create mode 100644 refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java create mode 100644 refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java diff --git a/CHANGELOG.md b/CHANGELOG.md index d65be6e46..28a9b5fd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Configuration Card. It copies device configurations and can transfer upgrades. - Network Receiver - Network Card +- Network Transmitter + +### Changed + +- The Network Transmitter now goes into an "errored" state if there is no connection (anymore) with the Network Receiver (due to chunk unloading for example). +- The Network Transmitter will actively try to reconnect with the Network Receiver if connection is lost. ### Fixed diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java index e7baa0690..b8094e38f 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java @@ -2,10 +2,12 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.GlobalPos; import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.2") -@FunctionalInterface public interface ConnectionSink { + void tryConnect(GlobalPos pos); + void tryConnectInSameDimension(BlockPos pos, Direction incomingDirection); } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json new file mode 100644 index 000000000..c85efd707 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/black" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json new file mode 100644 index 000000000..26d0a4788 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/blue" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json new file mode 100644 index 000000000..7308e85d6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/brown" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json new file mode 100644 index 000000000..7c93cab21 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/cyan" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json new file mode 100644 index 000000000..004f915c9 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/gray" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json new file mode 100644 index 000000000..ed8ae4451 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/green" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json new file mode 100644 index 000000000..6bef823bb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/light_gray" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json new file mode 100644 index 000000000..6962c78ff --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/lime" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json new file mode 100644 index 000000000..a9cfe5a30 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/magenta" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json new file mode 100644 index 000000000..49484a53f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/light_blue" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json new file mode 100644 index 000000000..46030998b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/orange" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json new file mode 100644 index 000000000..5c7009994 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/pink" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json new file mode 100644 index 000000000..d1def1e5b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/purple" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json new file mode 100644 index 000000000..efaf94767 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/red" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json new file mode 100644 index 000000000..3019869df --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/white" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json new file mode 100644 index 000000000..e18ebc477 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/yellow" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json new file mode 100644 index 000000000..0f8886928 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/black", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json new file mode 100644 index 000000000..6ce433dea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/blue", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json new file mode 100644 index 000000000..d59d72fe1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/brown", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json new file mode 100644 index 000000000..edb07ae19 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/cyan", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json new file mode 100644 index 000000000..bde24ffc1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/error", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json new file mode 100644 index 000000000..e2a9d7adb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/gray", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json new file mode 100644 index 000000000..2a02cc52e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/green", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json new file mode 100644 index 000000000..3d57239b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/inactive", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json new file mode 100644 index 000000000..af0723908 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_blue", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json new file mode 100644 index 000000000..b6c0f2ad4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_gray", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json new file mode 100644 index 000000000..40dcbaff2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/lime", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json new file mode 100644 index 000000000..6026f8131 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/magenta", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json new file mode 100644 index 000000000..4a982bb88 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/orange", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json new file mode 100644 index 000000000..6789f6949 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/pink", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json new file mode 100644 index 000000000..7963ee4fc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/purple", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json new file mode 100644 index 000000000..47c6d2a06 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/red", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json new file mode 100644 index 000000000..c534f78e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/white", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json new file mode 100644 index 000000000..3054b74fd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/yellow", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json new file mode 100644 index 000000000..8a95bdad0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json new file mode 100644 index 000000000..5d4bcba6f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json new file mode 100644 index 000000000..b4b236ff4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json new file mode 100644 index 000000000..b6d2d901e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json new file mode 100644 index 000000000..044b5ed1e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json new file mode 100644 index 000000000..7def81806 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json new file mode 100644 index 000000000..79961be77 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json new file mode 100644 index 000000000..d82a2cba6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json new file mode 100644 index 000000000..f3f93d427 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json new file mode 100644 index 000000000..a81a65c0f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json new file mode 100644 index 000000000..5272d4ab9 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json new file mode 100644 index 000000000..d78d47f94 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json new file mode 100644 index 000000000..ddad1fd12 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json new file mode 100644 index 000000000..969a2ee85 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json new file mode 100644 index 000000000..8596e093f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json new file mode 100644 index 000000000..6c4c3dcfd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json new file mode 100644 index 000000000..d62881c05 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/black_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/black_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json new file mode 100644 index 000000000..5fb93f8d0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/blue_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/blue_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json new file mode 100644 index 000000000..f8472f93e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/brown_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/brown_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json new file mode 100644 index 000000000..212262dfe --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/cyan_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/cyan_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json new file mode 100644 index 000000000..003794319 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/gray_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/gray_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json new file mode 100644 index 000000000..5944c16a4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/green_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/green_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json new file mode 100644 index 000000000..f194d254d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_blue_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_blue_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json new file mode 100644 index 000000000..691df5431 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_gray_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_gray_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json new file mode 100644 index 000000000..27e675c29 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/lime_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/lime_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json new file mode 100644 index 000000000..6cdba8303 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/magenta_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/magenta_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json new file mode 100644 index 000000000..bcf7a5a24 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/orange_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/orange_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json new file mode 100644 index 000000000..cbb5dbab7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/pink_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/pink_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json new file mode 100644 index 000000000..aba85fa45 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/purple_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/purple_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json new file mode 100644 index 000000000..178e31944 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/red_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/red_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json new file mode 100644 index 000000000..e173f3582 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/white_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/white_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json new file mode 100644 index 000000000..68a1b2078 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/yellow_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/yellow_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json new file mode 100644 index 000000000..f925deda4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:black_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/black_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json new file mode 100644 index 000000000..44656ecfa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:blue_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/blue_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json new file mode 100644 index 000000000..4e548e328 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:brown_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/brown_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json new file mode 100644 index 000000000..f92f09225 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:cyan_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/cyan_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json new file mode 100644 index 000000000..b4ad2b8f3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:gray_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/gray_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json new file mode 100644 index 000000000..954149bde --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:green_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/green_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json new file mode 100644 index 000000000..48e4801ea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:light_gray_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/light_gray_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json new file mode 100644 index 000000000..eed497cfa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:lime_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/lime_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json new file mode 100644 index 000000000..15777c802 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:magenta_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/magenta_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json new file mode 100644 index 000000000..80d86c15b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json new file mode 100644 index 000000000..5bab22f68 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:orange_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/orange_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json new file mode 100644 index 000000000..70c0580c8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:pink_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/pink_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json new file mode 100644 index 000000000..71e632a40 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:purple_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/purple_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json new file mode 100644 index 000000000..d891359c3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:red_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/red_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json new file mode 100644 index 000000000..4c1bdc48a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:white_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/white_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json new file mode 100644 index 000000000..14549c329 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:yellow_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/yellow_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json new file mode 100644 index 000000000..36b859db6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:black_dye" + } + ], + "result": { + "item": "refinedstorage2:black_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json new file mode 100644 index 000000000..a4e2bd0a0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:blue_dye" + } + ], + "result": { + "item": "refinedstorage2:blue_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json new file mode 100644 index 000000000..e7c68912d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:brown_dye" + } + ], + "result": { + "item": "refinedstorage2:brown_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json new file mode 100644 index 000000000..f84a9cfba --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:cyan_dye" + } + ], + "result": { + "item": "refinedstorage2:cyan_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json new file mode 100644 index 000000000..70a07df91 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:gray_dye" + } + ], + "result": { + "item": "refinedstorage2:gray_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json new file mode 100644 index 000000000..df1b74eb0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:green_dye" + } + ], + "result": { + "item": "refinedstorage2:green_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json new file mode 100644 index 000000000..b1479d3a7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:light_blue_dye" + } + ], + "result": { + "item": "refinedstorage2:network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json new file mode 100644 index 000000000..f47ee6865 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:light_gray_dye" + } + ], + "result": { + "item": "refinedstorage2:light_gray_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json new file mode 100644 index 000000000..695ac7837 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:lime_dye" + } + ], + "result": { + "item": "refinedstorage2:lime_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json new file mode 100644 index 000000000..83e87448e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:magenta_dye" + } + ], + "result": { + "item": "refinedstorage2:magenta_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json new file mode 100644 index 000000000..2a883881c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:orange_dye" + } + ], + "result": { + "item": "refinedstorage2:orange_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json new file mode 100644 index 000000000..45cca06c1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:pink_dye" + } + ], + "result": { + "item": "refinedstorage2:pink_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json new file mode 100644 index 000000000..936c7bb9a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:purple_dye" + } + ], + "result": { + "item": "refinedstorage2:purple_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json new file mode 100644 index 000000000..c0640bffb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:red_dye" + } + ], + "result": { + "item": "refinedstorage2:red_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json new file mode 100644 index 000000000..c793b5352 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:white_dye" + } + ], + "result": { + "item": "refinedstorage2:white_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json new file mode 100644 index 000000000..6b0da48b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:yellow_dye" + } + ], + "result": { + "item": "refinedstorage2:yellow_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json new file mode 100644 index 000000000..5e6f46c32 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage2:white_network_transmitter", + "refinedstorage2:orange_network_transmitter", + "refinedstorage2:magenta_network_transmitter", + "refinedstorage2:network_transmitter", + "refinedstorage2:yellow_network_transmitter", + "refinedstorage2:lime_network_transmitter", + "refinedstorage2:pink_network_transmitter", + "refinedstorage2:gray_network_transmitter", + "refinedstorage2:light_gray_network_transmitter", + "refinedstorage2:cyan_network_transmitter", + "refinedstorage2:purple_network_transmitter", + "refinedstorage2:blue_network_transmitter", + "refinedstorage2:brown_network_transmitter", + "refinedstorage2:green_network_transmitter", + "refinedstorage2:red_network_transmitter", + "refinedstorage2:black_network_transmitter" + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java index 0e872f7cb..1cbb0567b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java @@ -18,6 +18,7 @@ import com.refinedmods.refinedstorage2.platform.common.grid.screen.hint.FluidGridInsertionHint; import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceScreen; import com.refinedmods.refinedstorage2.platform.common.importer.ImporterScreen; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterScreen; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveScreen; import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageScreen; import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockScreen; @@ -57,6 +58,7 @@ protected static void registerScreens(final ScreenRegistration registration) { registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::new); registration.register(Menus.INSTANCE.getStorageMonitor(), StorageMonitorScreen::new); + registration.register(Menus.INSTANCE.getNetworkTransmitter(), NetworkTransmitterScreen::new); } protected static void registerAlternativeGridHints() { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java index 2a48a9695..a7db7f229 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java @@ -52,6 +52,9 @@ import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; import com.refinedmods.refinedstorage2.platform.common.misc.WrenchItem; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItem; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; @@ -133,6 +136,7 @@ import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.ITEM_STORAGE_BLOCK; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.MACHINE_CASING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.NETWORK_RECEIVER; +import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.NETWORK_TRANSMITTER; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.PROCESSOR_BINDING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON_BLOCK; @@ -274,6 +278,7 @@ protected final void registerBlocks( Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); Blocks.INSTANCE.setStorageMonitor(callback.register(STORAGE_MONITOR, StorageMonitorBlock::new)); Blocks.INSTANCE.getNetworkReceiver().registerBlocks(callback); + Blocks.INSTANCE.getNetworkTransmitter().registerBlocks(callback); } protected final void registerItems( @@ -296,6 +301,7 @@ protected final void registerItems( Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); Blocks.INSTANCE.getNetworkReceiver().registerItems(callback, Items.INSTANCE::addNetworkReceiver); + Blocks.INSTANCE.getNetworkTransmitter().registerItems(callback, Items.INSTANCE::addNetworkTransmitter); registerStorageItems(callback); registerUpgrades(callback, regulatorUpgradeItemSupplier); Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, wirelessGridItemSupplier)); @@ -573,12 +579,14 @@ protected final void registerBlockEntities( )); BlockEntities.INSTANCE.setNetworkReceiver(callback.register( NETWORK_RECEIVER, - () -> typeFactory.create((pos, state) -> new NetworkNodeContainerBlockEntityImpl<>( - BlockEntities.INSTANCE.getNetworkReceiver(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) - ), Blocks.INSTANCE.getNetworkReceiver().toArray()) + () -> typeFactory.create(NetworkReceiverBlockEntity::new, Blocks.INSTANCE.getNetworkReceiver().toArray()) + )); + BlockEntities.INSTANCE.setNetworkTransmitter(callback.register( + NETWORK_TRANSMITTER, + () -> typeFactory.create( + NetworkTransmitterBlockEntity::new, + Blocks.INSTANCE.getNetworkTransmitter().toArray() + ) )); } @@ -652,6 +660,10 @@ protected final void registerMenus(final RegistryCallback> callback, STORAGE_MONITOR, () -> menuTypeFactory.create(StorageMonitorContainerMenu::new) )); + Menus.INSTANCE.setNetworkTransmitter(callback.register( + NETWORK_TRANSMITTER, + () -> menuTypeFactory.create(NetworkTransmitterContainerMenu::new) + )); } protected final void registerLootFunctions(final RegistryCallback callback) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java index 25635fec4..8e20884c5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java @@ -48,6 +48,8 @@ public interface Config { SimpleEnergyUsageEntry getNetworkReceiver(); + SimpleEnergyUsageEntry getNetworkTransmitter(); + interface SimpleEnergyUsageEntry { long getEnergyUsage(); } 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 bdeba8d02..e6ba28b83 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java @@ -10,6 +10,8 @@ import com.refinedmods.refinedstorage2.platform.common.grid.GridBlockEntity; import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlockEntity; import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; @@ -66,7 +68,9 @@ public final class BlockEntities { @Nullable private Supplier> storageMonitor; @Nullable - private Supplier>> networkReceiver; + private Supplier> networkReceiver; + @Nullable + private Supplier> networkTransmitter; private BlockEntities() { } @@ -211,13 +215,21 @@ public void setStorageMonitor(final Supplier> getNetworkReceiver() { + public BlockEntityType getNetworkReceiver() { return Objects.requireNonNull(networkReceiver).get(); } - public void setNetworkReceiver( - final Supplier>> supplier - ) { + public void setNetworkReceiver(final Supplier> supplier) { this.networkReceiver = supplier; } + + public BlockEntityType getNetworkTransmitter() { + return Objects.requireNonNull(networkTransmitter).get(); + } + + public void setNetworkTransmitter( + final Supplier> supplier + ) { + this.networkTransmitter = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java index d8c8ac8ea..a4697c046 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java @@ -13,6 +13,7 @@ import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlock; import com.refinedmods.refinedstorage2.platform.common.networking.CableBlock; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveBlock; @@ -124,6 +125,12 @@ public final class Blocks { ContentNames.NETWORK_RECEIVER, COLOR ); + private final BlockColorMap networkTransmitter = new BlockColorMap<>( + NetworkTransmitterBlock::new, + ContentIds.NETWORK_TRANSMITTER, + ContentNames.NETWORK_TRANSMITTER, + COLOR + ); @Nullable private Supplier quartzEnrichedIronBlock; @@ -251,4 +258,8 @@ public StorageMonitorBlock getStorageMonitor() { public BlockColorMap getNetworkReceiver() { return networkReceiver; } + + public BlockColorMap getNetworkTransmitter() { + return networkTransmitter; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java index 291f8bf78..60a9b1567 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java @@ -51,6 +51,7 @@ public final class ContentIds { public static final ResourceLocation CONFIGURATION_CARD = createIdentifier("configuration_card"); public static final ResourceLocation NETWORK_RECEIVER = createIdentifier("network_receiver"); public static final ResourceLocation NETWORK_CARD = createIdentifier("network_card"); + public static final ResourceLocation NETWORK_TRANSMITTER = createIdentifier("network_transmitter"); private ContentIds() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java index 32a2e65d8..f5a5b4e1a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java @@ -23,6 +23,7 @@ public final class ContentNames { public static final MutableComponent INTERFACE = createTranslation("block", "interface"); public static final MutableComponent DISK_DRIVE = createTranslation("block", "disk_drive"); public static final MutableComponent NETWORK_RECEIVER = createTranslation("block", "network_receiver"); + public static final MutableComponent NETWORK_TRANSMITTER = createTranslation("block", "network_transmitter"); private ContentNames() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java index 52ca3656b..cce630748 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java @@ -47,6 +47,7 @@ private static void appendBlocks(final Consumer consumer) { itemConsumer.accept(Blocks.INSTANCE.getMachineCasing()); itemConsumer.accept(Blocks.INSTANCE.getQuartzEnrichedIronBlock()); itemConsumer.accept(Blocks.INSTANCE.getStorageMonitor()); + Items.INSTANCE.getNetworkTransmitters().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getNetworkReceivers().stream().map(Supplier::get).forEach(itemConsumer); } 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 733a39e42..041f44474 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java @@ -15,6 +15,7 @@ public final class DefaultEnergyUsage { public static final long DISK_DRIVE_PER_DISK = 4; public static final long STORAGE_MONITOR = 4; public static final long NETWORK_RECEIVER = 8; + public static final long NETWORK_TRANSMITTER = 32; public static final long CONTROLLER_CAPACITY = 1000; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java index 13fca80df..019ed46b0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java @@ -40,6 +40,7 @@ public final class Items { private final List> allConstructors = new ArrayList<>(); private final List> allWirelessTransmitters = new ArrayList<>(); private final List> allNetworkReceivers = new ArrayList<>(); + private final List> allNetworkTransmitters = new ArrayList<>(); @Nullable private Supplier quartzEnrichedIron; @Nullable @@ -374,7 +375,15 @@ public void addNetworkReceiver(final Supplier supplier) { public List> getNetworkReceivers() { return Collections.unmodifiableList(allNetworkReceivers); } - + + public void addNetworkTransmitter(final Supplier supplier) { + allNetworkTransmitters.add(supplier); + } + + public List> getNetworkTransmitters() { + return Collections.unmodifiableList(allNetworkTransmitters); + } + public Item getNetworkCard() { return Objects.requireNonNull(networkCard).get(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java index 4cc4029e7..901b772ec 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java @@ -9,6 +9,7 @@ public interface MenuTypeFactory { MenuType create(MenuSupplier supplier); + @FunctionalInterface interface MenuSupplier { T create(int syncId, Inventory playerInventory, FriendlyByteBuf data); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java index c859f54f9..d737dcb21 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java @@ -10,6 +10,7 @@ import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceContainerMenu; import com.refinedmods.refinedstorage2.platform.common.importer.ImporterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockContainerMenu; @@ -61,6 +62,8 @@ public final class Menus { private Supplier> wirelessTransmitter; @Nullable private Supplier> storageMonitor; + @Nullable + private Supplier> networkTransmitter; private Menus() { } @@ -200,4 +203,12 @@ public MenuType getStorageMonitor() { public void setStorageMonitor(final Supplier> supplier) { this.storageMonitor = supplier; } + + public MenuType getNetworkTransmitter() { + return Objects.requireNonNull(networkTransmitter).get(); + } + + public void setNetworkTransmitter(final Supplier> supplier) { + this.networkTransmitter = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java index cc62023c7..be33cae1e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java @@ -22,6 +22,7 @@ public final class Tags { public static final TagKey DESTRUCTORS = createTag("destructors"); public static final TagKey WIRELESS_TRANSMITTERS = createTag("wireless_transmitters"); public static final TagKey NETWORK_RECEIVERS = createTag("network_receivers"); + public static final TagKey NETWORK_TRANSMITTERS = createTag("network_transmitters"); private Tags() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java index 1a108b3d8..b7e8d79ed 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java @@ -61,24 +61,17 @@ private static BlockEntityType getBlockEntityType(final C : BlockEntities.INSTANCE.getController(); } - void updateEnergyTypeInLevel(final BlockState state) { - final ControllerEnergyType currentEnergyType = ControllerEnergyType.ofState(getNode().getState()); - final ControllerEnergyType inLevelEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); - - if (currentEnergyType != inLevelEnergyType && energyStateChangeRateLimiter.tryAcquire()) { + public void updateEnergyTypeInLevel(final BlockState state) { + final ControllerEnergyType currentEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); + final ControllerEnergyType newEnergyType = ControllerEnergyType.ofState(getNode().getState()); + if (newEnergyType != currentEnergyType && level != null && energyStateChangeRateLimiter.tryAcquire()) { LOGGER.debug( "Energy type state change for controller at {}: {} -> {}", getBlockPos(), - inLevelEnergyType, - currentEnergyType + currentEnergyType, + newEnergyType ); - updateEnergyTypeInLevel(state, currentEnergyType); - } - } - - private void updateEnergyTypeInLevel(final BlockState state, final ControllerEnergyType energyType) { - if (level != null) { - level.setBlockAndUpdate(getBlockPos(), state.setValue(ControllerBlock.ENERGY_TYPE, energyType)); + level.setBlockAndUpdate(getBlockPos(), state.setValue(ControllerBlock.ENERGY_TYPE, newEnergyType)); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java index e4833d59b..825ede85c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java @@ -8,9 +8,13 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -23,6 +27,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; +import static com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverKey.getDimensionName; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; // TODO: better active texture. @@ -52,16 +57,18 @@ public InteractionResult useOn(final UseOnContext ctx) { } final CompoundTag tag = new CompoundTag(); tag.putLong(TAG_POS, pos.asLong()); - tag.putString(TAG_DIMENSION, ctx.getLevel().dimension().location().toString()); + final ResourceKey dimension = ctx.getLevel().dimension(); + tag.putString(TAG_DIMENSION, dimension.location().toString()); ctx.getItemInHand().setTag(tag); ctx.getPlayer().sendSystemMessage(createTranslation( "item", "network_card.bound", pos.getX(), pos.getY(), - pos.getZ() + pos.getZ(), + getDimensionName(dimension).withStyle(ChatFormatting.YELLOW) )); - return InteractionResult.SUCCESS; + return InteractionResult.CONSUME; } @Override @@ -81,29 +88,36 @@ public void appendHoverText(final ItemStack stack, final List lines, final TooltipFlag flag) { super.appendHoverText(stack, level, lines, flag); - if (!isActive(stack)) { - lines.add(UNBOUND); - return; - } - final BlockPos pos = getPosition(stack); - if (pos == null) { - return; - } - lines.add(createTranslation( + getLocation(stack).ifPresentOrElse(location -> lines.add(createTranslation( "item", "network_card.bound", - pos.getX(), - pos.getY(), - pos.getZ() - ).withStyle(ChatFormatting.GRAY)); + location.pos().getX(), + location.pos().getY(), + location.pos().getZ(), + getDimensionName(location.dimension()).withStyle(ChatFormatting.YELLOW) + ).withStyle(ChatFormatting.GRAY)), () -> lines.add(UNBOUND)); } @Nullable - public BlockPos getPosition(final ItemStack stack) { - if (stack.getTag() == null) { + private ResourceKey getDimension(final String dimensionKey) { + final ResourceLocation name = ResourceLocation.tryParse(dimensionKey); + if (name == null) { return null; } - return BlockPos.of(stack.getTag().getLong(TAG_POS)); + return ResourceKey.create(Registries.DIMENSION, name); + } + + Optional getLocation(final ItemStack stack) { + final CompoundTag tag = stack.getTag(); + if (tag == null) { + return Optional.empty(); + } + final ResourceKey dimension = getDimension(tag.getString(TAG_DIMENSION)); + if (dimension == null) { + return Optional.empty(); + } + final BlockPos pos = BlockPos.of(tag.getLong(TAG_POS)); + return Optional.of(GlobalPos.of(dimension, pos)); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java index 34c436b5c..4bb7ea7c3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java @@ -1,7 +1,5 @@ package com.refinedmods.refinedstorage2.platform.common.networking; -import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; @@ -9,7 +7,6 @@ import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import javax.annotation.Nullable; @@ -29,7 +26,7 @@ public class NetworkReceiverBlock extends AbstractColoredBlock implements EntityBlock { public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); - private static final AbstractBlockEntityTicker> TICKER = + private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getNetworkReceiver, ACTIVE); public NetworkReceiverBlock(final DyeColor color, final MutableComponent name) { @@ -55,12 +52,7 @@ public BlockColorMap getBlockColorMap() { @Nullable @Override public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new NetworkNodeContainerBlockEntityImpl<>( - BlockEntities.INSTANCE.getNetworkReceiver(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) - ); + return new NetworkReceiverBlockEntity(pos, state); } @Nullable diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java new file mode 100644 index 000000000..920d77dc4 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class NetworkReceiverBlockEntity extends NetworkNodeContainerBlockEntityImpl { + public NetworkReceiverBlockEntity(final BlockPos pos, final BlockState state) { + super( + BlockEntities.INSTANCE.getNetworkReceiver(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) + ); + } + + @Nullable + @Override + public Object createKey() { + return new NetworkReceiverKey(getContainerPosition()); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java new file mode 100644 index 000000000..447079c36 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; + +record NetworkReceiverKey(GlobalPos pos) { + int getDistance(final BlockPos from) { + return (int) Math.sqrt( + Math.pow(from.getX() - pos.pos().getX(), 2) + + Math.pow(from.getY() - pos.pos().getY(), 2) + + Math.pow(from.getZ() - pos.pos().getZ(), 2) + ); + } + + MutableComponent getDimensionName() { + return getDimensionName(pos.dimension()); + } + + static MutableComponent getDimensionName(final ResourceKey dimension) { + if (dimension == Level.OVERWORLD) { + return Component.literal("Overworld"); + } else if (dimension == Level.END) { + return Component.literal("The End"); + } else if (dimension == Level.NETHER) { + return Component.literal("The Nether"); + } + return Component.translatable( + "dimension.%s.%s".formatted(dimension.location().getNamespace(), dimension.location().getPath()) + ); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java new file mode 100644 index 000000000..95798f579 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java @@ -0,0 +1,66 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; +import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.EnumProperty; + +public class NetworkTransmitterBlock extends AbstractColoredBlock implements EntityBlock { + public static final EnumProperty STATE = EnumProperty.create( + "state", + NetworkTransmitterState.class + ); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkTransmitterBlockEntityTicker(); + + public NetworkTransmitterBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected BlockState getDefaultState() { + return super.getDefaultState().setValue(STATE, NetworkTransmitterState.INACTIVE); + } + + @Override + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(STATE); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getNetworkTransmitter(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new NetworkTransmitterBlockEntity(blockPos, blockState); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java new file mode 100644 index 000000000..826600d74 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java @@ -0,0 +1,222 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.Network; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; +import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +// TODO: better error texture and better active texture with animation? Reuse controller textures? +public class NetworkTransmitterBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements ExtendedMenuProvider, BlockEntityWithDrops { + private static final Logger LOGGER = LoggerFactory.getLogger(NetworkTransmitterBlockEntity.class); + + private static final NetworkTransmitterStatus INACTIVE = NetworkTransmitterStatus.message( + createTranslation("gui", "network_transmitter.status.inactive") + ); + private static final NetworkTransmitterStatus MISSING_NETWORK_CARD = NetworkTransmitterStatus.error( + createTranslation("gui", "network_transmitter.status.missing_network_card").withStyle(ChatFormatting.DARK_RED) + ); + private static final NetworkTransmitterStatus RECEIVER_UNREACHABLE = NetworkTransmitterStatus.error( + createTranslation("gui", "network_transmitter.status.receiver_unreachable").withStyle(ChatFormatting.DARK_RED) + ); + + private static final String TAG_NETWORK_CARD_INVENTORY = "nc"; + + private final SimpleContainer networkCardInventory = new SimpleContainer(1) { + @Override + public boolean canPlaceItem(final int slot, final ItemStack stack) { + return stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack); + } + }; + private final RateLimiter stateChangeRateLimiter = RateLimiter.create(1); + private final RateLimiter networkRebuildRetryRateLimiter = RateLimiter.create(1 / 5D); + + @Nullable + private NetworkReceiverKey receiverKey; + + public NetworkTransmitterBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getNetworkTransmitter(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getNetworkTransmitter().getEnergyUsage() + )); + networkCardInventory.addListener(container -> { + setChanged(); + updateReceiverLocation(); + if (level != null) { + LOGGER.info("Network card was changed at {}, sending network update", worldPosition); + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + }); + } + + @Override + protected void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + if (level == null) { + return; + } + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + + public void updateStateInLevel(final BlockState state) { + final NetworkTransmitterState currentState = state.getValue(NetworkTransmitterBlock.STATE); + final NetworkTransmitterState newState = getState(); + if (currentState != newState && level != null && stateChangeRateLimiter.tryAcquire()) { + LOGGER.info("Updating network transmitter at {} from {} to {}", worldPosition, currentState, newState); + level.setBlockAndUpdate(worldPosition, state.setValue(NetworkTransmitterBlock.STATE, newState)); + } + } + + private NetworkTransmitterState getState() { + if (!isActive()) { + return NetworkTransmitterState.INACTIVE; + } + if (receiverKey == null) { + return NetworkTransmitterState.ERROR; + } + final Network network = getNode().getNetwork(); + if (network == null) { + return NetworkTransmitterState.ERROR; + } + final boolean receiverFound = isReceiverFoundInNetwork(network, receiverKey); + return receiverFound ? NetworkTransmitterState.ACTIVE : NetworkTransmitterState.ERROR; + } + + NetworkTransmitterStatus getStatus() { + final Network network = getNode().getNetwork(); + if (!isActive() || network == null || level == null) { + return INACTIVE; + } + if (receiverKey == null) { + return MISSING_NETWORK_CARD; + } + final boolean receiverFound = isReceiverFoundInNetwork(network, receiverKey); + if (!receiverFound) { + return RECEIVER_UNREACHABLE; + } + final boolean showDistance = level.dimension() == receiverKey.pos().dimension(); + final MutableComponent message = showDistance ? createTranslation( + "gui", + "network_transmitter.status.transmitting", + receiverKey.getDistance(worldPosition)) : receiverKey.getDimensionName(); + return NetworkTransmitterStatus.message(message); + } + + @Override + public void doWork() { + super.doWork(); + if (!isActive() || getNode().getNetwork() == null || receiverKey == null) { + return; + } + final boolean receiverFound = isReceiverFoundInNetwork(getNode().getNetwork(), receiverKey); + if (!receiverFound && networkRebuildRetryRateLimiter.tryAcquire()) { + tryReconnectingWithReceiver(); + } + } + + private void tryReconnectingWithReceiver() { + if (level == null) { + return; + } + LOGGER.info( + "Receiver {} was not found in network for transmitter at {}, retrying and sending network update", + receiverKey, + worldPosition + ); + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + + private static boolean isReceiverFoundInNetwork(final Network network, final NetworkReceiverKey key) { + return network.getComponent(GraphNetworkComponent.class).getContainer(key) != null; + } + + Container getNetworkCardInventory() { + return networkCardInventory; + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + tag.put(TAG_NETWORK_CARD_INVENTORY, networkCardInventory.createTag()); + } + + @Override + public void load(final CompoundTag tag) { + super.load(tag); + if (tag.contains(TAG_NETWORK_CARD_INVENTORY)) { + networkCardInventory.fromTag(tag.getList(TAG_NETWORK_CARD_INVENTORY, Tag.TAG_COMPOUND)); + } + updateReceiverLocation(); + } + + private void updateReceiverLocation() { + final ItemStack stack = networkCardInventory.getItem(0); + if (stack.isEmpty()) { + receiverKey = null; + } else if (stack.getItem() instanceof NetworkCardItem cardItem) { + receiverKey = cardItem.getLocation(stack).map(NetworkReceiverKey::new).orElse(null); + } + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new NetworkTransmitterContainerMenu(syncId, inventory, this); + } + + @Override + public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { + final NetworkTransmitterStatus status = getStatus(); + buf.writeBoolean(status.error()); + buf.writeComponent(status.message()); + } + + @Override + public Component getDisplayName() { + return ContentNames.NETWORK_TRANSMITTER; + } + + @Override + public NonNullList getDrops() { + return NonNullList.of(ItemStack.EMPTY, networkCardInventory.getItem(0)); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + super.addOutgoingConnections(sink); + if (receiverKey != null && isActive()) { + sink.tryConnect(receiverKey.pos()); + } + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java new file mode 100644 index 000000000..dde4d9e96 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; + +public class NetworkTransmitterBlockEntityTicker + extends NetworkNodeBlockEntityTicker { + NetworkTransmitterBlockEntityTicker() { + super(BlockEntities.INSTANCE::getNetworkTransmitter); + } + + @Override + public void tick(final Level level, + final BlockPos pos, + final BlockState state, + final NetworkTransmitterBlockEntity blockEntity) { + super.tick(level, pos, state, blockEntity); + blockEntity.updateStateInLevel(state); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java new file mode 100644 index 000000000..812c6083b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java @@ -0,0 +1,98 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class NetworkTransmitterContainerMenu extends AbstractBaseContainerMenu { + @Nullable + private final NetworkTransmitterBlockEntity blockEntity; + private final Player player; + private final RateLimiter statusUpdateRateLimiter = RateLimiter.create(2); + private NetworkTransmitterStatus status; + + NetworkTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final NetworkTransmitterBlockEntity blockEntity) { + super(Menus.INSTANCE.getNetworkTransmitter(), syncId); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + blockEntity::getRedstoneMode, + blockEntity::setRedstoneMode + )); + this.blockEntity = blockEntity; + this.player = playerInventory.player; + this.status = blockEntity.getStatus(); + addSlots(playerInventory, blockEntity.getNetworkCardInventory()); + } + + public NetworkTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final FriendlyByteBuf buf) { + super(Menus.INSTANCE.getNetworkTransmitter(), syncId); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.blockEntity = null; + this.player = playerInventory.player; + this.status = new NetworkTransmitterStatus(buf.readBoolean(), buf.readComponent()); + addSlots(playerInventory, new SimpleContainer(1)); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + if (blockEntity == null || !(player instanceof ServerPlayer serverPlayer)) { + return; + } + if (!statusUpdateRateLimiter.tryAcquire()) { + return; + } + final NetworkTransmitterStatus newStatus = blockEntity.getStatus(); + if (newStatus.message().equals(status.message())) { + return; + } + updateStatus(serverPlayer, newStatus); + } + + private void updateStatus(final ServerPlayer serverPlayer, final NetworkTransmitterStatus newStatus) { + this.status = newStatus; + Platform.INSTANCE.getServerToClientCommunications().sendNetworkTransmitterStatus( + serverPlayer, + newStatus + ); + } + + private void addSlots(final Inventory playerInventory, final Container networkCardInventory) { + addPlayerInventory(playerInventory, 8, 55); + addSlot(new ValidatedSlot( + networkCardInventory, + 0, + 8, + 20, + stack -> stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack) + )); + transferManager.addBiTransfer(playerInventory, networkCardInventory); + } + + NetworkTransmitterStatus getStatus() { + return status; + } + + public void setStatus(final NetworkTransmitterStatus status) { + this.status = status; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java new file mode 100644 index 000000000..b3790ec10 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java @@ -0,0 +1,48 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +public class NetworkTransmitterScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/network_transmitter.png"); + + public NetworkTransmitterScreen(final NetworkTransmitterContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 42; + this.imageWidth = 176; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + final NetworkTransmitterStatus status = getMenu().getStatus(); + final int displayTextX = 51; + if (status.error()) { + graphics.blit(TextureIds.ICONS, displayTextX, 23, 246, 148, 10, 10); + } + graphics.drawString(font, status.message(), displayTextX + (status.error() ? (10 + 4) : 0), 25, 4210752, false); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java new file mode 100644 index 000000000..f8ce3cc2f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.util.StringRepresentable; + +public enum NetworkTransmitterState implements StringRepresentable { + ACTIVE("active"), + ERROR("error"), + INACTIVE("inactive"); + + private final String name; + + NetworkTransmitterState(final String name) { + this.name = name; + } + + @Override + public String getSerializedName() { + return name; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java new file mode 100644 index 000000000..4fc4aa4ed --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.network.chat.Component; + +public record NetworkTransmitterStatus(boolean error, Component message) { + static NetworkTransmitterStatus error(final Component message) { + return new NetworkTransmitterStatus(true, message); + } + + static NetworkTransmitterStatus message(final Component message) { + return new NetworkTransmitterStatus(false, message); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java index 3ebb2ec52..2aab8e7b1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java @@ -4,6 +4,7 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import java.util.UUID; import javax.annotation.Nullable; @@ -30,4 +31,6 @@ void sendResourceSlotUpdate(ServerPlayer player, int slotIndex); void sendStorageInfoResponse(ServerPlayer player, UUID id, StorageInfo storageInfo); + + void sendNetworkTransmitterStatus(ServerPlayer player, NetworkTransmitterStatus status); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java index d8238dfa0..cd33c72e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java @@ -100,6 +100,9 @@ private PlatformNetworkNodeContainer getConnection(final PlatformNetworkNodeCont if (!(connectionBlockEntity instanceof PlatformNetworkNodeContainer connectionContainer)) { return null; } + if (connection.incomingDirection() == null) { + return connectionContainer; + } final boolean acceptsIncomingDirection = connectionContainer.canAcceptIncomingConnection( connection.incomingDirection(), from.getContainerBlockState() diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java index 36024462d..e75182f34 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.Set; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -21,12 +22,17 @@ Set getConnections() { return connections; } + @Override + public void tryConnect(final GlobalPos pos) { + connections.add(new Connection(pos, null)); + } + @Override public void tryConnectInSameDimension(final BlockPos pos, final Direction incomingDirection) { final GlobalPos globalPos = GlobalPos.of(source.dimension(), pos); connections.add(new Connection(globalPos, incomingDirection)); } - record Connection(GlobalPos pos, Direction incomingDirection) { + record Connection(GlobalPos pos, @Nullable Direction incomingDirection) { } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java index f64e3f91f..d7c0833fe 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java @@ -26,8 +26,7 @@ public class UpgradeContainer extends SimpleContainer implements UpgradeState { private final UpgradeRegistry registry; private final Object2IntMap index = new Object2IntOpenHashMap<>(); - public UpgradeContainer(final UpgradeDestination destination, - final UpgradeRegistry registry) { + public UpgradeContainer(final UpgradeDestination destination, final UpgradeRegistry registry) { this(destination, registry, () -> { }); } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json index b90e3d6b4..6d4759f1a 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json @@ -29,6 +29,7 @@ "block.refinedstorage2.wireless_transmitter": "Wireless Transmitter", "block.refinedstorage2.storage_monitor": "Storage Monitor", "block.refinedstorage2.network_receiver": "Network Receiver", + "block.refinedstorage2.network_transmitter": "Network Transmitter", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -132,6 +133,10 @@ "gui.refinedstorage2.filter_slot.right_click_for": "Right click for", "gui.refinedstorage2.filter_slot.click_to_clear": "Click to clear", "gui.refinedstorage2.regulator_upgrade.filter_help": "The resource that should be regulated in the target.", + "gui.refinedstorage2.network_transmitter.status.inactive": "Inactive", + "gui.refinedstorage2.network_transmitter.status.missing_network_card": "Missing Network Card", + "gui.refinedstorage2.network_transmitter.status.transmitting": "%d block(s)", + "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "Unreachable", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -208,7 +213,7 @@ "item.refinedstorage2.network_card.unbound_help": "Use while crouching on a Network Receiver.", "item.refinedstorage2.network_card.unbound": "Unbound.", "item.refinedstorage2.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", - "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d.", + "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d in %s.", "misc.refinedstorage2.stored": "Stored: %s", "misc.refinedstorage2.stored_with_capacity": "Stored: %s / %s (%d%%)", "misc.refinedstorage2.total": "%d total", @@ -343,5 +348,7 @@ "advancements.refinedstorage2.wireless": "Wireless", "advancements.refinedstorage2.wireless.description": "Access your resources wirelessly with a Wireless Grid.", "advancements.refinedstorage2.better_than_a_barrel": "Better than a barrel", - "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network" + "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", + "advancements.refinedstorage2.no_cables_required": "No cables required", + "advancements.refinedstorage2.no_cables_required.description": "Add extra components to your network without using cables by using a Network Transmitter, Network Receiver and Network Card" } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png new file mode 100644 index 0000000000000000000000000000000000000000..9e4f2df055631673dd373c566b8d6be18d860866 GIT binary patch literal 701 zcmV;u0z&Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;2FkAZe8V00J#ZL_t(IPfb%>i?LA{^@q52K8~}PVHnJa zoDbtngG6$nTqu&%T!@P)l8edzd*)lKUVZ9mzwfr!+Rs|+c~v%>P3(5N7>!2J>-Azb zn^_KrgL?*pf%{lZCX;BjTE6RaI`qfv{Gq5gZ5vB%jZ-L;e8*Fz0eP zNvG42NF-R%Xq5Hx@c5kDACU%q!b9U2Gi#bS}`YPF&tAV*>(0DGg+;DK;BOb;OAcs$Z|)ONci z`1|{t6N(v##bO+3dH~ZfWnQmWLZQ%OXrLE!0*L@B&xjjyz)?m^qtQs9zgDYCrBb0B z=={F`etUb9Y&J_Ey2WQe0vJ>%6bOdfkOQ3x7;$AX8G>;$CK2z95w3y>X}}KTbyBe4j^D*8}Ri&A{h2On(F`clvbB?^L4L3}8s+6q!1tmo`4iA|bN?ZDj5 z|DFHxo&W#OIXtwZe@*AQPLAW&3=U+6>AQ>Ft8S;yhb~`*^tC!1*cEf!9o_8i;AW29 z%W<6*FF%@$=C<1?D5oF}9FnS)LyG3O&0A_AMEgj>JEY+G8R6omp9#E&Gs1|TlXGD& zDS89@BeHYW=al0d#zF8Q%t%LsM7HvMM9lEBv?$-a!x!wmAH zxgowchzM__WD&`-!kbnK7@B6tn|MW5WJ%T~poqY*Wz7aA-@F8BEyAunoZZ&6MgKBF zF-byOlB(5es;Z`fs2~B$vLsoN6h)*6F`n=fSQGtteM>`@#3=H@#0z|$X@pKNmShC# zX(NPk*jDSuO`0fSQVoU@NXaauIuN5aE*y(Wb>kRGq(sWZPhyG%Z7gLemutfpRa-8% z(Q(o@PCaVIwkSHzPlQAoCUGzpA<{QaEv|1l7AM1Gj+zxrr||aVuoxskTnv^Vp)FoO zMdGeg~Od(e*)=p!d^YKGxx5Qv!QNVH7N5G@7jq6`#_6aWm_ z!L9k(0FAMvV)GmIg#$!&v{%E{beU)laz%hFON5rDiI$_KMK`UaHSC%wjg6MJrz4M+ zI4sTA%DloLPLxhn8%wQZ`N zx(Zo+WdzV19A&9m8fy%iicBvFuxC@gYZ>{R_!-}$6e|MH^2M&(-$`2+b->VdRd0?D zc{NfR&3crzxZwy5zdoZb*|ku@IvJ}_d%%ln&P_CX%}!Ejew94FUX(UOjSvvaPC^%` zG3+g}z$>G&F~3?Ql&tGyZ37kuZc>F2=_yc#m#qqEDd%H2etp-0sR0=nM073H5Ot!- zqND1jXrwLV$f`mJFk7Kt>$++Kjh0cXhHk|5CatIl{Q{wzkR;rAFp#*i>LQ1hmt}|$ zXbP(~Riw$Rsfuixma%9si#CLt91IHlaT3i-tPn5mjm;yv|Zr;M|;a=+{(J)wZ(Fi7fE6Vghm^X{@o!O|JeqU z+t}LFH(q&*j;Yf=Z#W{*S$RU8wtdxARNXLio%gN#Pcteey1nQ&j+(T`Sg)9ub%5X_(a#C z!c_L$Eo+Zns$4pKp|U;m$`|R8Ll^pS*Q3W)=`U3O-1GhGkE}iY-~-&-8&Y36clT}0 zo}8UN@$75g-E->rrnA|N2WQvK?tbt6H@ZLSEdDTS{U-kM%^&xjy7JtmkJo>F`S?i3 z3Z>ww}q#{UaB95Bzjx^_CM)m8Z`HzVBe1H Jhgd<*;30I+C+?Z?!CJm*`1lr zOuJi1F+mL)5loanfFb_SNJJAM#uzaukv}G=AsFL>1fRrcLZS)yAmF|G>Q-CYpiD9| z_wn6x&OPTl=iaA#dphU0E^3X%V)MJZ(tYf|fWIws*th++tBC#P`dtHIEH>{J{?3Z+ zJJ1%3wGKJi{-{5*-ojonj)-T|c)92^bS$=fW!Xn~3ylPu<{dXBUU>JoC^#e~ZqhPx z#_ynmPS@6eZrs|F#ap*vlZY!<2+PYB6HufP63WGb8(QU*SdnY7HXoKmp#q7vq{P)+ zq0pb{6*|0t3VK`ySe6yRFyl~9By{;+L6H?%k~Ik`0P2>Uu%IE-9+7DaNY3g@udC@| zy_7f@MZP6TrBW$gQsZ8bm!N5ylB`II0vG~>qi%%CzzrAIC8TMH1ILdX&lR{tWP8I= zN@SK+w@~yOV%@OjCgw1yjC={kWxk~fkl+T+9}Wr?fT0+h6EU@EGu zXojv6Xw=uIJv_`w#n)H!i+GsHXhg$;kf5Y$n1Ip*0!f-MK~lj6kd*{B3{9gpRO`|< z1P)7aRA`pUts+cfjwW>#6C0?+pdd+@RVK9gMT*KHxzSp!*+_?Kt%4&|lF~xBx&_SHNr_k+ zb|wk%%v@O&TNl)4>o}OHq_g{-W z=TOBBP4}ky5W9@=X5$vfI*ofIby?m9?3UO$@Ao^|4f9NQdUZDW?8)a(J$ho*txq0b z*1i7n{R?0IbjJ(vvHdGv^S(RMa%I&^y%}Xu{@CWF1DV2yYd*R7^&HX89&X<^F#Eah59RhezQ1Spk^bA?KXmcTS7YaYShC@p)9tg*UFtbD{Nk*g z(laZ|PAvA>D=k0X(f8Ju+R>}+c-!8Co%>Srhb}(#_U_=F_ul+y|C(R&haQkl41E6Q fir_-&%B+W4?;9&Fyu62Bp}W`iq~BQc$d11O3zpLZ literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png new file mode 100644 index 0000000000000000000000000000000000000000..fb4d506cb954fc2abf2c4d23dc5565543e69d142 GIT binary patch literal 2976 zcmcImduSX*7{9cd+S5Y8Dq=ymTT7#MZg=**ORgp68WZ(uOs;K;qR#Hj-mSgc-R^F3 zm;6hsTA}d@edKj*0xp(Qg!BDNo>-DY8Uo3-*3Lh zZ@%xFd2n#kjmy$krcv}Ev&4vY@t3#6QS-yuEFSs0vU5P_snEf;!i{cxo-et~HeFYuciJS-zAc zp(O~_YBf`pGeJ}oplO={kTaJB}}NHP=Fbcg;WP(r;Q6oqjKFib_7x;72+o`#lkk0vXsxa;j^l(RNCk` z**Hc$YQ{DzIxdWdL>MA*Fd8{z;~2HLy5(4$43Q~n7BHQ{+mpjmkOXlln1h72cm@@T z=gwh}NoGJv&6@+tByDJD^+p6GK~xBWaw~TRTfT7;%t&0U|j?W9lj^zeX1<{4` zDyT?=&@a}l<@45nA1BCn$UrX3Q&%&dhb_sCUG=ZBD$%y z=H~)ulqD6L->5GfI8;Y_H7tS+!!$GlAmXaPFccXeY{MCOO zmE~b`aD=65d9*R8OCr4l$evC4wt3`J;?2HCDVBJS<%?CfKTKN}bwE>9S#6FFdNooW z$$6BuxZwyTvp%CP*)~(cIvJ}_tKW-h&W$&F%`n-~{3?4~y(lf@G(vD#b`s1thrL-A zcwtmF)K*J`l697>ZNTEdO{yp&Jw?j!yj3C0<$R3B&h9$Y6(~ZD0N0c?pb|v{wyf$v zGfc-8Wr+}|w?aSDb=iW7CCRNCIv3ZQv^pi^7YW^j1peHEK}gjc#dd+D5fiwIVgeHp z44~uKk`5u!p*>qLvo?hD9E=nAV_OZ38 zZ@kuQyKX3uh{ zPQ$cwQ)`GG#@J{36i9#C=Sbqyx{c^5v41~-^o04%K(41?JaX`feELIi#eHjEJ@ioW z!exa+yD}Gi{X@R{G5uI(a^EvAg053r|9oXUlYYIl=-$b%{>ZO?{HgA~T-QtK)R!+m znv@P3u=9>1lb`)~;vii7sq*t49Pag28cQah^w;g`>R2i4zUtJ9!|-&ccx3b2zwEgr zEi6fWqV4-`@Z)1^_`Uv)&pU3r$++|RZ|NZS)32R9*NiM*TG?5h;2wVK!0zH3Cr{q9 zc<0Fve*5b{ANl>GcLq*xx$xco?=MfkHg^yYy~%+1>W8 zXfRPp;Dl*;`i&2zUBs-4 z%yCWI-E4o{pV?p|zmR~~cSxdC2q>E4Rr)@?K<@QbO6TO}|;QB=BWOJd_gJm_xol z)5Ev>A>oaLEFxJ}c+*M%L(>fT5nhoMS(0@LC?YUyS+jx3S1*Bj3vtfwO?Om%(Z7^1 z7{`GvNyTC@QB)ItI3NMbvLsoN6h)*6F&gz^SQ5RcrDh>bA{4qo?D`(hEJDX0j#C1S zv@(T4P&eyERhlSaQV9kUNXTqTWgtd%TreEw%g!;9NS+jk7e^Ee>R8HBCR2w`YPL|Q zqoa7;2#u&Zw@J}ab~GSTFNyr&5Rr8w)MHC6uqf^&M}z(pB-Fbn zP!YSiDIBt%2~bjUr+~7aIyA7`Ljq$z%=&)5rk$QzY`g*z3cqr*>tVkbwX%s<2aq(3 zNlIWs66K_*%2`FRWnk;zVVQo&6=;S^6T=ubf-Q>AD!^6@TTv!}eeC8&r-fo<=lrk$ z>B6}MI6$Pp8z_6rWb7_4ilK){S2`uoP!q0;Z2|}}%_I;Zq*65{;#KGEM(@_a@J!6e|MH^kSF&_tDZt12A-5)vN72 zZi(dk(=KH#ssv&*_H3Eh!zvleP`lHOsOCniwWg13uYToSzMPacM3pHZrcQ!|YO_1Z z0?&-firL~Ip=8}ewG~+8=i(v^N!tKrc-pLxrV2iSBR3Bnm>Q6QLByP;8lp}#naWZ( zMI&h;M^+U=fLWXRjiIYH&}>Dm<h+$CG+_(;t7KHzJGRXHvNZ25(0EUomq$G?|LN4?RJPd-oi^|z0jd-}a zKh+bGk9~f;{7gw2CZXG)fkrR&5cq%5-?WOGSvCCM7fE6Vgi0BZ{$3#}|LF>o9c*pN z8?QZCEtshW=}v6Z(mqYG$G}2{W9lNb3`YbyOHZgYEASo#y;z(K>AZZM-q?bZAedvV|%W>Lr<7Lbfw#}$(K*OcD`v=+k&r-pMCJ$ zwT=4@eKc>;k4HXv@y^S4Zyl0w%azY}?fY);(?^%zw`kkzxuHW>y;H@VKWXQebfm9# zv~r8PbKg22?{9g}-Tl-U9v-rH-iB9QvA>L$A9!NPtKWS6VZQZ&doG+^=6-QZTX@Fj z-fi1#?fvcj70>FNylvshqf0NMJ+F+txnQ;jcL&e+{Aym@bo#BW%XXhRF!%nIv&YUY zKm6IQ6C8Kp@%60+clq9*zyI_4;`!2%(}ljnXI{E6>-ImkAN*j=qvX?g|D}AF**xde i#^+XC`K7p%d-ClK53OoG`6@e0cdhGAAAana7ybf$&dvt_ literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png new file mode 100644 index 0000000000000000000000000000000000000000..0ad29042bf539eb347ca7a881eac8c3fae120602 GIT binary patch literal 622 zcmV-!0+IcRP)EX>4Tx04R}tkvmAkP!xv$ri!8!hjtKg$WWcEh>AFB6^c+H)C#RSnB4RQO&XFE z7e~Rh;NWAi>fqw6tAnc`2tGhuU7QqMq{MTRLW>v=9PY<|&wn`gTtKLonPzp21DbA| zsYG1NWLL$mSM(x)Fy)xcEMrcRlJJeMd#a>mnzI-X5Q%4*VcNtS#M7I$ z!FiuJ!ius=d`>)S(tyN|Tvt4P<6LlA;5{Q|IyFxmAr=d5th6yJni}yGaa7fG>MvwG zRyl8R*2-1ZoRhyWl+#z1xlTER1QxLb2_h6!Q9>CuVsz@HSV+-*+{ZuY`XzEH(i|qi@Or;ai|*&D&e^9;XjLns$}E0S*p< zkplHz_jz}B``-SoY3}a_GVGd000McNliru=L-Q710(^reboQ}0BcD^K~y-)-I6;BfItjH-;NgI z`9#FR!&!Pl3*Fc#g1GAkw%G@PK!$`211af*b;4pA7aFv}Y6k)qU|hr6To{VDSyz9K zUI4wY^24#pol6AZ_j-%&^sWBAkO7ZT_P}f~`5#ekge5m@0}*2yg?I9B5&!@I07*qo IM6N<$f>nACiU0rr literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png new file mode 100644 index 0000000000000000000000000000000000000000..ce07261501edeb3036423e3aac4f23dd8d83bdd6 GIT binary patch literal 2967 zcmcImZHN_B7#E%lvUBYqP@}BN|AG}ww|3eSLbKR}m7+w!Y-Gd3oEq#Rj7jf^N zTElTm_WH$vbfB=)CSf^)-O!<#YB>Tl$8FhKjW8LZDeurBKgbDxp1&yYzMB(v>jk+G zb<$zKdtXfZ_w6c@eIvwjg{@EVTdFn~DAN@4)p99F>}pP^*|nj~x+Q_HLDG?&(7_z? z1BG6`GmI&3WMq-ZvchMr3^Fv$kT>&+tjLnAOGpusVauA0vV7wwfVbH7?7sZ=hA;Ta z3Bzd`*^*SLR5BGc6UIXlvMfuI6-iM07V_^f8j z8ClcV7<4U^$;jv%y# zXM`g4y*V7Rkr_~0_2+=Hkrp(vJ7bE|FfN8+si~dbCO2L|8HL}t+Yj8Zl5AoNZ%m+h zoYI`Yge1zQsLDk}v1MfI=m{AbavfR#X}UPY?O+S=MFrV_*W?-C(Dl9Xd7&<`y)Z6g z*f_t8ho}?#*1n(=+t)^XNB7IH-pt|1Z=c+!&Xhp(pAkAHCNL_Q->DDrYmZOA?q?B4yLHd=GoYX z6vw4@tBjQk7CmYjDsdfAb+c47U0`JaA$aJnrD{mcI>2h$Z)aEv<3i{{%vFJByKRGc zpo&?3l|QGEsfSYvx*Eq39)Bmd~lxe>EY)CA404MJkyI^^WP7p3kVpxuIi2c zUcX9919=~!meh$D?IVLTM_46e8ESX?321J-QEU3?-bSnB^R=Y3F{v+sFm+N_XmtCt zZ1BQDSvOl5rVy;VsJ0GELNBf0n05?7gy+o)X)f{!9=khrl+}=o3@Un-YJfmNmX4}t zMZ>g+BdZFfDBE26ozztuX||#^bLd{EH^NGWaWF*T5R!y@UyQ7q3S^TjTArtiuBT;1 zOT$!zE{lMiP1ST}TgBxusDJ0{k=)Mq zrgre!v(mEr1$lDlhiR-+-55f)eN>9F{Xr7pO6D>U~uR6NN+0Ze0 zZR)C!Idrl2=1TRolM@p^boJyXzg}^4^^PN}-+%e~H~TA-=Vjs2<2mkh`GpV_`mdcL zFYccD^qEb2xcAPS`C#L5{>ZoIHh=im&25=Q-^tZ=`;Wi+&Vj|BT(`~FKlV?(z4+j& zLpQgqys;zSee%fKtLBO;x7IHE{@k+P#xHF6`O6c7BZn9LsNr8LQyh2tixtP0bAMf^ z{Brwpb^I6|?0atY=RaLqbNKA_3s2I|^v5p0am{=MO~qUPxKTOqz@CqGUcB|y?>pJm OxuGl8~oU0zvg}B z{dnem-#eUfB`^9?hUw^B!gm- z=2;>Em;y5FmLwC3rYf$4^aEC*IhvX_iqS-{LGj&^XiB=ND3idx?K;CVLTzk1epo_u z;oK4`5Fzji6>GVinf0O=d6;A~X`Z^8bY0s_X`-S?76F770f3gG0EANn7>4AeWXI8w zY}Myyd_2ICip{Uqm+fP!qp=#MERmFILj<6XQvhlT2FQRKa0rGPB(kIHT3y?Q(4{4g ziW9XmuWYK(At_D9wgqHcCm>}jA}~aYJyhF}6;akL%Hg=(HoxeHIp3z7%RI+c+obBL ztBBQCnip$>JuFp=1JyxYg7gwZ_N>W!XONGJ@Aq6vvBYyMU(AaAF50@N1DdMJYHd94 zmPxTE<5Je5sv|V~%8ZJncd~?aGFG8xyBpD*8?N=5F0!TeRdl&ZQJM%>L%=LMiOtuB z-69bz+ZhZk`5(ZQB|NjHUUsp zRFJ}00+waTNY}7st29e5Uxz6h!hakL_Ps$8PDrc(g@|sXB#hF$6Z$0%1wqlpmFf}( zJ-fC)H42i8eQvz{OiP+gLU%$AOtjK)f%_Nj&6shs>xTdPA_?q(P;CRk-#bM0KT~CL z9b22q#%oU13uc>xbSE}xYoDRn+oFLrOIK-&*DN5atUQrw03x$Hoft~ zFLMr${yKK4<>RvW+HH@$_wb5-uMCEx&g3(BTia?%exaYX1jk4#cOk+jm8)H~w_4!?@73 pxb)PSaEX27;`52KZ;t)mBy_A-zZ$)?hn=RgYdbP;t$FB?zW_LE*AxH% literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..d86c8677a4d8ff4faa5cfd144bd58073f5314c0b GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJtM=93Yk-Zit0RF978Ppmrjc2I-tPAV%yDs<+r>+Y3r1P=~*9=Rd^iFW(iExUJ+7s zjwvjEq0o{kOSY=*Enm5n@96IpUmTXQYuWBOdVh}g3HR4Krv#-%Xq7)OxSPUdBP!%x z%T$%zv)DxWM)unuJq65D<$&r{FRafIP7heA@G^Es$UNnTj7Ph!AJ9&!ECITN!PC{x JWt~$(698E-UNZmy literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d069dbfbc6134b332c1b638369e0ba39d377079b GIT binary patch literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwr2>%=KS^ijH}@IEGmGFYUMGI^-bGTC8O)Eh_Ep$fCHmi{svbd-weOAIQH_)e+(p z^zCsyr?BFp@5ed4YFv^A-AA{7{_)IkgH*%*gjAoxQm52+0Z+aQg?YUy zwzcNI<6fc>E19%IJ)AD@xac8nvFq7#Y1^w?+c(OqeG->_+;!=R!^heM8wxHKZ<3ez z#q@Kj`^VSZrmqD%bzX!yJf0ft9SYW-uyjdcoWUpNFXfC;vyFkqo|Pq literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..da38b659e1ae1918461bcb30687aa47ce9881071 GIT binary patch literal 2961 zcmcguYlsz993N9^+maqaND&UB(2AZr=bU-mJA*fI_o}4Ox4V2ETNvIl`!pQN&q@JkdTeQ6;J`lOw6UwgN9-6gAmd7c07 z{9oty|DW^1@V2eXd++a+Bx(83U}1#6?-qB@t^B#_>UF|jw?~7!6G^&bg}9eUZyi}F zNxggh(r7wbe9U&kYKG9zVVQb0;%G_Qu(2KycbuiN!^(b;SEkQ=s>nXgE4z#$EJg!t z%pcqrvmN`kmE3*fu0@rN56c_sHdjz(DUs{dN|4y~ywcEX^KUV%Dslsoj^~w4!k|1_ z9F_;dn8{`a0vAFoXRQn}b=`#PWehP?p`juSkZD8RMp?OaDco92J$t0ErDco%<(08C zjciq|)oPiVmI>psiY&`gAyzR4908K4ASHDWB&*vR3M_GBKT7>DkcCF#gcE6A;hr`_ zs74*NLDEVSPncRKk%}@?@W%y!Zb|A!g-R=5zk6R z>U;AT6p~p`R`=(D3P}eV*#j{nX&9Hnu+rwvaN9Q-qYRe&cKHDfYsp#>cxwVHkd);W zK_mckK!YWWZHR0Gt%LjnHlamMO-fSI4YoMGgprM~jkB}BA@#kf1)x+gi*U?!GI}06%7{kCcTnCV>t^r3U9?0Pwq|`tja&TMQ_SokoPAc76 zg;$ho^jOZ+T0?+kpNVjhg(i`}rlgSRg3fN2<-(HbB2>#Q#O3+jiR)P+YG@K>||7F4f}H}@ZwV0 zR9hQkJXtqjZ4;J+URonD+f?QmUa%_E`J7M4R72@Iw~;Aln`m^sUJ zpoSSkoSXBxuGvVpvDU7kf8u&ew>w6HGUJ<&s@y~{#KZ>9nLsD53p~Vw$>p#I9Ap}f zu9=u(&YHgmGiO8ikArc;V3NgM#EM8v_(sa&B(HdJSd~c>ReZNmUFu{&Tl-U|Amuca zXWGxaNuwaf|DQ|NA1T;(*X>1L|KpMDxGU%;XlaHjRzfo~sw2 zMRJhu#5Qm33p9I*EZ20h1|XK{0Az^rB!&fu=3&h+`4-?2!Dyi^yxC?iIMhf(*SV=Z z#1CWQvvUgMKb>_5VPY%C(=9edref0AAgN0?=f4gP>C({SK*I9odI{)|=(;o)69V}fu zefK@@e>Zw@=kuheKeObg+`ZCDH@HuF<%w+n^`&}o#e-WfeQ@Q{GU?Y1ZyfDAdhErX zul3hf{P6MTr`CTZoiGkxTO*yUK7bN^&)ent^v}zr{in@0lfkWLSM7iL_m$E2XOAC$ zXZ@p4JCeY2&+KC3pm<@;BWvN+%h$iWkUYDTof}@4JFw9bhvuQp+Y0aX?|JS|!ymv} literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png new file mode 100644 index 0000000000000000000000000000000000000000..15de16c8d4c3209efec4235bddbf3a092a1e5a12 GIT binary patch literal 2983 zcmcImdx#ZP7{9e>X^D~|S%%XXqP6GF`-#_0_pa?icU^XGxDsS%&YZbBc<;>Y%L1M@oH?|hHn z`M&R*SGzi&nm6~Mxrsz#UPpVno4gm$``+2)x$N2vNM3V-_DxYDao<9E-<8;Z@WDi4 zZoixDje9dso5(LDq3v5ZStai3MYs_P)%Mo1&yg*EU^~aj@g}FU$sU4Qfyxw z2PVfAi^XJ7O8Q}r6AZ)Pc##uDKoB4r@?uy5UbMWXA&nyxxC}I1fLZJQ#4FoodEW2*BP1?Y9rI}!vZ7= z=N4cNbAgvDTgzn34ljzKhj2$a#S&MOu4|i;rf7l)6`;#l1H2-OK!<__3?z!8YG|U4 zoZ9@fj|ON`(fO77vVBB!)K|mQRV*V1NkB)s01Q!<0TdAr1Y3rRfH5y3p{8v^=#mnL z`9`hOE1PI^u&zqTwt!@780fZ4lnEAnD7GQVf}~l5!*RQv>*{EX)kiba;8`C^vs_mI{_98eWSQmW%! zZVBgm(=K5xsyL!HN;XZD&`w4x)NFSnl5<1VUekm7t6zDSDHo*)Q6&UKvlH8Fb=aL` zfoDc#MQyPU6S8iRwG~+8J8=<)cx{d_JZ)8QQ#l{O!CSj7XtKZyDh7@rsX)Op4=hR1 zfT|nF;w2GdL92y+v+I&6$fhXOYUp-cuhNS8pqImB6XMw055^D;%Tja)*t%u_nU^)7 zTap2g&g;m)h?Jo|Sum3}ggYDz^1VSEHY8R6Lr6AK97ZYD3H<^CgCOssa&>Woo?YFa z>IKQfJ~Q5arXh;oMXkB8M^hSw97mpZYlxd!%kda!O3hdiPIq!o1XxUYpf-eY$t7^W2jQ+Rp2{ zmo{JhX8Z1KD|Rk=^tYFHv>e*8IcD{4?@ckFE&z{X)`1N>8y6MP0OE&*}e)hLp zg|DA#IyshF_Q@NI6I~b0x1;v+pPfAM*6SZ%d*JH1b^dEhudIGE`snfNqdmz2I57Od l(8ZDPr`+9pq96Zy_|$WqZ9iPzC)1;JM_Xt5$hzmZ{R6m)&?Eo= literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..3505727f5f27fd909ee2a9ba0321cd24d61be463 GIT binary patch literal 2976 zcmcImdu$X%7(aXvgg{D&gy0{pi$RRe?an@L7mio2&}y$Xg?=XyK?(rciUbY z{6{pgDuMX;Loh^xCcaHf5DgkJjgLP-NDMIsQG7p;NF)Xli8^zyUZtfC$|biuJKt}< z$8Wyxn;C9zTRVH^!kLLgVs=Y&rh~p4*nh@!`n>+k--y1h37R)ViNvgV>_08B^XUbN z#LUf3t}E`!wwl;?lgRchk}SFbMJE!=Rult-H<6gLNRQ*C`QP@x$8(OI<~!A_m<<|9 zuhTpfl66CEIXtup8#cdUIk&86QUxxF5m$5zUSt;2d`YiK$81{Qxe_Gal;&44gIrg( zoon<%!f8nnU{RDf-AF=BQ8e*ZP7)TlgB!gm- z=2;>EF$H8XCrPFVO%>iE(t%ipW@&2LC`R>QgW_`%G-YTi>KL$ZJNdy$p*A-2e&`~) zagK|6h!A)^C2QHN+2Tbp@-S)1q;9ktys^A?Af{nRdq6 z;HgnrRy)v3C|MWD+A=Ki^YH)*$*La8@T65COyqoo`Y-M})DuL%K0LI&rGKP|hG!hpcJ4mr8%s|gdgvwT!G;q*Z$35q z+a(=y&;9z!x!;eT8QFK>qf>v}b>-X+{KEdW?&aa@-#v4}?VNGohmX%C-XA`Hul?YGXXjk;+1V%DrFZW55I+1@>k;#&ZF~1zJ$U!0 zZ*QDF?ZBH$-cA2mJl=W!_S4;qXU*}x33vaJee8(27K2?|&hA_P<^1R0>3nkI!PN^- hu2`ISYUq>hmk+jXZCcp6m))UTn%Xk2t-j~}e*l;2)(HRr literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png new file mode 100644 index 0000000000000000000000000000000000000000..d1891b6b05dfbd7f3046c675adc622bebf47c28f GIT binary patch literal 2951 zcmcImUu+ab7(WCI7Hdd|3Bd}R<)t8VyR(09M~;fUVw-qS+cUHp6J~d2?>5}+F1y>_ zl@KL_Ks5S5&=`#-3Zg_~A9xgm7=nq$7zjRKqT$h)7$x#xA`f-u{`D#?ZBRDZfAjt3 z`}3Rc`(|Dp-t|m(*ZQthD%CwSm>Xg5HT+)nAbW1SHG|pfp>S|KPNi0_<@d7GyYH<_ zrMmWeg|TET|15HXN*a^Ers-NGWaw0CTVE~2&OVw5HZ6L7R{Z1KMN#lbR@|fK<$Tyr zOWxpth>jlERd5dMb1WkEZ5OuH5K~a02^MOVvLB;bR;=qq?3)iuqELq<`?BH=ZcrG@ z4-5T4L!L-uQ&@@BdDk!odOR_FO1waGI8iJt5z!$hiYzGrbR%D(w zLa2mowSL^Bi4i8%a45mF%tNXJiPOe~6H&QtoH!CK(+c&Im|*Pht$7PTxugvZQGY~n5=4a{D7SKFxaFImz_cRt?(uvQRO8J&@a6=X!wJob zJduE$0jgY36eL5W!zX0+Avd6TmYM`7xD#wKd_jRo(U4-y0SCl$rxt}02f0C1!EE8Y z3NBJ9^owY8(qrOPsFdgmHKp7Ldre*2CHn0OQ)R-d2qQE5zaWkf!QCz*HZFl6c6369E zt=ucZG`cins1C7#N=yneM1#PBHh<{EQZ=ZWHsf&CZhue?qI^IY=c*|1)kaJ`a~1RY z%8IZ#IL1@8Jkc056`5TUXCk$=U`i4&0=QBf6u=7+$n0q=lT1@#NiIho%N)Xt4CLR0HT#lYy=3CNMIV zW6P>SDKuN5-|4!FAgdv@RYUjUdXrYCg#99An~)^ldoZeNDKw+%fEYFbs;X(gCOQO; zt>_s=wiQj&<_l)thH#&QaRPsmMjeS2;s~>iltyt@bfcgm;4mzEPQALMNuMt|Rw`j&KtsCB1EcbblBz{0>v;pbg9is7{YcRQ!uT6d9 zMf3H7rRE^pi4kka)6y*eUU?%!SSDgn51_x1*4GU zPd*UPiZ5T>eeKf9=V~{vobLbd^B++xDdgPUBHT}?I!lm(J#g#o5 zkCqN?Irhut3pd_BT-eyxJ6d?>`tl9MGiTB1zaBn&C2bt~?RsryqjP(Ubo}ZAudVoY v-S5YyKkGU9=c=n4-rRrtVBtpm^0H6A&wTWA&)ci{QF&-!S8n?0y@&q+2J62< literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png new file mode 100644 index 0000000000000000000000000000000000000000..4747663ab1f4b7f2303af4c945e05248ae1140af GIT binary patch literal 2933 zcmcguYiJxr96wv@Beqam1!<+-Y(*?Ow=?^?+ofknbEygR(vX}qK`PG8%;uKf?QC{8 zxl8dwsUWRT5K5`2h<@l7KUnj`JZV!hh<5cR7t@3|U>iHM% zNu_$G{o+J2QP}SiUQJ`lODtWlh60^R?dhwBm>gz_QesnnkW;^Z<4slZX-++86<{G8 zU}b;kNW{jEj1< z3Zu#ZkCqcxQ1~<_V9>e1#-*#7k0< z_}&TzrDO?|)%_KqQqqBj?m)zF!lNSRl{R-q+rB9}O6$r42mOHZTD)5Z-de!&IAJ+e z5(&U8Fkn&FU5H!@JqX1BHlYPUO^OrT4R!>+s3X^au4yd+bLx9@t3oMpJswrD*f_t6 zr%gKAQ!@jR?V$Gh zJSQ`fRC0Z@z9=U`M`t%&jC9>{YzUZ#A+S8t0a<1lVw8oXWLnVHy|%UkkuORdSGu)I zuc*-Iv8-(nS^@^mFp#At0uCz4heaL3L`J40a=2)BfLC}_;8f(?P!+k`u23&r#j?I~ zstBPmIU%W9nQ2aDbSQorlFycWauxZa_|d=@Db`g*^2Ke~9~Z4lIAB|rVYTK*{W_~m zX#2q!|K{>||7JP5aAi@Y+(@ zR9h=Ek*w>mwh4>5m(*~?`lm#OSFH+dCFf&2dwthY#zcaE40w)V1B;mulng5a?5smd z(9jt}nRe*cx^B40bakU$LpS1jE3KrAgDEBsAx*vUU~K9cg8vp^)X4xyOu=icQ-HH1 zt7mMCJSbRm?LI8q5dPy}2oGji)J3ciM_3%BEQ)ig7xAis!?5C$Ms;bk0d1X6oq|*n zt}M2n6_Z9;~*61T)tbDKAc8|JIS`Tk<|_$HotMkzK;O;Z^!=TQoZ!q%>MJ|(fg|FV~{@X@H+-Vj$3#)`!{i~A6m|F z3kID`f7GAeW+AT_gV@WGSh?s^G{?1WDEkoYCJ~<{Imb;3KYess;2oS4cIs(4?YEJ< z(=i&5zR|7>8r_XdENpm~Z!KF?L6Jm|FBc1LXqA&fMXyEQ*{~$=6-cx@DQsc}`Tled z-{u8`H)67gWLe?kW(*jbX2=inimb?ztV=)$_|5~#HR+g5LCOU)MjN(%WX z@-0a!l}fRa8uNmj1WePEWJOXGks`!!#EoECbi>tk4Ji_$!0{u;b9tr_X1$>(DNs+V zAr$?FS~slGLg-DNE^e13snNVzGe^ zqxNCyQ7yJ9(P3u9CsHp7y`cb+_F-yqb=|Qr>LugU%wjr)HzxaeFY>~?Hw_65@gyoD z$DYO@lT3n=vNH{oNg7b!Y6}RAyddLwg?jGv)P3U>5L5WII~^B$rEnb!yf%TPU__Dv zOC(WFh^m}X6iWt{4%W-`MXo~AG&M1d;6$)V@fihJib;Qyz#ew&kr|;FS+*AxAze79 z2y;a8-CV_5I&F2jVFX=7I#Wr3x*BsFY{e0l<2Z{&6KO!Sv4+H~Y3L$W6&yz@Ap{%s z`6&+#v7}=2tM!FFM0GS)!%|hMPD4;6wql4H(V&=s$QBc3B4KKn0EAIpTX*2l5{HF} zTA5dvYP3nhpsKQ>isM8~VCtF)vh1c~Q`LYP&r%M@?Y4OZFGzcsa;^$ITWyP~r>;U) zUr7Pf2K!m67KW;WaYd$=1lYYMADBTtF5d1slww8TS-w~m`+c-^Q3niNSM}O>k5eXv z{**&m3#*P$GAlDGl7Yz**2!3fS{+VEb8e*8Yx>Aw?XBSOm7=sDs)m4Ab`mVqhMg%E zcy?4))t2&vl68x$t-?ajj!G~fn{t%l8LL8?&iN1y-`aH$*MJNRBHE^Eh&s_^F{|ov z(MXsmE2|12AYKpsX4h2%JJeUT(~K&Z9>>8~B4`kksWxrMDw zW#hG`>IJjSLAn!Lw6)LB>@hHrk&WvjG>xnXbXJ~FH$|x0imDrij%>&>nrZX?X|rcJ zRH0$Qxv4%x4`b}LaSEg#jdLV%Y260&lsNbC9}dtH=Ecs`rc7f0g_q7OKC`iT-`HdK z4D5Y-{_V?_9w;w-;VNi-@pHfViIpAs`%mmY`Qh_(-}!RKjvp_d{^R{`wtfHR8hc9% zY1(DIy6(c(W1rmisrhr~cis11d0^w=r#?78@2-}Sr~9s6|NY~>%}bls|8{Nkc=yUx zoU-c4MK>19M^Bu%vV8l+!Qwow<;dl(_l{gT*!1kt^MF6qe!Okxie0bGDP7w$r+eSk z^F1q$|I&Tx-1@T|*T3hak~{eF;Adma=-V~F?mc^{_r7CyUOvYy%#B@I_ipkHbOXzN?)FW5=Cv%M>IZ1b*X{seYI&Vm2{ literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png new file mode 100644 index 0000000000000000000000000000000000000000..129e1093cafd7b482842d19c2cbffbfe06b0286e GIT binary patch literal 2966 zcmcguUyRg581I1+h43$iaFD3AJP1m+o&MWx!$Qv6JN6P6j$_RoQIu&r-K*@jrS0AB zArhk|icw+&UJOw}L}EZ=q8JTEObo%O@ZkBT$wi(FFA&dX@tfW5-k#iX7g3vZI-U8= z_vbg?_styY-?nw>;|<2ZdiULg>By?sahofG{bD#QVX!Pm&B||O0JjXuAjfav96uv2GxRC2)fCz zo8KRjo%^>Ht^Io~-R8DzW;fLg5Ktj8W^0wQ7a6rISC?x*pAHKgTZhDZvs@Qd$PN|y z*=|21tdQWtOTP<8L5|-=AZA&0!QXyU(0T#8ez*3>mg3lkH*I4jl#gRW=$)o25CJXt_;I3`(+ z1`;o3cv&n;k|82PMURTm5gX6~gr<#S+z!?OUzCs`ONN}82KH^&8JiPoTZZF@6$~5a zR&a?3fmf<)D-?`AFN(2ek-l7(15;D3Ya5bonk1b;d>V-gZ%T^AXOQafq9UdV(K4bV zWt!`AzBNLFimq?um+f01qqQ3b2$Su!tn;RVMczb;%3}g4AgY=q69<{5E;XfX4_!!c zTyB?2t+GL)Lo%9d*(MLt2%oVP#OuhUjcV(%g5}!@qV{P z%0oF9Sc@8lXzeq*rq9qyMl;mNyAj0PSW;_tl6^_9?6UQwG_cih!J^SgY%UpgXV~ER zQP~h%9VS55ZKAdTi+m@p;*fNefZ;i_LYU3?2#?<0bd*+*h%~}Gx~%akQ6QvbHO*@o z-7-a4A_S$IuHS09Y#_yurw-#`3*U61D|afI|!iDG8%2=Y)QR#X(SZt$KC|qn@3dPpyPx zW1pQWKeLi%lhAF8fp#q|6WD)I-<%OQziRluZ<0VS2#qoz{Jlan{&Ni`d+FZP4_;%Y zT7c#mgK!cXP}=7x_BPTj%}hgy*EN$zDoszU>O7VmNmeyYwH!<%no9HUwAj-as?*SR zZ)y&~WsG)Pw?O!5-6M$yc^kqlvGeHAQMh4#-XhqL6rygG0v-+j= zufB7s`?&|!^xnOu^SAfTA4#n~`FVbMN9oszKfgP3@?cN#*x(->A5VCnynp7ARVxp? z{?=smm2Z~5IsUA)W8n{HPaWQI;hM2z&0WX8ypX+dFgUo1qD==Wb= zIk^lid;02+`tHou{Gk==CbnCvJFYzR?J4)CwcU9)*z)_e>Q@WK-YuNiIDYvldUNjU M*_Qk0u{|&T1)TuH82|tP literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png new file mode 100644 index 0000000000000000000000000000000000000000..8cc85ea011fc5d000fc7708e5badfedc5788b03f GIT binary patch literal 2950 zcmcguU1%It6rNIA(n_SIg;uR}oW5x7-MM%Ec4z2X(rju{-8Q7FNf5<5Gk3CMcIQrJ zX0w}!wuoTGKSUp@E#iyyj}}o7u~e%Mf}lkZ@u7l(Na$0n7SV@L@7=#_G-*Qp8JNF& zzI)EO=YHqh^W@-xJG-2Uqo%wFrl{?S+vuG_@#Rl>_B zwhF@f3BNFsjO6dO99m9cm)ay%D~Aj%2)p;xLhOu_M6}76A7rK3GapN$?`EZ8JrDC? zFDd%{(-Ao|eW2h>k2|I-?YTqTU9*^iGD)ylE0==Us%53RUWBmY zNPbZ4r4bR06a)^0ikLQ2$j~$c?h+NKKpE;XQUEe6s97j2HZO@;i(Jnd%I#~~Vt-kw zm?WVk%hhT%RaH|o8k3P}nle;mMF9)};;A6PH4wx*S{iaBb|ODad>V*cBerQJ$x6)A z#uCb5TWt_G!^8q6*KjDK6y!^)16`+$3oB8nZrpWbQX*v%Br(IHHkL&xpKrq#Ra-8% z(Q(o@$vkSVZBcYwm@F484}&=xNU zMdEu)803-#P*U@kfO1J28d|*(!3m8Dl$KiD8Ep9`Dk!Chw+{P(ORMp1eBsRrB!?4{ zl{k?A%m5V@6vcwb($VdZeZU4Z'*1b2c>hA$|{Ldb&p0x)%bZ)#bn>sTI*%9w4O zU&doZ4ui3}wS3+h2;u|>4jIU0CFW|%_gza-RibMU0|adYsJ3Q;jAGcpP&{ZVI#zVe zYt7G5r@~3a=Qr}pr4G~4-VMva9>kie1KY_EfD}ywreYU> zVxC`F2{i{tI8{rP#$Z~3?2-|GHszzs$mhlP1U?I~B8i+YR^9#~R=Su2hOVo6b9~UR zk@Tvx zD+^^qZM8^Pu&%<|1}vstQpFMJ8DkM%HY?<%oR9J3)m=wv4MAiO;F+ocbfQ6Et9lw3 z8Pl<$st|%0o0f82wUEZ>-O8bBalNVADdJ#^utP|eu6;2M%QO!Woh2Gkfu?FMFg>UP z?5P?@j&S zwHB)dE9D?Ni7i&zmnrrxG9ANCGYXsRz(DL20XEi6fK^XXb;Hmd4|7IyZS7kpKVy literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..106584585301cfaaa15cd4f5084ab6000fd0c845 GIT binary patch literal 2960 zcmcguYlsz99G^|8)D|?YR1l{T!pONZXWlb;Gu^wkt6p8McXO>ic;?KRyVKq~GtSKJ zy(^Rw5{Q&heK51apdtt%gg)fj(nF0R3nHSRKJ+pwda#5PsGW0PdpCF8#U2B5=FB<2 z^M9S+|9{TDp3Qf)&s{o~VVL&ru1t=6=hOGvt4X_j>>?zeIbqlKm|^BEq;DH@=g=}B8 zhwTU=%xWo-N1`aPx|sr+qG;kORuUyq5LE$4JkTsrv4GCjAC72?9M{Ta*4K5BzckmM zB%vh;<#IVymQz7g5P)f#f+z`+#1jM`5BmwM@P53aAt8ff6nSCd1wKn9LOU2t(j2k0 z=0YiKiuL1qm`K2c3Je915~)j7po5yYa4;%Xl{-klMO?yu5)&+FVo8*;*(Q8av87TI z9VeYb#G<-ylcMANaEOH*j)TDn;m#qVaYe(hILYDh(9B>tfj1Y2{Xr7M{lOGLXiiTE zMdG*0~6Q^HVHm20ZXF9n*a_R&mEo?>LAMvq7oz< z=apaq3!z`AYRhJ=Za+?-k8pP;%@I>mp66Hy8lvGUHm^&n#_PIb@DM2qF9C=p#g$wG zg2wtxfCee4==xfIIRPRvn!91?hDKIHk(Uu5jizAUMmppT$#DTRk>(gmL)wX@DUzlVDwjwKZ5AxJemCcx{11c-pKGrZPT;Lzg!l=n4>lhI!YNHD1Mv$lJ22 z^O|8ITa+b?f!=WaQqyG%D3&BQa_CA-uZI=&L%)E@AtZ2D?hH~~LJ!^MB^{7NQx!x~ zL(+L$*O4k2079Fv^wNEpv>^P)&Y-{_!chycLKs1Ekm4v#b8ZxrSQv&y4^^{E81kL^ z`P58EHVN4A@-t=792|Kq9B9?jG=cpW^-asTnN`F8eUk)wL8z4h;qMiq_MfRmay{Lf z>cMMGRtsjzL2?pXq_j^{>>WS~x~;1`G&P$CDoszQnmm+UNmeyYMJ}X_rqY6cTI?x@ zs$pokH#LUHWsG*4w?OjKyhmc6jws>7;`LZSN zo!%GkfByUP2Xc!}blNYkw>Rv#sWkHVtQ+Qh^x2tTcfNV#;F1IHwvFr_S@gkcrS>~} zU-)M9#Df=@4c1S$FI+HkZqvukOJhBIS6%h+{N2~Qm7BfiyQB9WIotNY0s8 z*Bv}|ardc{xBPtk%=ES4z)+>iz|hdl!0_`w zkbcR)P-?)y@G60U!Dy(Fq9&nVFdk*Um6Jxz6zBF~g^q3_sp8{Qt@D|1ZP;|J~i) z$BrHQ{~u`EC>RZap%em_jxLe`WulTGzhGbj9?5_q_&YnW++g4=@Q5sCVBp&e!i?^} zC#(euN|d-plmzFem6RtIr7{#GX6BXX<)xM=nCKbm876DZ@n&FP+Un`z7*Y}U_SWsJ z+YS=0iCca7S615{`S{y@g_fmum`8rk%=s5LTwhdjI7Z`B`>lo#Cg(3(oP9g{*-H~Y zR;J4y^Z$Rj5%+-SgN0YSb8(|+!)pEs3``scYR$bF7+C~RxfaZOD(`;$BU~P)df;Q| z?ixK7fd$$Q|No0s*)!f{-Nm$K{=V%F<_+!bPuD-ae4O!4ZO#9u|6Xt3Z(py=)X9+l z{$A~`4?q8X|1Q6f;rw6Ezv>@0eLd{Xtn>BXpS_H`>i@m-clZu8k>|mWFQPr-bL$_S z(_)cO2D##Q-ZY@26d1zg6;QbgoEY{=Y%WdNZZ$uI`GeMnOPTrVK!pup)!*;x098AH z{Nd2>f4|b^?UR!j?(NPI-FG{2`#P(YY!5tlhx{ blockMap) { @@ -149,6 +151,9 @@ private void registerEmissiveModels() { Blocks.INSTANCE.getNetworkReceiver().forEach( (color, id, block) -> registerEmissiveNetworkReceiverModels(color, id) ); + Blocks.INSTANCE.getNetworkTransmitter().forEach( + (color, id, block) -> registerEmissiveNetworkTransmitterModels(color, id) + ); } private void registerEmissiveControllerModels(final DyeColor color) { @@ -241,6 +246,23 @@ private void registerEmissiveNetworkReceiverModels(final DyeColor color, final R ); } + private void registerEmissiveNetworkTransmitterModels(final DyeColor color, final ResourceLocation id) { + // Block + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_transmitter/" + color.getName()), + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + ); + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_transmitter/error"), + createIdentifier("block/network_transmitter/cutouts/error") + ); + // Item + EmissiveModelRegistry.INSTANCE.register( + id, + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + ); + } + private void registerPackets() { ClientPlayNetworking.registerGlobalReceiver(PacketIds.STORAGE_INFO_RESPONSE, new StorageInfoResponsePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_UPDATE, new GridUpdatePacket()); @@ -252,6 +274,10 @@ private void registerPackets() { new WirelessTransmitterRangePacket() ); ClientPlayNetworking.registerGlobalReceiver(PacketIds.RESOURCE_SLOT_UPDATE, new ResourceSlotUpdatePacket()); + ClientPlayNetworking.registerGlobalReceiver( + PacketIds.NETWORK_TRANSMITTER_STATUS, + new NetworkTransmitterStatusPacket() + ); } private void registerBlockEntityRenderers() { 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 3297bd8e3..df268b19a 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java @@ -80,6 +80,11 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage2.p DefaultEnergyUsage.NETWORK_RECEIVER ); + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl networkTransmitter = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); + public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); } @@ -179,6 +184,11 @@ public SimpleEnergyUsageEntry getNetworkReceiver() { return networkReceiver; } + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + private static class GridEntryImpl implements GridEntry { private boolean largeFont = false; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java index c0a02ea47..0484186f9 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java @@ -25,6 +25,7 @@ public final class PacketIds { public static final ResourceLocation RESOURCE_SLOT_AMOUNT_CHANGE = createIdentifier("resource_slot_amount_change"); public static final ResourceLocation SINGLE_AMOUNT_CHANGE = createIdentifier("detector_amount_change"); public static final ResourceLocation USE_NETWORK_BOUND_ITEM = createIdentifier("use_network_bound_item"); + public static final ResourceLocation NETWORK_TRANSMITTER_STATUS = createIdentifier("network_transmitter_status"); private PacketIds() { } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java new file mode 100644 index 000000000..f174071cd --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; + +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.networking.v1.PacketSender; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientPacketListener; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; + +public class NetworkTransmitterStatusPacket implements ClientPlayNetworking.PlayChannelHandler { + @Override + public void receive(final Minecraft client, + final ClientPacketListener handler, + final FriendlyByteBuf buf, + final PacketSender responseSender) { + final boolean error = buf.readBoolean(); + final Component message = buf.readComponent(); + + client.execute(() -> { + if (client.player.containerMenu instanceof NetworkTransmitterContainerMenu containerMenu) { + containerMenu.setStatus(new NetworkTransmitterStatus(error, message)); + } + }); + } +} diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java index 83eed775e..7d4c0bde8 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java @@ -5,6 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; @@ -102,6 +103,14 @@ public void sendStorageInfoResponse(final ServerPlayer player, final UUID id, fi }); } + @Override + public void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterStatus status) { + sendToPlayer(player, PacketIds.NETWORK_TRANSMITTER_STATUS, buf -> { + buf.writeBoolean(status.error()); + buf.writeComponent(status.message()); + }); + } + private static void sendToPlayer(final ServerPlayer playerEntity, final ResourceLocation id, final Consumer bufConsumer) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java index 414b61b6a..a1dc1c257 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -89,6 +89,12 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) Tags.WIRELESS_TRANSMITTERS ); groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS); + groupItems( + registry, + Blocks.INSTANCE.getNetworkTransmitter(), + ContentIds.NETWORK_TRANSMITTER, + Tags.NETWORK_TRANSMITTERS + ); } @Override diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java index 842a3e945..d7a1309fa 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java @@ -37,6 +37,7 @@ public class ConfigImpl implements Config { private final WirelessTransmitterEntry wirelessTransmitter; private final SimpleEnergyUsageEntry storageMonitor; private final SimpleEnergyUsageEntry networkReceiver; + private final SimpleEnergyUsageEntry networkTransmitter; public ConfigImpl() { cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE); @@ -70,6 +71,11 @@ public ConfigImpl() { "Network Receiver", DefaultEnergyUsage.NETWORK_RECEIVER ); + networkTransmitter = new SimpleEnergyUsageEntryImpl( + "networkTransmitter", + "Network Transmitter", + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); spec = builder.build(); } @@ -172,6 +178,11 @@ public SimpleEnergyUsageEntry getNetworkReceiver() { return networkReceiver; } + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { private final ForgeConfigSpec.LongValue energyUsage; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java index f63badfca..5357e1fdc 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 @@ -25,6 +25,7 @@ protected void registerModels() { registerDetectors(); registerWirelessTransmitters(); registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -127,4 +128,24 @@ private void registerNetworkReceivers() { .texture("all", baseTexture) .texture("cutout", createIdentifier("block/network_receiver/cutouts/inactive")); } + + private void registerNetworkTransmitters() { + final ResourceLocation emissiveBase = createIdentifier("block/emissive_all_cutout"); + final ResourceLocation baseTexture = createIdentifier("block/network_transmitter/base"); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, receiver) -> { + final ResourceLocation cutout = createIdentifier("block/network_transmitter/cutouts/" + color.getName()); + withExistingParent("block/network_transmitter/" + color.getName(), emissiveBase) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", cutout); + }); + withExistingParent("block/network_transmitter/inactive", createIdentifier("block/all_cutout")) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_transmitter/cutouts/inactive")); + withExistingParent("block/network_transmitter/error", emissiveBase) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_transmitter/cutouts/error")); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java index 880f37c2e..4016e62a1 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java @@ -8,6 +8,7 @@ import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlock; import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridBlock; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport; import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType; @@ -63,6 +64,7 @@ protected void registerStatesAndModels() { registerConstructorDestructors(Blocks.INSTANCE.getConstructor(), "constructor"); registerConstructorDestructors(Blocks.INSTANCE.getDestructor(), "destructor"); registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -275,6 +277,24 @@ private void registerNetworkReceivers() { }); } + private void registerNetworkTransmitters() { + final ModelFile inactive = modelFile(createIdentifier("block/network_transmitter/inactive")); + final ModelFile error = modelFile(createIdentifier("block/network_transmitter/error")); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> { + final var builder = getVariantBuilder(block.get()); + builder.forAllStates(blockState -> { + final ConfiguredModel.Builder model = ConfiguredModel.builder(); + switch (blockState.getValue(NetworkTransmitterBlock.STATE)) { + case ACTIVE -> + model.modelFile(modelFile(createIdentifier("block/network_transmitter/" + color.getName()))); + case ERROR -> model.modelFile(error); + case INACTIVE -> model.modelFile(inactive); + } + return model.build(); + }); + }); + } + private void addRotation(final ConfiguredModel.Builder model, final Direction direction) { final int rotationX; if (direction.getAxis() == Direction.Axis.Y) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java index f1edd6f3d..da762c9a6 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 @@ -13,6 +13,7 @@ import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlock; import com.refinedmods.refinedstorage2.platform.common.networking.CableBlock; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageBlock; import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlock; @@ -44,6 +45,7 @@ protected void registerModels() { registerDestructors(); registerWirelessTransmitters(); registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -194,6 +196,17 @@ private void registerNetworkReceivers() { )); } + private void registerNetworkTransmitters() { + final ResourceLocation base = createIdentifier("block/network_transmitter/inactive"); + final ColorMap blocks = Blocks.INSTANCE.getNetworkTransmitter(); + blocks.forEach((color, id, block) -> singleTexture( + id.getPath(), + base, + "cutout", + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + )); + } + private ModelFile modelFile(final ResourceLocation location) { return new ModelFile.ExistingModelFile(location, existingFileHelper); } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java index bcdcbe1cb..f561592a7 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java @@ -31,6 +31,7 @@ protected void generate() { Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> dropSelf(block.get())); } @Override @@ -46,6 +47,7 @@ protected Iterable getKnownBlocks() { blocks.addAll(Blocks.INSTANCE.getDestructor().values()); blocks.addAll(Blocks.INSTANCE.getWirelessTransmitter().values()); blocks.addAll(Blocks.INSTANCE.getNetworkReceiver().values()); + blocks.addAll(Blocks.INSTANCE.getNetworkTransmitter().values()); return blocks; } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java index ac0f47cd3..609b24c38 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java @@ -10,9 +10,9 @@ public class LootTableProvider extends net.minecraft.data.loot.LootTableProvider { public LootTableProvider(final PackOutput output) { - super(output, Set.of(), List.of( - new SubProviderEntry(BlockDropProvider::new, - LootContextParamSet.builder().required(EXPLOSION_RADIUS).build()) + super(output, Set.of(), List.of(new SubProviderEntry( + BlockDropProvider::new, + LootContextParamSet.builder().required(EXPLOSION_RADIUS).build()) )); } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java index 0ccedf2a8..1e302bc06 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java @@ -60,6 +60,9 @@ protected void buildRecipes(final Consumer provider) { Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> recolorItems(Tags.NETWORK_RECEIVERS, block.get().asItem(), color) .save(provider, createIdentifier("coloring/" + color.getName() + "_network_receiver"))); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> + recolorItems(Tags.NETWORK_TRANSMITTERS, block.get().asItem(), color) + .save(provider, createIdentifier("coloring/" + color.getName() + "_network_transmitter"))); } private ShapelessRecipeBuilder recolorItems(final TagKey dyeable, final Item result, final DyeColor color) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java index 0bfdc61ab..f93ae1e0b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java @@ -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.NETWORK_RECEIVERS; +import static com.refinedmods.refinedstorage2.platform.common.content.Tags.NETWORK_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.STORAGE_DISKS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.WIRELESS_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.MOD_ID; @@ -104,6 +105,10 @@ protected void addTags(final HolderLookup.Provider provider) { Blocks.INSTANCE.getNetworkReceiver().values().stream() .map(block -> (Supplier) block::asItem) .toList()); + addAllToTag(NETWORK_TRANSMITTERS, + Blocks.INSTANCE.getNetworkTransmitter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); } private void addAllToTag(final TagKey t, final Collection> items) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java index c93624a61..90d63b97d 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java @@ -16,6 +16,7 @@ import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridClearPacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.NetworkTransmitterStatusPacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.StorageInfoResponsePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.WirelessTransmitterRangePacket; @@ -175,6 +176,13 @@ public NetworkManager() { UseNetworkBoundItemPacket::decode, UseNetworkBoundItemPacket::handle ); + handler.registerMessage( + id++, + NetworkTransmitterStatusPacket.class, + NetworkTransmitterStatusPacket::encode, + NetworkTransmitterStatusPacket::decode, + NetworkTransmitterStatusPacket::handle + ); } public void send(final ServerPlayer player, final Object message) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java new file mode 100644 index 000000000..400c4a751 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java @@ -0,0 +1,43 @@ +package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; + +import java.util.function.Supplier; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraftforge.network.NetworkEvent; + +public class NetworkTransmitterStatusPacket { + private final boolean error; + private final Component message; + + public NetworkTransmitterStatusPacket(final boolean error, final Component message) { + this.error = error; + this.message = message; + } + + public static NetworkTransmitterStatusPacket decode(final FriendlyByteBuf buf) { + return new NetworkTransmitterStatusPacket(buf.readBoolean(), buf.readComponent()); + } + + public static void encode(final NetworkTransmitterStatusPacket packet, final FriendlyByteBuf buf) { + buf.writeBoolean(packet.error); + buf.writeComponent(packet.message); + } + + public static void handle(final NetworkTransmitterStatusPacket packet, final Supplier ctx) { + ctx.get().enqueueWork(() -> ClientProxy.getPlayer().ifPresent(player -> handle(player, packet))); + ctx.get().setPacketHandled(true); + } + + private static void handle(final Player player, final NetworkTransmitterStatusPacket packet) { + final AbstractContainerMenu menu = player.containerMenu; + if (menu instanceof NetworkTransmitterContainerMenu containerMenu) { + containerMenu.setStatus(new NetworkTransmitterStatus(packet.error, packet.message)); + } + } +} diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java index c402dd972..b825e0921 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java @@ -5,6 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; @@ -85,4 +86,9 @@ public void sendStorageInfoResponse(final ServerPlayer player, final StorageInfo storageInfo) { networkManager.send(player, new StorageInfoResponsePacket(id, storageInfo.stored(), storageInfo.capacity())); } + + @Override + public void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterStatus status) { + networkManager.send(player, new NetworkTransmitterStatusPacket(status.error(), status.message())); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java index 6f21f360a..55e345c93 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -88,6 +88,12 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) Tags.WIRELESS_TRANSMITTERS ); groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS); + groupItems( + registry, + Blocks.INSTANCE.getNetworkTransmitter(), + ContentIds.NETWORK_TRANSMITTER, + Tags.NETWORK_TRANSMITTERS + ); } @Override