From 1db6e031e8831af8c5ab102214da22fbdc1136fe Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 26 Aug 2023 15:03:44 +0200 Subject: [PATCH 01/12] feat: wireless transmitter --- CHANGELOG.md | 1 + .../platform/api/PlatformApi.java | 5 + .../platform/api/PlatformApiProxy.java | 11 + .../WirelessTransmitterRangeModifier.java | 15 ++ .../wirelesstransmitter/package-info.java | 7 + .../platform/api/upgrade/UpgradeState.java | 5 +- .../black_wireless_transmitter.json | 56 +++++ .../blue_wireless_transmitter.json | 56 +++++ .../brown_wireless_transmitter.json | 56 +++++ .../cyan_wireless_transmitter.json | 56 +++++ .../gray_wireless_transmitter.json | 56 +++++ .../green_wireless_transmitter.json | 56 +++++ .../light_gray_wireless_transmitter.json | 56 +++++ .../lime_wireless_transmitter.json | 56 +++++ .../magenta_wireless_transmitter.json | 56 +++++ .../orange_wireless_transmitter.json | 56 +++++ .../pink_wireless_transmitter.json | 56 +++++ .../purple_wireless_transmitter.json | 56 +++++ .../blockstates/red_wireless_transmitter.json | 56 +++++ .../white_wireless_transmitter.json | 56 +++++ .../blockstates/wireless_transmitter.json | 56 +++++ .../yellow_wireless_transmitter.json | 56 +++++ .../block/wireless_transmitter/black.json | 6 + .../block/wireless_transmitter/blue.json | 6 + .../block/wireless_transmitter/brown.json | 6 + .../block/wireless_transmitter/cyan.json | 6 + .../block/wireless_transmitter/gray.json | 6 + .../block/wireless_transmitter/green.json | 6 + .../wireless_transmitter/light_blue.json | 6 + .../wireless_transmitter/light_gray.json | 6 + .../block/wireless_transmitter/lime.json | 6 + .../block/wireless_transmitter/magenta.json | 6 + .../block/wireless_transmitter/orange.json | 6 + .../block/wireless_transmitter/pink.json | 6 + .../block/wireless_transmitter/purple.json | 6 + .../block/wireless_transmitter/red.json | 6 + .../block/wireless_transmitter/white.json | 6 + .../block/wireless_transmitter/yellow.json | 6 + .../item/black_wireless_transmitter.json | 6 + .../item/blue_wireless_transmitter.json | 6 + .../item/brown_wireless_transmitter.json | 6 + .../item/cyan_wireless_transmitter.json | 6 + .../item/gray_wireless_transmitter.json | 6 + .../item/green_wireless_transmitter.json | 6 + .../item/light_gray_wireless_transmitter.json | 6 + .../item/lime_wireless_transmitter.json | 6 + .../item/magenta_wireless_transmitter.json | 6 + .../item/orange_wireless_transmitter.json | 6 + .../item/pink_wireless_transmitter.json | 6 + .../item/purple_wireless_transmitter.json | 6 + .../models/item/red_wireless_transmitter.json | 6 + .../item/white_wireless_transmitter.json | 6 + .../models/item/wireless_transmitter.json | 6 + .../item/yellow_wireless_transmitter.json | 6 + .../coloring/black_wireless_transmitter.json | 33 +++ .../coloring/blue_wireless_transmitter.json | 33 +++ .../coloring/brown_wireless_transmitter.json | 33 +++ .../coloring/cyan_wireless_transmitter.json | 33 +++ .../coloring/gray_wireless_transmitter.json | 33 +++ .../coloring/green_wireless_transmitter.json | 33 +++ .../light_blue_wireless_transmitter.json | 33 +++ .../light_gray_wireless_transmitter.json | 33 +++ .../coloring/lime_wireless_transmitter.json | 33 +++ .../magenta_wireless_transmitter.json | 33 +++ .../coloring/orange_wireless_transmitter.json | 33 +++ .../coloring/pink_wireless_transmitter.json | 33 +++ .../coloring/purple_wireless_transmitter.json | 33 +++ .../coloring/red_wireless_transmitter.json | 33 +++ .../coloring/white_wireless_transmitter.json | 33 +++ .../coloring/yellow_wireless_transmitter.json | 33 +++ .../blocks/black_wireless_transmitter.json | 20 ++ .../blocks/blue_wireless_transmitter.json | 20 ++ .../blocks/brown_wireless_transmitter.json | 20 ++ .../blocks/cyan_wireless_transmitter.json | 20 ++ .../blocks/gray_wireless_transmitter.json | 20 ++ .../blocks/green_wireless_transmitter.json | 20 ++ .../light_gray_wireless_transmitter.json | 20 ++ .../blocks/lime_wireless_transmitter.json | 20 ++ .../blocks/magenta_wireless_transmitter.json | 20 ++ .../blocks/orange_wireless_transmitter.json | 20 ++ .../blocks/pink_wireless_transmitter.json | 20 ++ .../blocks/purple_wireless_transmitter.json | 20 ++ .../blocks/red_wireless_transmitter.json | 20 ++ .../blocks/white_wireless_transmitter.json | 20 ++ .../blocks/wireless_transmitter.json | 20 ++ .../blocks/yellow_wireless_transmitter.json | 20 ++ .../coloring/black_wireless_transmitter.json | 15 ++ .../coloring/blue_wireless_transmitter.json | 15 ++ .../coloring/brown_wireless_transmitter.json | 15 ++ .../coloring/cyan_wireless_transmitter.json | 15 ++ .../coloring/gray_wireless_transmitter.json | 15 ++ .../coloring/green_wireless_transmitter.json | 15 ++ .../light_blue_wireless_transmitter.json | 15 ++ .../light_gray_wireless_transmitter.json | 15 ++ .../coloring/lime_wireless_transmitter.json | 15 ++ .../magenta_wireless_transmitter.json | 15 ++ .../coloring/orange_wireless_transmitter.json | 15 ++ .../coloring/pink_wireless_transmitter.json | 15 ++ .../coloring/purple_wireless_transmitter.json | 15 ++ .../coloring/red_wireless_transmitter.json | 15 ++ .../coloring/white_wireless_transmitter.json | 15 ++ .../coloring/yellow_wireless_transmitter.json | 15 ++ .../tags/items/wireless_transmitters.json | 20 ++ .../common/AbstractClientModInitializer.java | 2 + .../common/AbstractModInitializer.java | 22 ++ .../platform/common/Config.java | 6 + .../platform/common/PlatformApiImpl.java | 14 ++ .../block/WirelessTransmitterBlock.java | 131 ++++++++++ ...deableNetworkNodeContainerBlockEntity.java | 41 +-- .../block/entity/ImporterBlockEntity.java | 4 +- .../common/block/entity/UpgradeContainer.java | 62 ++++- .../constructor/ConstructorBlockEntity.java | 2 +- .../ItemDropConstructorStrategyFactory.java | 2 +- .../BlockBreakDestructorStrategyFactory.java | 2 +- .../destructor/DestructorBlockEntity.java | 2 +- .../entity/exporter/ExporterBlockEntity.java | 7 +- .../BaseWirelessTransmitterRangeModifier.java | 12 + ...ositeWirelessTransmitterRangeModifier.java | 27 ++ .../WirelessTransmitterBlockEntity.java | 89 +++++++ .../wirelesstransmitter/package-info.java | 7 + .../WirelessTransmitterContainerMenu.java | 93 +++++++ .../common/content/BlockEntities.java | 11 + .../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 | 3 + .../platform/common/content/Items.java | 9 + .../platform/common/content/Menus.java | 11 + .../platform/common/content/Tags.java | 1 + .../common/internal/grid/WirelessGrid.java | 1 + .../grid/view/AbstractGridResource.java | 1 + .../internal/upgrade/UpgradeDestinations.java | 5 +- .../packet/ServerToClientCommunications.java | 2 + .../screen/WirelessTransmitterScreen.java | 50 ++++ .../assets/refinedstorage2/lang/en_us.json | 6 + .../block/wireless_transmitter/inactive.json | 234 ++++++++++++++++++ .../block/wireless_transmitter/base.png | Bin 0 -> 280 bytes .../wireless_transmitter/cutouts/black.png | Bin 0 -> 2865 bytes .../wireless_transmitter/cutouts/blue.png | Bin 0 -> 2877 bytes .../wireless_transmitter/cutouts/brown.png | Bin 0 -> 2878 bytes .../wireless_transmitter/cutouts/cyan.png | Bin 0 -> 2882 bytes .../wireless_transmitter/cutouts/gray.png | Bin 0 -> 2860 bytes .../wireless_transmitter/cutouts/green.png | Bin 0 -> 2881 bytes .../wireless_transmitter/cutouts/inactive.png | Bin 0 -> 147 bytes .../cutouts/light_blue.png | Bin 0 -> 257 bytes .../cutouts/light_gray.png | Bin 0 -> 2862 bytes .../wireless_transmitter/cutouts/lime.png | Bin 0 -> 2877 bytes .../wireless_transmitter/cutouts/magenta.png | Bin 0 -> 2874 bytes .../wireless_transmitter/cutouts/orange.png | Bin 0 -> 2865 bytes .../wireless_transmitter/cutouts/pink.png | Bin 0 -> 2858 bytes .../wireless_transmitter/cutouts/purple.png | Bin 0 -> 2882 bytes .../wireless_transmitter/cutouts/red.png | Bin 0 -> 2866 bytes .../wireless_transmitter/cutouts/white.png | Bin 0 -> 2862 bytes .../wireless_transmitter/cutouts/yellow.png | Bin 0 -> 2868 bytes .../textures/gui/wireless_transmitter.png | Bin 0 -> 2161 bytes .../advancements/wireless.json | 3 + .../recipes/wireless_transmitter.json | 25 ++ .../fabric/ClientModInitializerImpl.java | 19 ++ .../platform/fabric/ConfigImpl.java | 24 ++ .../rei/RefinedStorageREIClientPlugin.java | 14 +- ...torageExporterTransferStrategyFactory.java | 2 +- ...torageImporterTransferStrategyFactory.java | 2 +- .../platform/fabric/packet/PacketIds.java | 1 + .../s2c/ServerToClientCommunicationsImpl.java | 5 + .../s2c/WirelessTransmitterRangePacket.java | 24 ++ .../platform/forge/ConfigImpl.java | 31 +++ .../forge/datagen/BlockModelProvider.java | 8 + .../forge/datagen/BlockStateProvider.java | 20 ++ .../forge/datagen/ItemModelProvider.java | 13 + .../forge/datagen/loot/BlockDropProvider.java | 2 + .../recipe/RecoloringRecipeProvider.java | 3 + .../forge/datagen/tag/ItemTagGenerator.java | 5 + .../rei/RefinedStorageREIClientPlugin.java | 14 +- ...andlerExporterTransferStrategyFactory.java | 2 +- ...andlerExporterTransferStrategyFactory.java | 2 +- ...andlerImporterTransferStrategyFactory.java | 2 +- ...andlerImporterTransferStrategyFactory.java | 2 +- .../platform/forge/packet/NetworkManager.java | 8 + .../s2c/ServerToClientCommunicationsImpl.java | 5 + .../s2c/WirelessTransmitterRangePacket.java | 39 +++ 181 files changed, 3332 insertions(+), 56 deletions(-) create mode 100644 refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java create mode 100644 refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json create mode 100644 refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/base.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/black.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/blue.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/brown.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/cyan.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/gray.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/green.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/inactive.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_blue.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_gray.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/lime.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/magenta.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/orange.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/pink.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/purple.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/red.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/white.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/yellow.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/wireless_transmitter.png create mode 100644 refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json create mode 100644 refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java create mode 100644 refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ca687a57..5af0a952f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Wireless Grid - Creative Wireless Grid +- Wireless Transmitter ### Changed diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java index 4d08529c5..c00bcd513 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java @@ -6,6 +6,7 @@ import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; @@ -127,4 +128,8 @@ GridScrollingStrategy createGridScrollingStrategy(AbstractContainerMenu containe void registerIngredientConverter(IngredientConverter converter); IngredientConverter getIngredientConverter(); + + void addWirelessTransmitterRangeModifier(WirelessTransmitterRangeModifier rangeModifier); + + WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier(); } diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java index 0dad49244..04d458d61 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java @@ -6,6 +6,7 @@ import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; @@ -254,6 +255,16 @@ public IngredientConverter getIngredientConverter() { return ensureLoaded().getIngredientConverter(); } + @Override + public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { + ensureLoaded().addWirelessTransmitterRangeModifier(rangeModifier); + } + + @Override + public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { + return ensureLoaded().getWirelessTransmitterRangeModifier(); + } + private PlatformApi ensureLoaded() { if (delegate == null) { throw new IllegalStateException("Platform API not loaded yet"); diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..d3a241f95 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitterRangeModifier.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +@FunctionalInterface +public interface WirelessTransmitterRangeModifier { + int modifyRange(UpgradeState upgradeState, int range); + + default int getPriority() { + return 0; + } +} diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java new file mode 100644 index 000000000..71e76a806 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java index ffe8758af..277d7944a 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/UpgradeState.java @@ -3,7 +3,8 @@ import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.2.10") -@FunctionalInterface public interface UpgradeState { - boolean hasUpgrade(UpgradeItem upgradeItem); + boolean has(UpgradeItem upgradeItem); + + int getAmount(UpgradeItem upgradeItem); } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json new file mode 100644 index 000000000..cf655c2c7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/black" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/black", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json new file mode 100644 index 000000000..a937ae334 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/blue" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/blue", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json new file mode 100644 index 000000000..ec87ad816 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/brown" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/brown", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json new file mode 100644 index 000000000..601db88a7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/cyan" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/cyan", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json new file mode 100644 index 000000000..6f2994d89 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/gray" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/gray", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json new file mode 100644 index 000000000..de7d61c01 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/green" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/green", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..ff3ae52e7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/light_gray", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json new file mode 100644 index 000000000..5d975ed16 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/lime" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/lime", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json new file mode 100644 index 000000000..c114a2514 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/magenta" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/magenta", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json new file mode 100644 index 000000000..df7228375 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/orange" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/orange", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json new file mode 100644 index 000000000..744c8852f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/pink" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/pink", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json new file mode 100644 index 000000000..b2d30a531 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/purple" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/purple", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json new file mode 100644 index 000000000..8e18d1e4c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/red" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/red", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json new file mode 100644 index 000000000..5e8c29e49 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/white" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/white", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json new file mode 100644 index 000000000..25d401ac6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/light_blue", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json new file mode 100644 index 000000000..1fdb6428c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_wireless_transmitter.json @@ -0,0 +1,56 @@ +{ + "variants": { + "active=false,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/inactive" + }, + "active=false,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 270 + }, + "active=false,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 180 + }, + "active=false,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90 + }, + "active=false,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 180 + }, + "active=false,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/inactive", + "x": 90, + "y": 90 + }, + "active=true,direction=down": { + "model": "refinedstorage2:block/wireless_transmitter/yellow" + }, + "active=true,direction=east": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90, + "y": 270 + }, + "active=true,direction=north": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90, + "y": 180 + }, + "active=true,direction=south": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90 + }, + "active=true,direction=up": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 180 + }, + "active=true,direction=west": { + "model": "refinedstorage2:block/wireless_transmitter/yellow", + "x": 90, + "y": 90 + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json new file mode 100644 index 000000000..e1ff55758 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/black.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json new file mode 100644 index 000000000..65cfb5050 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/blue.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json new file mode 100644 index 000000000..c025eb4ca --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/brown.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json new file mode 100644 index 000000000..09e3a6d52 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json new file mode 100644 index 000000000..22092dae1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/gray.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json new file mode 100644 index 000000000..fcf5eb934 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/green.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json new file mode 100644 index 000000000..4d994ede4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_blue.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json new file mode 100644 index 000000000..79d7f8f33 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/light_gray.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json new file mode 100644 index 000000000..18066c311 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/lime.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json new file mode 100644 index 000000000..55e545d09 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/magenta.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json new file mode 100644 index 000000000..3d53d67e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/orange.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json new file mode 100644 index 000000000..2f33a8fe5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/pink.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json new file mode 100644 index 000000000..80c889144 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/purple.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json new file mode 100644 index 000000000..ddd8adffa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/red.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json new file mode 100644 index 000000000..fa1e3b66d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/white.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json new file mode 100644 index 000000000..fa82c3620 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/wireless_transmitter/yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json new file mode 100644 index 000000000..e1ff55758 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json new file mode 100644 index 000000000..65cfb5050 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json new file mode 100644 index 000000000..c025eb4ca --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json new file mode 100644 index 000000000..09e3a6d52 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json new file mode 100644 index 000000000..22092dae1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json new file mode 100644 index 000000000..fcf5eb934 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..79d7f8f33 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json new file mode 100644 index 000000000..18066c311 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json new file mode 100644 index 000000000..55e545d09 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json new file mode 100644 index 000000000..3d53d67e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json new file mode 100644 index 000000000..2f33a8fe5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json new file mode 100644 index 000000000..80c889144 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json new file mode 100644 index 000000000..ddd8adffa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json new file mode 100644 index 000000000..fa1e3b66d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json new file mode 100644 index 000000000..4d994ede4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json new file mode 100644 index 000000000..fa82c3620 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_wireless_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/wireless_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_wireless_transmitter.json new file mode 100644 index 000000000..2f85c7a7c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/black_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/black_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_wireless_transmitter.json new file mode 100644 index 000000000..c26a239fa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/blue_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/blue_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_wireless_transmitter.json new file mode 100644 index 000000000..9147d3182 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/brown_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/brown_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_wireless_transmitter.json new file mode 100644 index 000000000..5b6e8dcee --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/cyan_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/cyan_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_wireless_transmitter.json new file mode 100644 index 000000000..81b0f4c6f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/gray_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/gray_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_wireless_transmitter.json new file mode 100644 index 000000000..b4e0ca28e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/green_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/green_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_wireless_transmitter.json new file mode 100644 index 000000000..c7b4ed99b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_blue_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_blue_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..5909bc045 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_gray_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_gray_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_wireless_transmitter.json new file mode 100644 index 000000000..73ca47661 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/lime_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/lime_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_wireless_transmitter.json new file mode 100644 index 000000000..c75ed2bcc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/magenta_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/magenta_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_wireless_transmitter.json new file mode 100644 index 000000000..490111439 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/orange_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/orange_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_wireless_transmitter.json new file mode 100644 index 000000000..9b36d5e85 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/pink_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/pink_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_wireless_transmitter.json new file mode 100644 index 000000000..7fbd3a1fa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/purple_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/purple_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_wireless_transmitter.json new file mode 100644 index 000000000..fcd5ba77d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/red_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/red_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_wireless_transmitter.json new file mode 100644 index 000000000..dac38efab --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/white_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/white_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_wireless_transmitter.json new file mode 100644 index 000000000..7441aac81 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_wireless_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/yellow_wireless_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:wireless_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_wireless_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/yellow_wireless_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_wireless_transmitter.json new file mode 100644 index 000000000..aac4414b8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:black_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/black_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json new file mode 100644 index 000000000..700a5b4d5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:blue_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/blue_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json new file mode 100644 index 000000000..999709155 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:brown_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/brown_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json new file mode 100644 index 000000000..bc519e8f2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:cyan_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/cyan_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json new file mode 100644 index 000000000..57a970c1b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:gray_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/gray_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json new file mode 100644 index 000000000..fcdf20e4f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:green_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/green_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..63a18bdc3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:light_gray_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/light_gray_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json new file mode 100644 index 000000000..49c297dc6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:lime_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/lime_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json new file mode 100644 index 000000000..5694135d2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:magenta_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/magenta_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json new file mode 100644 index 000000000..86becf6e7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:orange_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/orange_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json new file mode 100644 index 000000000..162626eaa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:pink_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/pink_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json new file mode 100644 index 000000000..a39f427aa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:purple_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/purple_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json new file mode 100644 index 000000000..aaaee6423 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:red_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/red_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json new file mode 100644 index 000000000..0ef3b6fb2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:white_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/white_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json new file mode 100644 index 000000000..193747431 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json new file mode 100644 index 000000000..a977b9fbb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_wireless_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:yellow_wireless_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/yellow_wireless_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json new file mode 100644 index 000000000..1b63b86cb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:black_dye" + } + ], + "result": { + "item": "refinedstorage2:black_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json new file mode 100644 index 000000000..50622ac43 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:blue_dye" + } + ], + "result": { + "item": "refinedstorage2:blue_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json new file mode 100644 index 000000000..1766affaa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:brown_dye" + } + ], + "result": { + "item": "refinedstorage2:brown_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json new file mode 100644 index 000000000..23b00b985 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:cyan_dye" + } + ], + "result": { + "item": "refinedstorage2:cyan_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json new file mode 100644 index 000000000..bbf671537 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:gray_dye" + } + ], + "result": { + "item": "refinedstorage2:gray_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json new file mode 100644 index 000000000..3424885f4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:green_dye" + } + ], + "result": { + "item": "refinedstorage2:green_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json new file mode 100644 index 000000000..079c8c7c6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:light_blue_dye" + } + ], + "result": { + "item": "refinedstorage2:wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json new file mode 100644 index 000000000..842a8f574 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:light_gray_dye" + } + ], + "result": { + "item": "refinedstorage2:light_gray_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json new file mode 100644 index 000000000..433477fa0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:lime_dye" + } + ], + "result": { + "item": "refinedstorage2:lime_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json new file mode 100644 index 000000000..ac923b7ab --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:magenta_dye" + } + ], + "result": { + "item": "refinedstorage2:magenta_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json new file mode 100644 index 000000000..bf313bc0a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:orange_dye" + } + ], + "result": { + "item": "refinedstorage2:orange_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json new file mode 100644 index 000000000..1cadb50c8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:pink_dye" + } + ], + "result": { + "item": "refinedstorage2:pink_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json new file mode 100644 index 000000000..3988644af --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:purple_dye" + } + ], + "result": { + "item": "refinedstorage2:purple_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json new file mode 100644 index 000000000..97575a878 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:red_dye" + } + ], + "result": { + "item": "refinedstorage2:red_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json new file mode 100644 index 000000000..72ec2e841 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:white_dye" + } + ], + "result": { + "item": "refinedstorage2:white_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json new file mode 100644 index 000000000..f3b6744ca --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_wireless_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:wireless_transmitters" + }, + { + "item": "minecraft:yellow_dye" + } + ], + "result": { + "item": "refinedstorage2:yellow_wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json new file mode 100644 index 000000000..0d8e90a5e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/wireless_transmitters.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage2:white_wireless_transmitter", + "refinedstorage2:orange_wireless_transmitter", + "refinedstorage2:magenta_wireless_transmitter", + "refinedstorage2:wireless_transmitter", + "refinedstorage2:yellow_wireless_transmitter", + "refinedstorage2:lime_wireless_transmitter", + "refinedstorage2:pink_wireless_transmitter", + "refinedstorage2:gray_wireless_transmitter", + "refinedstorage2:light_gray_wireless_transmitter", + "refinedstorage2:cyan_wireless_transmitter", + "refinedstorage2:purple_wireless_transmitter", + "refinedstorage2:blue_wireless_transmitter", + "refinedstorage2:brown_wireless_transmitter", + "refinedstorage2:green_wireless_transmitter", + "refinedstorage2:red_wireless_transmitter", + "refinedstorage2:black_wireless_transmitter" + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java index b5a709626..fde55a532 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java @@ -19,6 +19,7 @@ import com.refinedmods.refinedstorage2.platform.common.screen.InterfaceScreen; import com.refinedmods.refinedstorage2.platform.common.screen.ItemStorageBlockScreen; import com.refinedmods.refinedstorage2.platform.common.screen.RegulatorUpgradeScreen; +import com.refinedmods.refinedstorage2.platform.common.screen.WirelessTransmitterScreen; import com.refinedmods.refinedstorage2.platform.common.screen.amount.DetectorScreen; import com.refinedmods.refinedstorage2.platform.common.screen.grid.CraftingGridScreen; import com.refinedmods.refinedstorage2.platform.common.screen.grid.GridScreen; @@ -48,6 +49,7 @@ protected static void registerScreens(final ScreenRegistration registration) { registration.register(Menus.INSTANCE.getDestructor(), DestructorScreen::new); registration.register(Menus.INSTANCE.getConstructor(), ConstructorScreen::new); registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); + registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::new); } protected static void registerAlternativeGridHints() { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java index 3b64c1e01..183bdaf51 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java @@ -35,6 +35,8 @@ import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.FluidStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.ItemStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.containermenu.ConstructorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.DestructorContainerMenu; @@ -42,6 +44,7 @@ import com.refinedmods.refinedstorage2.platform.common.containermenu.ImporterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.InterfaceContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.RegulatorUpgradeContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.detector.DetectorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.GridContainerMenu; @@ -121,6 +124,7 @@ import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STORAGE_BLOCK; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.STORAGE_HOUSING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WIRELESS_GRID; +import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WIRELESS_TRANSMITTER; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.WRENCH; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.forFluidStorageBlock; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.forFluidStorageDisk; @@ -146,6 +150,7 @@ protected final void initializePlatformApi() { registerDestructorStrategyFactories(); registerConstructorStrategyFactories(); registerNetworkComponents(); + registerWirelessTransmitterRangeModifiers(); } private void registerAdditionalStorageTypes() { @@ -199,6 +204,10 @@ private void registerNetworkComponents() { ); } + private void registerWirelessTransmitterRangeModifiers() { + PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new BaseWirelessTransmitterRangeModifier()); + } + protected final void registerBlocks( final RegistryCallback callback, final BiFunction diskDriveBlockEntityFactory @@ -232,6 +241,7 @@ protected final void registerBlocks( Blocks.INSTANCE.getConstructor().registerBlocks(callback); Blocks.INSTANCE.getDestructor().registerBlocks(callback); Blocks.INSTANCE.setInterface(callback.register(INTERFACE, InterfaceBlock::new)); + Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); } protected final void registerItems( @@ -252,6 +262,7 @@ protected final void registerItems( Blocks.INSTANCE.getExternalStorage().registerItems(callback, Items.INSTANCE::addExternalStorage); Blocks.INSTANCE.getConstructor().registerItems(callback, Items.INSTANCE::addConstructor); Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); + Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); registerStorageItems(callback); registerUpgrades(callback, regulatorUpgradeItemSupplier); Items.INSTANCE.setWirelessGrid(callback.register(ContentIds.WIRELESS_GRID, wirelessGridItemSupplier)); @@ -493,6 +504,13 @@ protected final void registerBlockEntities( DESTRUCTOR, () -> typeFactory.create(DestructorBlockEntity::new, Blocks.INSTANCE.getDestructor().toArray()) )); + BlockEntities.INSTANCE.setWirelessTransmitter(callback.register( + WIRELESS_TRANSMITTER, + () -> typeFactory.create( + WirelessTransmitterBlockEntity::new, + Blocks.INSTANCE.getWirelessTransmitter().toArray() + ) + )); } protected final void registerMenus(final RegistryCallback> callback, @@ -557,6 +575,10 @@ protected final void registerMenus(final RegistryCallback> callback, REGULATOR_UPGRADE, () -> menuTypeFactory.create(RegulatorUpgradeContainerMenu::new) )); + Menus.INSTANCE.setWirelessTransmitter(callback.register( + WIRELESS_TRANSMITTER, + () -> menuTypeFactory.create(WirelessTransmitterContainerMenu::new) + )); } protected final void registerLootFunctions(final RegistryCallback callback) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java index 2a43e5b8a..43c982d68 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java @@ -42,6 +42,8 @@ public interface Config { WirelessGridEntry getWirelessGrid(); + WirelessTransmitterEntry getWirelessTransmitter(); + interface SimpleEnergyUsageEntry { long getEnergyUsage(); } @@ -151,4 +153,8 @@ interface WirelessGridEntry { long getExtractEnergyUsage(); } + + interface WirelessTransmitterEntry extends SimpleEnergyUsageEntry { + int getBaseRange(); + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java index e8d46135a..cf6836fa7 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java @@ -10,6 +10,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.blockentity.constructor.ConstructorStrategyFactory; import com.refinedmods.refinedstorage2.platform.api.blockentity.destructor.DestructorStrategyFactory; +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategyFactory; @@ -34,6 +35,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.common.integration.recipemod.CompositeIngredientConverter; import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.common.internal.grid.CompositeGridInsertionStrategy; @@ -120,6 +122,8 @@ public class PlatformApiImpl implements PlatformApi { private final ResourceFactory fluidResourceFactory = new FluidResourceFactory(); private final Set> resourceFactories = new HashSet<>(); private final Map, ResourceRendering> resourceRenderingMap = new HashMap<>(); + private final CompositeWirelessTransmitterRangeModifier wirelessTransmitterRangeModifier = + new CompositeWirelessTransmitterRangeModifier(); @Override public PlatformRegistry> getStorageTypeRegistry() { @@ -369,4 +373,14 @@ public void registerIngredientConverter(final IngredientConverter converter) { public IngredientConverter getIngredientConverter() { return compositeConverter; } + + @Override + public void addWirelessTransmitterRangeModifier(final WirelessTransmitterRangeModifier rangeModifier) { + wirelessTransmitterRangeModifier.addModifier(rangeModifier); + } + + @Override + public WirelessTransmitterRangeModifier getWirelessTransmitterRangeModifier() { + return wirelessTransmitterRangeModifier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java new file mode 100644 index 000000000..6f069a0d5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/WirelessTransmitterBlock.java @@ -0,0 +1,131 @@ +package com.refinedmods.refinedstorage2.platform.common.block; + +import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionType; +import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionTypeImpl; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.block.ticker.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.block.ticker.NetworkNodeBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.item.block.NamedBlockItem; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +public class WirelessTransmitterBlock extends AbstractDirectionalBlock + implements ColorableBlock, BlockItemProvider, EntityBlock { + public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getWirelessTransmitter, ACTIVE); + private static final Component HELP = createTranslation("item", "wireless_transmitter.help"); + + private static final VoxelShape SHAPE_DOWN = box(6.0D, 0.0D, 6.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_UP = box(6.0D, 6.0D, 6.0D, 10.0D, 16.0D, 10.0D); + private static final VoxelShape SHAPE_EAST = box(6.0D, 6.0D, 6.0D, 16.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_WEST = box(0.0D, 6.0D, 6.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_NORTH = box(6.0D, 6.0D, 0.0D, 10.0D, 10.0D, 10.0D); + private static final VoxelShape SHAPE_SOUTH = box(6.0D, 6.0D, 6.0D, 10.0D, 10.0D, 16.0D); + + private final DyeColor color; + private final MutableComponent name; + + public WirelessTransmitterBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES); + this.color = color; + this.name = name; + } + + @Override + protected BlockState getDefaultState() { + return super.getDefaultState().setValue(ACTIVE, false); + } + + @Override + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(ACTIVE); + } + + @Override + protected DirectionType getDirectionType() { + return DirectionTypeImpl.INSTANCE; + } + + @Override + @SuppressWarnings("deprecation") + public VoxelShape getShape(final BlockState state, + final BlockGetter world, + final BlockPos pos, + final CollisionContext context) { + final Direction direction = getDirection(state); + if (direction == null) { + return Shapes.empty(); + } + return switch (direction) { + case DOWN -> SHAPE_DOWN; + case UP -> SHAPE_UP; + case NORTH -> SHAPE_NORTH; + case SOUTH -> SHAPE_SOUTH; + case WEST -> SHAPE_WEST; + case EAST -> SHAPE_EAST; + }; + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getWirelessTransmitter(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { + return new WirelessTransmitterBlockEntity(pos, state); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } + + @Override + public DyeColor getColor() { + return color; + } + + @Override + public MutableComponent getName() { + return name; + } + + @Override + public BlockItem createBlockItem() { + return new NamedBlockItem(this, new Item.Properties(), getName(), HELP); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java index 42bd57ead..c1a725fe3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/AbstractUpgradeableNetworkNodeContainerBlockEntity.java @@ -2,30 +2,31 @@ import com.refinedmods.refinedstorage2.api.network.node.AbstractNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; -import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeItem; import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; import com.google.common.util.concurrent.RateLimiter; -import it.unimi.dsi.fastutil.objects.Object2IntMap; -import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public abstract class AbstractUpgradeableNetworkNodeContainerBlockEntity extends AbstractLevelInteractingNetworkNodeContainerBlockEntity implements BlockEntityWithDrops { + private static final Logger LOGGER = LoggerFactory.getLogger( + AbstractUpgradeableNetworkNodeContainerBlockEntity.class + ); + private static final String TAG_UPGRADES = "u"; protected final UpgradeContainer upgradeContainer; - private final Object2IntMap upgradeState = new Object2IntOpenHashMap<>(); private RateLimiter rateLimiter = createRateLimiter(0); protected AbstractUpgradeableNetworkNodeContainerBlockEntity( @@ -78,34 +79,10 @@ public void load(final CompoundTag tag) { } private void configureAccordingToUpgrades() { - updateUpgradeState(); - final int amountOfSpeedUpgrades = upgradeState.getInt(Items.INSTANCE.getSpeedUpgrade()); + LOGGER.info("Reconfiguring {} for upgrades", getBlockPos()); + final int amountOfSpeedUpgrades = upgradeContainer.getAmount(Items.INSTANCE.getSpeedUpgrade()); this.rateLimiter = createRateLimiter(amountOfSpeedUpgrades); - final long upgradeEnergyUsage = upgradeState.keySet().stream().mapToLong(UpgradeItem::getEnergyUsage).sum(); - this.setEnergyUsage(upgradeEnergyUsage); - } - - private void updateUpgradeState() { - this.upgradeState.clear(); - for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { - updateUpgradeState(i); - } - } - - private void updateUpgradeState(final int index) { - final ItemStack stack = upgradeContainer.getItem(index); - if (stack.isEmpty()) { - return; - } - final Item item = stack.getItem(); - if (!(item instanceof UpgradeItem upgradeItem)) { - return; - } - upgradeState.put(upgradeItem, upgradeState.getInt(upgradeItem) + 1); - } - - public final boolean hasUpgrade(final UpgradeItem upgradeItem) { - return upgradeState.containsKey(upgradeItem); + this.setEnergyUsage(upgradeContainer.getEnergyUsage()); } protected abstract void setEnergyUsage(long upgradeEnergyUsage); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java index 94e7c1373..f283e7c8e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ImporterBlockEntity.java @@ -74,7 +74,7 @@ private CompositeImporterTransferStrategy createStrategy(final ServerLevel serve PlatformApi.INSTANCE.getImporterTransferStrategyRegistry().getAll(); final List strategies = factories .stream() - .map(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, this::hasUpgrade, this)) + .map(factory -> factory.create(serverLevel, sourcePosition, incomingDirection, upgradeContainer, this)) .toList(); return new CompositeImporterTransferStrategy(strategies); } @@ -140,7 +140,7 @@ public AbstractContainerMenu createMenu(final int syncId, final Inventory invent public long overrideAmount(final T resource, final long amount, final LongSupplier currentAmount) { - if (!hasUpgrade(Items.INSTANCE.getRegulatorUpgrade())) { + if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { return amount; } return upgradeContainer.getRegulatedAmount(resource) diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java index cbef71ee9..bd80803be 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/UpgradeContainer.java @@ -1,20 +1,31 @@ package com.refinedmods.refinedstorage2.platform.common.block.entity; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeItem; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeMapping; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; import java.util.OptionalLong; import java.util.Set; import java.util.stream.IntStream; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import net.minecraft.nbt.ListTag; import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class UpgradeContainer extends SimpleContainer implements UpgradeState { + private static final Logger LOGGER = LoggerFactory.getLogger(UpgradeContainer.class); -public class UpgradeContainer extends SimpleContainer { private final UpgradeDestination destination; private final UpgradeRegistry registry; + private final Object2IntMap index = new Object2IntOpenHashMap<>(); public UpgradeContainer(final UpgradeDestination destination, final UpgradeRegistry registry) { @@ -28,6 +39,7 @@ public UpgradeContainer(final UpgradeDestination destination, super(4); this.destination = destination; this.registry = registry; + this.addListener(container -> updateIndex()); this.addListener(container -> listener.run()); } @@ -63,4 +75,52 @@ public OptionalLong getRegulatedAmount(final T resource) { .flatMapToLong(stack -> ((RegulatorUpgradeItem) stack.getItem()).getDesiredAmount(stack, resource).stream()) .findFirst(); } + + @Override + public void fromTag(final ListTag tag) { + super.fromTag(tag); + updateIndex(); + } + + private void updateIndex() { + LOGGER.info("Updating upgrade index for {}", destination); + index.clear(); + for (int i = 0; i < getContainerSize(); ++i) { + updateIndex(i); + } + } + + private void updateIndex(final int slotIndex) { + final ItemStack stack = getItem(slotIndex); + if (stack.isEmpty()) { + return; + } + final Item item = stack.getItem(); + if (!(item instanceof UpgradeItem upgradeItem)) { + return; + } + index.put(upgradeItem, index.getInt(upgradeItem) + 1); + } + + @Override + public boolean has(final UpgradeItem upgradeItem) { + return index.containsKey(upgradeItem); + } + + @Override + public int getAmount(final UpgradeItem upgradeItem) { + return index.getInt(upgradeItem); + } + + public long getEnergyUsage() { + long usage = 0; + for (int i = 0; i < getContainerSize(); ++i) { + final ItemStack stack = getItem(i); + if (!(stack.getItem() instanceof UpgradeItem upgradeItem)) { + continue; + } + usage += upgradeItem.getEnergyUsage(); + } + return usage; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java index 4b9627bf5..83bc15bcf 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ConstructorBlockEntity.java @@ -77,7 +77,7 @@ private ConstructorStrategy createStrategy(final ServerLevel serverLevel, final serverLevel, sourcePosition, incomingDirection, - this::hasUpgrade, + upgradeContainer, dropItems ).stream()) .toList(); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java index d4b5ddbd2..849711b6d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/constructor/ItemDropConstructorStrategyFactory.java @@ -25,7 +25,7 @@ public Optional create(final ServerLevel level, level, pos, direction, - upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) + upgradeState.has(Items.INSTANCE.getStackUpgrade()) )); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java index a046265bc..df66a81f9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/BlockBreakDestructorStrategyFactory.java @@ -38,7 +38,7 @@ public Optional create(final ServerLevel level, private ItemStack createTool(final UpgradeState state) { for (final Tool tool : TOOLS) { - if (state.hasUpgrade(tool.itemSupplier.get())) { + if (state.has(tool.itemSupplier.get())) { return tool.tool; } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java index db37d0828..5cff0b162 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/destructor/DestructorBlockEntity.java @@ -137,7 +137,7 @@ protected void initialize(final ServerLevel level, final Direction direction) { final Direction incomingDirection = direction.getOpposite(); final List strategies = PlatformApi.INSTANCE.getDestructorStrategyFactories() .stream() - .flatMap(factory -> factory.create(level, pos, incomingDirection, this::hasUpgrade, pickupItems).stream()) + .flatMap(factory -> factory.create(level, pos, incomingDirection, upgradeContainer, pickupItems).stream()) .toList(); this.strategy = new CompositeDestructorStrategy(strategies); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java index 63d527261..cd9be6ecb 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/exporter/ExporterBlockEntity.java @@ -7,7 +7,6 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.AmountOverride; import com.refinedmods.refinedstorage2.platform.api.network.node.exporter.ExporterTransferStrategyFactory; -import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractSchedulingNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.containermenu.ExporterContainerMenu; @@ -34,7 +33,7 @@ public class ExporterBlockEntity extends AbstractSchedulingNetworkNodeContainerBlockEntity - implements AmountOverride, UpgradeState { + implements AmountOverride { private static final Logger LOGGER = LoggerFactory.getLogger(ExporterBlockEntity.class); public ExporterBlockEntity(final BlockPos pos, final BlockState state) { @@ -65,7 +64,7 @@ private ExporterTransferStrategy createStrategy(final ServerLevel serverLevel, f serverLevel, sourcePosition, incomingDirection, - this, + upgradeContainer, this, filter.isFuzzyMode() )) @@ -102,7 +101,7 @@ protected void setFilterTemplates(final List templates) { @Override public long overrideAmount(final T resource, final long amount, final LongSupplier currentAmount) { - if (!hasUpgrade(Items.INSTANCE.getRegulatorUpgrade())) { + if (!upgradeContainer.has(Items.INSTANCE.getRegulatorUpgrade())) { return amount; } return upgradeContainer.getRegulatedAmount(resource) diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..a284249d5 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/BaseWirelessTransmitterRangeModifier.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.common.Platform; + +public class BaseWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + return Platform.INSTANCE.getConfig().getWirelessTransmitter().getBaseRange() + range; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..377779e3c --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CompositeWirelessTransmitterRangeModifier.java @@ -0,0 +1,27 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; + +import java.util.Comparator; +import java.util.PriorityQueue; +import java.util.Queue; + +public class CompositeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + private final Queue modifiers = new PriorityQueue<>( + Comparator.comparingInt(WirelessTransmitterRangeModifier::getPriority) + ); + + public void addModifier(final WirelessTransmitterRangeModifier rangeModifier) { + modifiers.add(rangeModifier); + } + + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + int result = range; + for (final WirelessTransmitterRangeModifier rangeModifier : modifiers) { + result = rangeModifier.modifyRange(upgradeState, result); + } + return result; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java new file mode 100644 index 000000000..b38f4658f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -0,0 +1,89 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; +import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.menu.ExtendedMenuProvider; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.state.BlockState; + +// TODO: Range Upgrade. +// TODO: Check advancement +public class WirelessTransmitterBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity + implements ExtendedMenuProvider { + private static final String TAG_UPGRADES = "u"; + + private final UpgradeContainer upgradeContainer = new UpgradeContainer( + UpgradeDestinations.WIRELESS_TRANSMITTER, + PlatformApi.INSTANCE.getUpgradeRegistry(), + this::setChanged + ); + + public WirelessTransmitterBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getWirelessTransmitter(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage() + )); + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + tag.put(TAG_UPGRADES, upgradeContainer.createTag()); + } + + @Override + public void load(final CompoundTag tag) { + if (tag.contains(TAG_UPGRADES)) { + upgradeContainer.fromTag(tag.getList(TAG_UPGRADES, Tag.TAG_COMPOUND)); + } + super.load(tag); + } + + @Override + public boolean canPerformOutgoingConnection(final Direction direction) { + return direction == getDirection(); + } + + @Override + public boolean canAcceptIncomingConnection(final Direction direction, final BlockState other) { + return colorsAllowConnecting(other) && direction.getOpposite() == getDirection(); + } + + @Override + public Component getDisplayName() { + return ContentNames.WIRELESS_TRANSMITTER; + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new WirelessTransmitterContainerMenu(syncId, inventory, this, upgradeContainer); + } + + public int getRange() { + return PlatformApi.INSTANCE.getWirelessTransmitterRangeModifier().modifyRange(upgradeContainer, 0); + } + + @Override + public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { + buf.writeInt(getRange()); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java new file mode 100644 index 000000000..feb736764 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@FieldsAndMethodsAreNonnullByDefault +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.api.core.FieldsAndMethodsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java new file mode 100644 index 000000000..bc6e1de5f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/containermenu/WirelessTransmitterContainerMenu.java @@ -0,0 +1,93 @@ +package com.refinedmods.refinedstorage2.platform.common.containermenu; + +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.containermenu.property.ServerProperty; +import com.refinedmods.refinedstorage2.platform.common.containermenu.slot.UpgradeSlot; +import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.common.util.RedstoneMode; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class WirelessTransmitterContainerMenu extends AbstractBaseContainerMenu { + private final RateLimiter rangeRateLimiter = RateLimiter.create(4); + + private int range; + @Nullable + private final WirelessTransmitterBlockEntity wirelessTransmitter; + private final Player player; + + public WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final FriendlyByteBuf buf) { + super(Menus.INSTANCE.getWirelessTransmitter(), syncId); + addSlots(playerInventory, new UpgradeContainer( + UpgradeDestinations.WIRELESS_TRANSMITTER, + PlatformApi.INSTANCE.getUpgradeRegistry() + )); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.range = buf.readInt(); + this.wirelessTransmitter = null; + this.player = playerInventory.player; + } + + public WirelessTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final WirelessTransmitterBlockEntity wirelessTransmitter, + final UpgradeContainer upgradeContainer) { + super(Menus.INSTANCE.getWirelessTransmitter(), syncId); + addSlots(playerInventory, upgradeContainer); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + wirelessTransmitter::getRedstoneMode, + wirelessTransmitter::setRedstoneMode + )); + this.range = wirelessTransmitter.getRange(); + this.wirelessTransmitter = wirelessTransmitter; + this.player = playerInventory.player; + } + + private void addSlots(final Inventory playerInventory, final UpgradeContainer upgradeContainer) { + addPlayerInventory(playerInventory, 8, 55); + for (int i = 0; i < upgradeContainer.getContainerSize(); ++i) { + addSlot(new UpgradeSlot(upgradeContainer, i, 187, 6 + (i * 18))); + } + transferManager.addBiTransfer(playerInventory, upgradeContainer); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + if (wirelessTransmitter == null) { + return; + } + final int newRange = wirelessTransmitter.getRange(); + final boolean changed = range != newRange; + if (changed && rangeRateLimiter.tryAcquire()) { + this.range = newRange; + Platform.INSTANCE.getServerToClientCommunications().sendWirelessTransmitterRange( + (ServerPlayer) player, + range + ); + } + } + + public int getRange() { + return range; + } + + public void setRange(final int range) { + this.range = range; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java index b6ffa50f7..9ca78ce92 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java @@ -14,6 +14,7 @@ import com.refinedmods.refinedstorage2.platform.common.block.entity.iface.InterfaceBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.FluidStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.ItemStorageBlockBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; @@ -58,6 +59,8 @@ public final class BlockEntities { private Supplier> destructor; @Nullable private Supplier> constructor; + @Nullable + private Supplier> wirelessTransmitter; private BlockEntities() { } @@ -183,4 +186,12 @@ public BlockEntityType getConstructor() { public void setConstructor(final Supplier> supplier) { this.constructor = supplier; } + + public BlockEntityType getWirelessTransmitter() { + return Objects.requireNonNull(wirelessTransmitter).get(); + } + + public void setWirelessTransmitter(final Supplier> supplier) { + this.wirelessTransmitter = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java index 90700b7ac..c4da073cc 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java @@ -14,6 +14,7 @@ import com.refinedmods.refinedstorage2.platform.common.block.InterfaceBlock; import com.refinedmods.refinedstorage2.platform.common.block.ItemStorageBlock; import com.refinedmods.refinedstorage2.platform.common.block.SimpleBlock; +import com.refinedmods.refinedstorage2.platform.common.block.WirelessTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.block.grid.CraftingGridBlock; import com.refinedmods.refinedstorage2.platform.common.block.grid.GridBlock; import com.refinedmods.refinedstorage2.platform.common.block.ticker.ControllerBlockEntityTicker; @@ -109,6 +110,12 @@ public final class Blocks { ContentNames.CONSTRUCTOR, CABLE_LIKE_COLOR ); + private final BlockColorMap wirelessTransmitter = new BlockColorMap<>( + WirelessTransmitterBlock::new, + ContentIds.WIRELESS_TRANSMITTER, + ContentNames.WIRELESS_TRANSMITTER, + COLOR + ); @Nullable private Supplier quartzEnrichedIronBlock; @@ -218,4 +225,8 @@ public BlockColorMap getDestructor() { public BlockColorMap getConstructor() { return constructor; } + + public BlockColorMap getWirelessTransmitter() { + return wirelessTransmitter; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java index 4b7850122..85afd39ba 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java @@ -44,6 +44,7 @@ public final class ContentIds { public static final ResourceLocation CONSTRUCTOR = createIdentifier("constructor"); public static final ResourceLocation WIRELESS_GRID = createIdentifier("wireless_grid"); public static final ResourceLocation CREATIVE_WIRELESS_GRID = createIdentifier("creative_wireless_grid"); + public static final ResourceLocation WIRELESS_TRANSMITTER = createIdentifier("wireless_transmitter"); private ContentIds() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java index 3feb4311d..f4227d9d3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java @@ -17,6 +17,7 @@ public final class ContentNames { public static final MutableComponent CONTROLLER = createTranslation("block", "controller"); public static final MutableComponent CREATIVE_CONTROLLER = createTranslation("block", "creative_controller"); public static final MutableComponent WIRELESS_GRID = createTranslation("item", "wireless_grid"); + public static final MutableComponent WIRELESS_TRANSMITTER = createTranslation("block", "wireless_transmitter"); private ContentNames() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java index d4e9fff53..193df7ece 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 @@ -30,6 +30,7 @@ private static void appendBlocks(final Consumer consumer) { Items.INSTANCE.getExternalStorages().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getConstructors().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getDestructors().stream().map(Supplier::get).forEach(itemConsumer); + Items.INSTANCE.getWirelessTransmitters().stream().map(Supplier::get).forEach(itemConsumer); itemConsumer.accept(Blocks.INSTANCE.getDiskDrive()); appendBlockColors(consumer, Blocks.INSTANCE.getGrid()); appendBlockColors(consumer, Blocks.INSTANCE.getCraftingGrid()); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java index 2f2c93fb9..092be4dff 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 @@ -40,6 +40,9 @@ public final class DefaultEnergyUsage { public static final long WIRELESS_GRID_INSERT = 5; public static final long WIRELESS_GRID_EXTRACT = 5; + public static final long WIRELESS_TRANSMITTER = 16; + public static final int WIRELESS_TRANSMITTER_BASE_RANGE = 16; + private DefaultEnergyUsage() { } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java index a6bf1c7b3..7c8c43d79 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 @@ -38,6 +38,7 @@ public final class Items { private final List> allDetectors = new ArrayList<>(); private final List> allDestructors = new ArrayList<>(); private final List> allConstructors = new ArrayList<>(); + private final List> allWirelessTransmitters = new ArrayList<>(); @Nullable private Supplier quartzEnrichedIron; @Nullable @@ -238,6 +239,14 @@ public List> getConstructors() { return Collections.unmodifiableList(allConstructors); } + public void addWirelessTransmitter(final Supplier supplier) { + allWirelessTransmitters.add(supplier); + } + + public List> getWirelessTransmitters() { + return Collections.unmodifiableList(allWirelessTransmitters); + } + public Item getStorageHousing() { return Objects.requireNonNull(storageHousing).get(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java index 4c063bc99..881c21eec 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java @@ -7,6 +7,7 @@ import com.refinedmods.refinedstorage2.platform.common.containermenu.ImporterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.InterfaceContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.RegulatorUpgradeContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.detector.DetectorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.CraftingGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.grid.GridContainerMenu; @@ -55,6 +56,8 @@ public final class Menus { private Supplier> constructor; @Nullable private Supplier> regulatorUpgrade; + @Nullable + private Supplier> wirelessTransmitter; private Menus() { } @@ -178,4 +181,12 @@ public MenuType getRegulatorUpgrade() { public void setRegulatorUpgrade(final Supplier> supplier) { this.regulatorUpgrade = supplier; } + + public MenuType getWirelessTransmitter() { + return Objects.requireNonNull(wirelessTransmitter).get(); + } + + public void setWirelessTransmitter(final Supplier> supplier) { + this.wirelessTransmitter = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java index eed52d99a..658435383 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java @@ -20,6 +20,7 @@ public final class Tags { public static final TagKey DETECTORS = createTag("detectors"); public static final TagKey CONSTRUCTORS = createTag("constructors"); public static final TagKey DESTRUCTORS = createTag("destructors"); + public static final TagKey WIRELESS_TRANSMITTERS = createTag("wireless_transmitters"); private Tags() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java index 718b18a73..7fb2edcc0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java @@ -32,6 +32,7 @@ import net.minecraft.server.MinecraftServer; +// TODO: Check wireless transmitters public class WirelessGrid implements Grid { private final MinecraftServer server; private final NetworkBoundItemContext ctx; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java index d790ab9f9..2063b1cd8 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java @@ -11,6 +11,7 @@ import java.util.Optional; import java.util.Set; +// TODO: Move to API public abstract class AbstractGridResource implements PlatformGridResource { protected final ResourceAmount resourceAmount; private final String name; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java index f39356117..9f1fe766a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java @@ -10,11 +10,14 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; +// TODO: Move to api public enum UpgradeDestinations implements UpgradeDestination { IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().get(0).get())), EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().get(0).get())), DESTRUCTOR(ContentNames.DESTRUCTOR, () -> new ItemStack(Items.INSTANCE.getDestructors().get(0).get())), - CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())); + CONSTRUCTOR(ContentNames.CONSTRUCTOR, () -> new ItemStack(Items.INSTANCE.getConstructors().get(0).get())), + WIRELESS_TRANSMITTER(ContentNames.WIRELESS_TRANSMITTER, + () -> new ItemStack(Items.INSTANCE.getWirelessTransmitters().get(0).get())); private final Component name; private final Supplier stackFactory; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java index 97ae1970b..5022943f3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/packet/ServerToClientCommunications.java @@ -13,6 +13,8 @@ public interface ServerToClientCommunications { void sendControllerEnergyInfo(ServerPlayer player, long stored, long capacity); + void sendWirelessTransmitterRange(ServerPlayer player, int range); + void sendGridActiveness(ServerPlayer player, boolean active); void sendGridUpdate(ServerPlayer player, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java new file mode 100644 index 000000000..f889a4c23 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/screen/WirelessTransmitterScreen.java @@ -0,0 +1,50 @@ +package com.refinedmods.refinedstorage2.platform.common.screen; + +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.containermenu.property.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.screen.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +public class WirelessTransmitterScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/wireless_transmitter.png"); + + public WirelessTransmitterScreen(final WirelessTransmitterContainerMenu containerMenu, + final Inventory inventory, + final Component title) { + super(containerMenu, inventory, title); + this.inventoryLabelY = 43; + this.imageWidth = 211; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + graphics.drawString( + font, + createTranslation("gui", "wireless_transmitter.distance", getMenu().getRange()), + 28, + 25, + 4210752, + false + ); + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json index f10b5053a..feb2b453c 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 @@ -25,6 +25,7 @@ "block.refinedstorage2.detector": "Detector", "block.refinedstorage2.constructor": "Constructor", "block.refinedstorage2.destructor": "Destructor", + "block.refinedstorage2.wireless_transmitter": "Wireless Transmitter", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -80,6 +81,7 @@ "gui.refinedstorage2.importer.filter_help": "The resources that may be imported from the target inventory.", "gui.refinedstorage2.importer.filter_mode.allow.help": "Only allow resources into the storage network that are configured in the filters.", "gui.refinedstorage2.importer.filter_mode.block.help": "Disallow resources into the storage network that are configured in the filters.", + "gui.refinedstorage2.wireless_transmitter.distance": "%d block(s)", "gui.refinedstorage2.redstone_mode": "Redstone mode", "gui.refinedstorage2.redstone_mode.ignore": "Ignore", "gui.refinedstorage2.redstone_mode.ignore.help": "This device will always be active, regardless of redstone signal.", @@ -181,6 +183,7 @@ "item.refinedstorage2.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.", "item.refinedstorage2.wireless_grid": "Wireless Grid", "item.refinedstorage2.creative_wireless_grid": "Creative Wireless Grid", + "item.refinedstorage2.wireless_transmitter.help": "Provides wireless network access for items like the Wireless Grid. Multiple are allowed in an area for wider coverage.", "item.refinedstorage2.network_item.unbound": "Unbound.", "item.refinedstorage2.network_item.unbound.help": "Use on any storage network device to bind.", "item.refinedstorage2.network_item.bound_to": "Bound to %d, %d, %d.", @@ -273,6 +276,9 @@ "text.autoconfig.refinedstorage2.option.wirelessGrid.openEnergyUsage": "Open energy usage", "text.autoconfig.refinedstorage2.option.wirelessGrid.insertEnergyUsage": "Insert energy usage", "text.autoconfig.refinedstorage2.option.wirelessGrid.extractEnergyUsage": "Extract energy usage", + "text.autoconfig.refinedstorage2.option.wirelessTransmitter": "Wireless Transmitter", + "text.autoconfig.refinedstorage2.option.wirelessTransmitter.energyUsage": "Energy usage", + "text.autoconfig.refinedstorage2.option.wirelessTransmitter.baseRange": "Base range", "advancements.refinedstorage2.root.description": "Use one or multiple Controllers in a network to provide your network with energy", "advancements.refinedstorage2.connecting": "Connecting", "advancements.refinedstorage2.connecting.description": "Use Cable to connect devices with each other, or place devices against each other", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json new file mode 100644 index 000000000..ecfb994fd --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/wireless_transmitter/inactive.json @@ -0,0 +1,234 @@ +{ + "render_type": "cutout", + "parent": "block/cube", + "ambientocclusion": false, + "textures": { + "particle": "refinedstorage2:block/wireless_transmitter/base", + "torch": "refinedstorage2:block/wireless_transmitter/base", + "cutout": "refinedstorage2:block/wireless_transmitter/cutouts/inactive" + }, + "elements": [ + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 10, + 9 + ], + "shade": false, + "faces": { + "down": { + "uv": [ + 7, + 13, + 9, + 15 + ], + "texture": "#torch" + }, + "up": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 16 + ], + "shade": false, + "faces": { + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 0, + 0, + 7 + ], + "to": [ + 16, + 16, + 9 + ], + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#torch" + } + } + }, + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 10, + 9 + ], + "shade": false, + "faces": { + "down": { + "uv": [ + 7, + 13, + 9, + 15 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "up": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + }, + { + "from": [ + 7, + 0, + 0 + ], + "to": [ + 9, + 16, + 16 + ], + "shade": false, + "faces": { + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + }, + { + "from": [ + 0, + 0, + 7 + ], + "to": [ + 16, + 16, + 9 + ], + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#cutout", + "forge_data": { + "block_light": 15, + "sky_light": 15 + } + } + } + } + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/base.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/base.png new file mode 100644 index 0000000000000000000000000000000000000000..ba68cb972799dc97e857b8de8bda18f2b0dd8794 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`3dtTpz6=aistgPb%?u1b{{!il z3=E|P3=FRl7#OT(FffScPl`Y422{&g;1OBOz`%C^gc-B0b#ej)B}-f*N`mv#O3D+9 zQW**oGxJLH@={9_O!N%&j0`_2WKIPts`PYm46*QEdR~!_L6OJh;$8`%Mx_NDO$j^y zGp4Ov@q3x$o+Uq(Z~RrUJt)y=$dt@-jH5?TLfODAp`<#0>$P_$cOQIl&T>}qy~*Xx z7jKGxx%VC<^5*OE_=xPiwFf1fw_dCMlxJX7y?08H|2BV7QFX!#?{#B>=^evy^ TiLXE}GB9|$`njxgN@xNAf9Yl; literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/black.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/black.png new file mode 100644 index 0000000000000000000000000000000000000000..dbddddb8dfac0c6fe1d60d9a534d43aa335f36c0 GIT binary patch literal 2865 zcmcImO^6&t6rLai-AzytHR!>n_oC67uIiuZ=_Zr7+1|Jd&bsVQ*o_yhuBx7Gcc!b; z-8(ZI!GqvIL5zq8We=VNFNt2fi1?F`lNSS?R6GcR2N6*W#DiAN^z_b}+3XTcL;qEM z^?ts3@6~&Cap9@M6Aw+4N~Oc|bKa78-y`ok4~pj_zyFQJ>#lh2Oj;^U-Y4$^rFXZE zlu8q4!^Ud1T7TLlyj{kW`>fn+#{yj{9XrvBFfk1$CGsq&Gl=Z@0pmL^w#_mkQaK@7c=dEGvEDmi`bX3-rM_0m#@^1Q=bUa_cJe;wbDgz0? zDllL}*IkHQ3q20S2OL1_A~Y$^@F>^;$ZR0nMUD%rJHVWV!RDS&O5A`aZ7en}Y~v== z;;7lzRM?+ho8ukPRwKXO2MvqEkFv?{Tsr zgG#O+Ax3k7TG zz>v!5%$c1tvXaRRb?3rV#N1|HYnIvB{Hqlz{iJj;8Mr`XbTX>u!{L|>-XE0%vE4N$ z$ht|?4qzz{vMx^8bWbXHZ2jGRfqV{&>2Ja z(DfTlH(X@8x-rb5TQNPSm8{{Y$;2U~skiP7vwX|(OQ7wfD%KxZu&xqS!HM}udZu2H-vOyS>0qx%vV({+`m^>x-rho9d<7&ZvV^EyL zt|;w$6nmuG)VCo4hRp(bbWngrCk1472F&mgtoGAWO5^{v*vlB|(=gIE4TnTCCO?ZV zQ2Z2qB#T7eCZbE!_=TqEFoSt-x>0@om#b*v(vye0uP>hOOs~9lcl2C1`O$~)#Z~y$_`^opNMSs1tb;oy~UO6&%eY!Jo{_@sa yUwK!Letb~<^4ayb-|;U0&?&um{I`RjKd2o#dhOmfrXH3}?fmS5cj4soFaHBzqnXhF literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/blue.png new file mode 100644 index 0000000000000000000000000000000000000000..478a8a302987da36e7c98389b553a13353356f69 GIT binary patch literal 2877 zcmcImO^6&t6rOm9CNUu(Y7oV?qY{lhUDe&wf9~XOCvg`taoHWo1|g)ns(QECnXXQE z@6PNBB8rh9qIeWRyaW^xa>^lrfRK9#qL+vXIS7I%crt?eYJPfW&2DyyrlJ3;zIs1j zz4z*!ojCT&_N`BBEtN{!$H!`u@ZKr!hc?6W>EHh*@Y<4$oybb1ZI8%%Q|XgWca=(8 zPe+aEe7b(rr=nFROa#2#X(fOzl}7e=5<=&At^|B0imU3c7cZ+y#H#A?N*&dcQ9c`u zEv0;F=~#m<%~6l3`}Zj$9Ula=cutf~s~Km0r>b`4`tU7>byev?^0}&dP%2cW>l4bT zNV#H{kwy_R6vr!L+p=u*l42kO>8PS(L&LU@EFU{c|58C)%0hp#cBHQh{;KM1o+rMp zx7+P<+boN8M#rA#>B!IxLj#1CEyg+NXmPfCAfd)Hnnp<;iCB>mNg(F)stT6&TxcbQ z*f{Ic1cd1wlIXaMq)S~OqXjORPn%ukjOx6}TRhG)z~TZ6EY<4;d{wcnR)Nm)!wX;VkX+z3)1oa0$w9Iuc|VTG~{X~ zY8Zx(uwTJ@5qzK?v<{)kNKS^qo`$Ukc6<~2*jfP=ED9Ibg)-`gB5e`axTr;DxSqr_ zU2XNcKOSc}i76kiRaG#x97W8hmgV4zb zCD-@ziwO!cirw&SN*JoxT(d2QL-JUT<|3n_agT(UBW8Oh8Ay9IjUdHIb6Bdhih;zC zyS7PLpqUKhxXi+uhXeVjFweBG=>)*xvffeA6lq;B;M`Odx!XR72UCg6ud0gsgVQop zoAbRv$3SrDSU&snC)Sx?o_;NkfMP>cWW4xY{Zml7zyP~aF)RJ?iKxSy)3pd#%X)^` z!!svV&d5q8Gt?i8GKjgweyy3}r~6;cNa-e}PiW5tDx;Ib2K9!cRW^8IRQA@lXE~5{ zm#FQ*G7;u&lJbKy!0@_Rp|53pMi%aFI(96KFho=6nYLEp7SaN<;%K(((EynS=hzvz zey8asB#>{IgB-dS)BCj2SrX51ID~Zd-ko8#<1*9pG$#ZIB3yutT`J znlq~wg!}9a74ZU3hXN}hDS?BOr&(1EQ_)gLk~AaQ%`SZ*X8rT2NJu3Y%5wQxlQhQD zXeb7TwG<{O|D(QjBW`2W@Xlnp&zq#n2BB95^nX`~-hZvfVlQK;OT$p#G#G+rOnw$! zAp8`4B#$9)Q|JcU-`i^Kb-pBDIJ)4{nDAUS1;_?`BQ!0tv`3|y#3wf zxo^Jx>!T+hIJ)h*7tfuEzPR%9fs-GPT)c7a$jNK*%Wqx(th4FHgNJVIEs4+H+btX1 N@x#YzUmrU4_CHF~ohtwU literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/brown.png new file mode 100644 index 0000000000000000000000000000000000000000..ce63d437dd87b59c677e815f9c6330f3499e1fe9 GIT binary patch literal 2878 zcmcImO^g&p6dnyxTqO|kU`&ji#t;b9bX9jx_jHHhZwK5p3~rVIb}xqNs_NYiGhI!0 z@6IfQ;BO2uT)1htsYic;CnJexuiiAM@h3*31S5%8eKkM5v%1S}P&(VYCpqo&3R^(bB=AyW!-~RM7U5j{4KV50yMlvquqlxpW zIC1`Xlbt`yJgy(uukGvlAfPRBs&(6~IP<$Ty(ia)Z#8V_S`U(+t?7r9LT#oorH#u} zXiga;hOw!+UYR(y?clwdiA`+aia|_793R_0akasvgSM21{&fB5Ko|Vg^!Yqbe8cE; zI^~X4mg$^9JkK+*X_zJg1j?4;oOV&1?HEd^i;SgFl1DPultdcHg}kPNrTs0mlR|8q z4cr6{GrBY}NExdw^?;lexMU%1^^|jFh?Z!JIL`n}3M_c3(J0`nify+Gbe11k1d9fH zTNRx(ml9!2i%c%0OdMGRjXQ>hW%;yNcFhKs1H4$A%*$M6^KuO*6w@nQkw@Vg3f0UC zsOUy(K-EkEP5kjx&|IcXDO*GCObu<*Oj0(rU8kd%%TBgiZG5mm)M+kix*`(7Rb=6& zY5JJ>6|x7z2kt`~Kuu0_Itum>v75y8P3)WY3b5o+xU?>mGe4ARn?m5CHk}hj63_Lt zH5&e8oaHoTVzOS-!PIgTai0W%?Fk$pi@71HP}@UQkGV($*d(4~S;TRN>+6y&C{n5Q z{ruvRfs7&=e#Nz_R0xJV#!O^!+eV&4Eo3>wc5PyFg1w=%7t#n)oVG@#Dyuk13`Nzk z7zeAkD^Qi&1bHM-j|%rJn^f(VD48;I*u8h%-7f zyK+WVGL@nJM3e#NmIk%vgg7_&YDHQvDSgWNTVRTvg6o6fXq5nO%$0qyop}Myx(jRj zuuO(|ho<7t9C&!$tT5IxKBJ3wH=O`wFmVJ5J8qWzhgbe-OHzQ2y3RZDYSj8Bbu5H0)To<{XXIoWXHN$EV$I&>f zS`hB@W|)i@MLI&Pgr*b@QjumgJxpa=qe;?=STDPb#h4Gyry?P>Tx!eZXHBPZkwzmN z7}Zjkp#6{f)@R&?s^PyGcb|h~s0N{528@4Ji2i@Q@5!SoHob$_U#%8wl!I^*`%v1~ zDfYy4dEjD(ELVgG>N`giIw^I21fj43f~&psRMO;sE%u5-JvWT>O~WB*#?)ug1;S6! zM~WEoHia(n-Tn4X=rFU%`k`j^%B?TR*sBM(z5d;$tGA{%Jr>=#>VE$6jmxL6fAy?Z z=TBce^~=q}t-aS4yWjqP=GfyGe!9Nr;)A8vZhn8Vw(Cvpr9Xc-<=$=|oZWQslJ(B7 zTff|?ee&}gZ~dr${YT^DgTL*(@Xd$Mmjn0x7a#uU&i1XPy;suRo8LRO^n~hgCyyMj Ke{lHBD}Mv+n3v29!L-dZY^woOgeX5s%1`MdQNc<=aSnZnj-+qTFpKfG(BxjCT{t4vSpz#e5i5)k`0rQzv0<8)pluIp-8*K{2L0%c24PP-_|b`B)eM8?uE$-_8Oq(th+3wc!qOZzUg zlcCrsE5ZZ;)4DX#NEu6)dO*&GxMU%1^^|j_iI!-KD9->(hFFMFy*`AmDYo4nqO*M8 zB3M-TwkA4jEG0sl6W+?g5Jrs$-sD-RqDBOZ6M-O}-5gQ(G5R8>hN zge%Cv4PEyz@htKnh5_zF>p)FTb28^J3)^&F zXh}5R(^jv0Q&E=Fh>59MRRvSaVaPqI2Re1RiHP713LMi!726LG_uYymbcfnh4EEPz zwjfC*_xJOQ#|&f)Ps4-lL10&0bvb5?{V7?iwaB93SMY=$(jLaaxZ##N1F7dD>Dum`Y`SRaH_< z&Pl4a7W$Kpj^WXWd>8A7HdtR-ekKYb#JZ|TzIZ+T2cUF;0k&lsRxv*lc13Hh7DCjr zz9IJL%AwUOvXaRR^(Mm%IJZ>PngilUF=~ZMFDX6B`YtfZPQle;I$Yy`Hy6sj*iKVG zu&%+{J}irayhBs5cOD|VVOD7C8K2R`Ynx6SlVD;C6u5?sECFot4a-45Fy>=J7lJqg z*RM9+@QCT@#vq5T$MhnstVyGJ0hf@bUcWPxSvVj8Mh^82RPjxY+=_t_XPjHucfmVI zw5!iy&4TbBJHz5=QKTcpN@z;qA{A*?Rf9BcD>O-3A?szAwixl^ei|mElE=zQ`B^t; zT%_R$2S&9FO;G+teH$`vbJg&FKO{{y2>mjk{k=l;zia(S?w4oNyLi2|YQbhX2sg0@ zrG0~9PjrX-4ra)3M1V{O7)_y*LNYr8VfX}Bdg&>p#s9R}OAhtIFw!>-rl1*BbctKu@KxwAJ5#m2jmqon%JTB~*skLz)o)MVA};`Z=DWAPeDBm}pP>7H zefPwP6W{-I`p4Ja{^qMGIW5$`~ zD=$BBS2T9^+=~}J-F5G8%a=a5c>BfY&Ypka;W2oAXg+?=P0$fPedF%SU(bE?x$JVM N_D$E`fAsm6{sJ#Frquud literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/gray.png new file mode 100644 index 0000000000000000000000000000000000000000..882771890b4d4451e18a2ff22a3594a8684c3d7e GIT binary patch literal 2860 zcmcIm&2QX96yF{|Z6N}I#FtPp?t#x)&)8mjJ?hegY)ewHAtVb;Zj5KfiIrWCYdhIZ zI6yhkA`s$;kdTn55E6w-tvG-L2h>AFCFlXEa6t%(3lt&#fHJe|bv86fTj)_r3c{ zrM<_(=3F+{cotL9E)ynvUhcMIi7u569PGw~F7ZtB`9c`g^gqA&O4mYG(~njfun~{* z#c*OR;j?Q~O}e&3J*FRgN;}ZSQb3z$MC-O&QHr}Yy(bsTZ#8V_S`U&f)$}o?P@8K^ zYvUr}np1{=LTGBPS4NI)JMc-(geEj##Xu%N4u&>Hu9jcA)RwRS&(sg+y5wI?U(B)? z8%C$oDR->0NEQs_d7c4H!!&_JfOIv=NEbxu{(*!#PiYdyStue+NhH2l&T6`}wC_SY zF2qJ@PLm|e=#tn#WvE>00U0fD@p97YDQDE+E#Br)mP#xtu#%-lqkwNJw%sn!X?AEu zT9o^?DLQSg#@v|UsaQ@ZKeQq>?jIPIW;1-9njI{c@M3YiC^C^QiY-VerZ-TLg~1jI z)yxJc?}l4I)l316@p!^XCX%KQtwHQe4{Xy+R5rCokA@Kwo%Au~c)ozwNycls3M2rl zz=BQF#1P>MdIHK1*oQV`Xfl$KVXy~~-9#>yfrp$8V8Oy*bz3N-I1ovj$c+ozWPuxT zw9wPmXyC~x%}7M~WWA2UTVx;2~cPi3#nyKvi^drsu=qW*fXCD*IwPi(Ha* zov7`@QW0bwlJKzw$?&#WVQgi5N>;9KI&y6Uk;6gYSq`Xh8v@^|xWK7;)Q6VIIdTWC zUu(LBk&R7jkV7|OdQK}{B+&wwhmfJ)xHH_L-1BW4P|u}+%993o77c)336Kc`2&>56 z%$ZFK!cBIDifDx=LxB~Ogvf)GCuvO&64BO39JfN+%PwOjV)^-0B&3!JZN2<#NgCrx zI1~fJS_%`i|54wz5x28ycx|%W|G(a6^03;Q-ocAEs|7oaL3t8m zS=zTL_Q-UZ??MVJmj}RhZ3c+!q=3rKfLlI-)n0lkY2v>Ydlf@H8ix9&!H{gm)MwEJ z%AcZ-@iywY` zdiSYQADp@TW#!Dbzg~Rs)6=h%UQN$^bncfcd%k=5^B;cP_wyC+{OF~T%lBv}yhq-7 v`|Qb2j=%od%#kCyzVD}9zhC|4j?%rixQ}1NqvtQEes=QERQ>eRFTM5;I7gW` literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/green.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/green.png new file mode 100644 index 0000000000000000000000000000000000000000..bce4cff22fd047dc0d01470c3eceb9ad5bc0a2bf GIT binary patch literal 2881 zcmcguO^6&t6dnzViADqyjT*4+pd`kcuIk_EB4dm@iMx==E}PM8z(cCLs&|^qbalFW zXJ&Jd7!?vx@v7wDMLZb@5f4#Ngoua;<|24dOau{0f`})PST)nrJFC0dCH^$@U%jv1 zd-dvjuinY2eNU}lcmKLlskDA#yf!V~cgg#6Cb z#+u>y(S+?ky076MJ?y(w-TAn(qlblpHp__8Yqz2l_o`}NFBac&SW}fgBs*MHcS(cF zOnpij;|WvjG6X(^y5hKHWSgc9A5(OwLk(IQ(gCtDG%<3N{8ELrga&xJwkNkG{;Fy- z%VMl)-EOzsHOf4h)sXAD8q_si2Lb`o`6wej5T#p&8fq-{lQ7Og9w|~I@%UU;RfVU6 zCA8y0ZItF=5&_eCB-T(F$|d!I)Gu)HT+-?rr@qEotj(e<6=(I5(Gi{osd@k|X?vAjyW$0L%O|ym2tYW%=7n9>A&v@G8%LJhiFA7B# z2Fn&n&xVMKX1-6j{FPhd5Yv8pPG z1YiXiu%YW1B5a}UP<+4vv@WPgNk&G&EWN<@fJ_&oQjwmsv>tA3-!WPBJ-=N zqI_^hQnfWV7<6| zZ88z8>#%kJOL>rWNy2u`iU_Zm720ynr=)Xz*OA~4L^cC~YY1*K69Uh$9AH;m--CwE z7!qt+&UFJL6YIt>hi=66T({pO(JT{(kfz@FVyFRi+YdZIb=L)u$<*+u50Ddh0dvj3 zWP&w+U(AvP;XhuC&!Y}YMu-)YgouNbC23U+65duw9JfNhpIurfqWSq$B&3pYWug2m z8#Kz2aD)S+RtguCf6?BGj9Xnb{NFc8lMTY43}}C?5QG2PAd-9J-t-S%yi_e%EeFL( zj74c*q1Yqcp`HVMU^pxQrejh-L?6?Z_q8XE) zMHeW3iawG>B5xDXC3b$f_>kx@I}^2CjmoQ+FPvHb!V`DA^!;}yE@mh2#x?Z#-cL8Y z@ygmw$L`#=@$;Xqym;i%bI(5C+#3J<<5lY(%4GG1DMn;Bpds)SKlgo|*^)Pt4`njxgN@xNAny)8B literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..2e4caed4a7f86d74c93d435df234a95dc62d95c4 GIT binary patch literal 257 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^iV8hl978Ppm!5WHZ%7bmdHD0c{hDAUS0$?@&R*>v$6wxdRuS&y<9~fO zcETT5xAq=BNm(PSlsyTvCFcG0JJwLEc5BiLtw#~TRXc+X6J$HB)Vq2j+NQ+43)yo- t`IlO6m3&Ici5C+tDlT>gYu>Ny*YfFCTE~N<(}0#Uc)I$ztaD0e0st2~S@8e> literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/light_gray.png new file mode 100644 index 0000000000000000000000000000000000000000..3da038500a6d5bfa3844300ad0aef83c7a37bc7a GIT binary patch literal 2862 zcmcguOKjXk7{4jBwj)_ZiRTwddAPS)ujsAv0|HgzM%B_|4;b3S2m#wh|yDPB7#3Itfjhs5~tBHS^8?_~!rr z`OnRsI6gl1)R>|u<1^FEIq`l(-VZ(?o(F&Z6N}gWWO^Y}l!qRb_deyrkDgGJu`^M7 zKA&&B?i1dtVafwm8}t%^R+J-02MH!iELQ`z7{v|k_UB({YD62_DZ2$*$t3GU(`zX^ zxptyW)|QAzwWF`7M+UwS&|^7P2fc2b`Gba5$o0jy9M(0pfaFUJZ9*zk=UcPtBu|;@ z)F2=b8mjBnkYia6d|5T10d;8W$NJ&Fn~aSY&FjD0L0m$k%T78NE#)1#A8)T!~tK<8=A0m=t3{4#Ku`k zlORkV;6z6?C|xRmlvKE6Iqeq8DbZP%^;n!|0*flFV5!xr;M2oaO%PC<~D?;O;kzrXr$2O?h!*T(y7AGB^^Q^;nAfcMxLPZ{hJ1CShTcB(Z z?EsZC6*TcDQ-*V%wmI*PVrO<_n`)q%p+0{qiYf1BFG$DB1+0m4*3e`i0aynnY#W9T zk#D1yp!k48XiJ19#W~&#_5iZl$n}x!+twB^r%|}NE0hvHc2@LcACFtkj7DWM<;V4a!7!S%3`_C^|s6vy4oQl(W?TE*&)NoW8} z>M~HL76Kj$_Jw$1Dwg@x&`>!zFGIDvJREcl zC@vkzXF0#H%lyXln{gy4HZ)bni(lwJDN2_xz_D%9F2`r10qf2;Bf(lWG(@;xtSDv{ zw$8{(CNtEZjxrH*t7WY@$Sy# zWjxILIAs%yg5h1WLf^^w46oeXbmUqHB8P#{GaXwlaD2MLF^paN6!SNy!hmfw_yEC?78HODqKpi^(MrZ|~ZbJ`{z%c{Q3SA=iLs!1+U+Y}?;nx0d&R%=#=O@3v<$ZPf%JSsO{nNqM=MEpf8JtzM p%NNd{Uthm?Q~CYv9}g;zPkj91Z_hmahb=qWnW+=a&t5(K?qBgDn79A{ literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/lime.png new file mode 100644 index 0000000000000000000000000000000000000000..f97f56886ebc4ac7cfbfd28bb6989a290d06de61 GIT binary patch literal 2877 zcmcImOKjXk78xd)&yYtQ)YW+@??l1OZb(nU>?c#J*c#Om7P+D>+p zOHpndK;nX`3JH2aLW(#b0finoAQi44aex~qI6x~@RRV+rGrL}ALz5;d)RJE_-~5kn z{{Nr<_1T$cM@JqWktAt!da5zU-w%oVzI*udk?VhB{@RyLoz5lc{sZFPBVBmspd^i) zjau`?eDgUkU~vr-=F?g?PB~hV#*TMW9Gszr?9+uPsVmnmf1$_`sVk?wx0BrK)|H-IkAI6{Rgrs;;!Ir`7YgP1=Bzxy zGAdg&4FsBoWZSJl%P=hMNf~KKQ#DhC2tdoz3=i6Jc`005MnZ3{aiY}4|LV$OQKX)# zb~>F}N3XGLL4~gCsv1%e0vrMIm88I3kmN@O5*joQvM4PgmdHXP_SsTVSGc8p7vi)M zo8%=;oG`VEQx(=U;ZhGsf(n-|W$m7F5~#FIW118>$HEHBS!y;b_?BYhxI*W}xu{@pgBO- zS_pX>^i24K#y_+^w8=x0-~tbWT>y<1v^^bphPw&ONEEK@2ql3RvMk1YpKJFt9Ac23SWn(4py?&o&B1Bvt1II92U=YIszD6A2BiGcC;XAgD2hyI;BA(*7JuFpNMYzO} zI+h*~ALzuUz##?%F7(C2B(82i-S#<$8+s>Ln`KQ#IOn<|i{19Pcy1~d`Bhh7IXEvu zwY}6Iw2{Uy6^ds$e|m@cjp-MXh*OLdS;ULi(|?keE^dHjnz~tz&qiI^o^M2)wY+bL zH9T{A^NgruB165YDCaS^Qr4Q2^lbUnj^tiadN}C25QylcL@9@(EjD;}RQAPo7AYs| z7E#-Wc-PSbW2^s-A`PDpt^RS78x z3*>(hIg3RbYr~byz%R|7a!aUAGq?{xqbV-KfEX3|K+iluO5P5 z=Lekqm)=~T{PFyJIJ5rAE9c(*;L@>r{`2RDCF!dl{LfxG@29WbxbgNMtL(1#5B~L* z{^Bq9P9JzL96NsZ$7>h9^OxlK=uc^89*O__^w85+9=$64zSmekdVMZj`$#mn(~~oe J51)B;?H@q9nTh}a literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/magenta.png new file mode 100644 index 0000000000000000000000000000000000000000..631b91da0bf09dff5ef2269b98cb7d62f4aa6564 GIT binary patch literal 2874 zcmcguO^g&p6mC7BAP`Ywh%upUE`Zc@SO0fs$7S7F*i9T|Qit5D0kDXkyfp7cN}9A<>&B6BEU7RWBS2F~%4#C|1q%^v=pIyAidM{;T@x{e1P_ zt9N1g=#d@Up4lcz(vGRg+6;d`F78LS@aLXi?;`%%noOR|BH!HZamhm3>M18!r7hZ~ah`E3EU}!WdcB0NDYo4%(OEvR$So>- zTN9l%mJ+JY(2Omlm`*Hmje7@%W%&$Up=J}yIlNq)%(0whb8H%^5rG6W7Z_SY z*L@B87JOdgA6g$;=b=eZj)uV=fMx?azG3>Nz6#7p6fSKDCD;#H+D3fiqBd$$HHn)& zZS}f86=yk$F`cSa6>e%Jiiq!erimP#0NbPxn40MT*9&xDTUr=Uo7m7b2kUDLFNmNL z>-+gd80Ip{-S7j7^w4z!5J2bvicJ>;F4lmpL++_*8N@UO(q2v@p5mxAELB)VxWtgU zwt-0i4B}AW5)%Rs2I656&oH6k1f0Vaz2mIK(mErYb1q-(w$H_LQ<2E8ssf9_SrMwO zh5n$UYy487coy>~H<(|UJ|0J$VqK9%y!bu+$9U=D2H2KmSjG5s)TOQ2TEtn)`i9uU zGbdNih)O0h)Srwp9&<}YtvN=|6kn}K?j@y?H1;LTCl7u%VmoUHpq zZ6B7gFz=w0jx{;M8)k*Np79x4yuaztF`))+3PR7YfkjOX1cv1R+x2ju89JrV8MuD0 z>4pzYUpEFh^iNDLXvK3VZc=^-smcR5V;H(?U<|Mk+JG7+<<0~aPj{YVo~K*3!9(}n zeOR*~{Kw8<7BA9tD6kTgB7Tt4G^;9M%GxqYl2(L!*`+SVq&T0-gp_k8uauv4Nh36k zhGJk?OKF1qFY4Pc;x<_LmYh@l=0Lw(a=h&N;6v+M%- zPuWM(nCETEyTs3rpFhDnOg2>;Yq*zhe^cFgR@;8=hnvSAdFsj&HxE5~Hv4_|`T6|N zt}A!Gy>NN^EAQ>>{&wrus|RpHJVo z^X4a8r=5!jPQQKayI|qe=*8>jp8M*fKlZ(UTS{O1agQ{59Iah_ I@zfiC0hH{TDF6Tf literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/orange.png new file mode 100644 index 0000000000000000000000000000000000000000..7d7536d3b8ab7c4542dc5a4db7e6be3c8c6fab28 GIT binary patch literal 2865 zcmcImOK2oT7#_2(#H?8aL6$ve+qta7ny%{Z=|_<<8#9R+aAHVCH^Gb5UDcB|GhLnT zPG%B3EGvo%q6i8;U=c5R(VG_!o^n)S@wkXyLNAU z|JVQ8(&CfjW9P>Tg~E7sp|ULA_se_q9`Stmx4(&a-5W2grG>(o2jqQM;r$QK6$)dU zVSP1Qtv!W(-YOExJyz_rVu3CcrlvbF@i$nec&rgdW%b6FU#Ut+%j%_44c6jWwjM6* zCTwMQvF`6~_%2naA6KS2SO{pbj3}K}GfHu%tajyM@hyinRp~;qjj}o;6)LN>C1sW; zOtFd(_z>!f?G}+`nihOa(V-4CSkjOVkcFX%k*)MERcK3SfR`)teO=laTfAOkrIi=x3aP-EbY0_igU41 z+NVhnrgccHp(2znb%E5+aq(8t>?)_e#+t0fqAV3ylw$=;wOS58RBWr2qtk3|TUgZh z?ND@D--(&F%u>FU_-t-lXq*@rmS)RrpPCaa7w~*>yv{S8uJa>E$fplbk%hq#3gyfJ zDC>krK;=vhjqz;4NXC;o=gmRvEDdZ^bX3%p3zx!(@^<>DbiBWSRY=ClsthCm9bmw^ zu49OB2~9%r0ejGz2u(^dG7NSBGV933x`p+FU{1qe=U6E9aln%n5gQk_NP}r{)aYuf z)o?XRGZOi%S}Ci-)M6M?Od*91b6j9~rUP`t41foH3lInm!w-mVd33P8!u>57RC0YU zzbN;GjC?n+8R*m`mIXXLaDh!t12`hPK#4GB2L`iBHW^5JItfLJljg8gX%!U`1LjzU zPd#8zn*oQK2)M|Tj}mna6B)KAINaAe%bPr@aVj`BR7LJK7UG4eMCMmnMg7558LG{# z-k_~RacM|C`}1qZ%6NQ3eT~%bf;I94^QM!ZyR;gr^`r}Jshc#C#p|q7){Q~J{TI{wwEF8LYA|sKY3gk_V*tvoR@pkJ$Uh9wE&$k2E|E? zMQJ~#*dyJho(+9q*en31EhAcVQb1;Bzzh#Tr<$(j ww-?8r{pIwllh=O#2SMvQnmE8n~BgzrPY-yrb2JDon0E6P3lv5;o|*@ zGO-jl=ZpEqiGYeug)kBFO0SawT2T%i>7|4&@2lWYD`!;aZQkKYkptE!vEZdfql9lNw$mxmd2wt7 zEE?`@Q*_>3O}ReDbFrLJeryFa9vB&x7jt~wH9J@i@N#k55{1ZHVhbmf(;Hk-#L*TC z<;(^s@5Ng{AmjA#iYUhb(YC zO&0pv8jWBk$qSNDK2xu0U}`0f8Bp7|e9s_=5W}!RmpB7!VSQcD zWl1Wzeh^@lcM&Ozuw_T8CIoLyf)wWP*Qi2@U^!+M{Tpk%CYo5ts2yxOLmnyAd zATi=q*P<*$7V|i>T7D5z3Fle9Ja0F9fUB^-hVl$Qpuy&n-=rryYQJFqO#os%fCK zKR7R`+Fl+EdM1WPH{^FXe`cHc_33Am7+h>>s^m-1*MAC97Z~6=j^zx;XX74k&(~w{ zT0Stu9iKU~aYkk`8KJ>+oCD`phq>kyUmCXBvDy#HfY8AfsAMN++Hg4D~-2+4L{oV6$AXQx3vS z96)N{CfOUN$3hQNWO+P7wr4X$pprr|IwNj{2CnwQQ%V#6G}%iI_1!R5H;sm%7?aJi z3WQEsNAd*XHiIg0-&?zXg9`J7nflRY_4QvqHzr=fyI=k8#`#D0t~vMq{N?jkuU&fk zvr8X-aIRQty)*fyKBawq{puG^O;LV&?qRWi*N^olFMRdK&Ack#`KihU>u;zQ|!=!0T?5PY%)pR6r$=5B9uu}KrEUAVp3ncsYW ze)E0bd}pT)Kfh=9!@Db$%AU!I`n33eK>l`)i1(v^u43`GE18(fDwTU5l)rl_AAYpA zQrUeXYR=}fjTe2w+f__?z^dJLBG8q}frH%yljAH`0yZDTHTCNG3#t;)ntIe~z(z90 z7NUujl+COhZjzPb#G~rLXOsh7UkGTk94p;+E6)6GP3_6`#aK>js?vkx$7|}SRH)20 zrj#+BGR3Y!Kp@l=$EzaSG;R2_qC*{O(9)0&knKa$M~+fFs?e6w(4Vd!Ds+jjn!1qZ ziLYs$PN&*2syv<7kmq?C)HPiP0s*q+ILBQOXZr>c>MSE^l;jbQ6)6!1d@--7!qUDA z?W7bNX9Z1yFs+Ld4OO9ZsRyK_#3hSqtEZe2jkQ>t#d#*MsKg4E8jTXZq1bl2L}&T< zlCY@oZ9{a{Tuzua%`(225;ndhH0~Q1mgUoIjhbz27w~d(vcPkmE$~f9D3{k!kw@Vs z3gyZ=DCK;=paP5iNx;hd*U&Rc`nnHt!p=%}hIj~|U<$~)N;((z>K*#2R2fJB zy1;-&t zWvI3m`;(3i#iJqlF4pI^SYKOyIgSLyx~j-{@q7AbMClR+*p_8j#r#y%Wv$tIBv{M( zhSA(fmfYvpHC(kM%# zp%@s}QktOrkNUQZxb0QLTa)E3ACe{;gnk*&{#_yZ-}OF|hveDxE?$45TCm+16gROi zO8XYY9_bDZ97urSun?GzNdXp}6p+~&G9y6H?WL!b#{X-vmoe0%VW@8!Oo?Vp4$Cf3 ze3X48i$&h1qDwsb!>$ve!|Y7fN1N{3FRX% z?#u>+5ON75p45YgkE>v=9u$HH4<14!JpPorcT_(3@R>?w z>TJ|r%okg4`c(9)go%Jx2fak1E0yWPgM`pCJl6u=iQ>9`=gVul7O}d1(r&?4GQ*dm z*>fpBer~Q!&z+$j(+|I@O%Hr2pvQBf4SL-;^9Oakkn78DHEifw0m;wQ^&?85w%D52 zW<<(0rwRdu(9~S7iX6*w;LDl`O=v*dKqf$r4=o?LT6yVGTgpOzp>eF#CI9OBQl2Ni zVf6d`Y9Cic+A)ylc?L8M(*zO$veh^z0}y8iMiLr4qiK}nk%%=VkpyBnuj|s%p$ola zEH=(cnj~SyfFuU0Lgi8cWOR&6meX#boKb^!d5_0=Cb4LYl`OSdWB7(*d%ZC_%a5)| zi%Q=%L}%^Qgc}Py6U!;(M^~iA10%z-e1We~vyJ5vK3<$GiCkn$ViOX^)9a|nqi_?2 zYGxgj528(=YGw>g{F#)KT%>Iwx}(^cAK9jvsA_62os428`q@F{c)5T#NY3lJ3M2q) z0K>Lv`VjdxIt1kh970<%G#SasB-jJUY9rUjwr}EfV8NnrbxSCtekjr&ksBBFNQWCq z+$prRT7EOmauQSCY}9pWYBh?Oj~x75Z>k+uYroMT;6yX{Ny(o~}ItFEJRa8ZS7 zcX>GInowQ_QqOY!)E4t=(X@Fzf*e=KCqXF+OHX_MdHZ(+% zS*$2#POYC&l}u%*KO1E-=2pvEbDW>jyBlf?NK=t+h5|6 ztcOJH5SEEB?~{}t=}3mR%nD;O<1@1IaMO`%A&49fLJvE@<}x+|Y`egzc{G67+;`^cKep+_;jq?Im_xWnZkWay9XjP#+#F_KwfS^=PrN(~p;Af$m;!xW*A$k=#r zA2uuq|FJVv#49|V2&{ypL>{C(&FXrXik?Q2q#My9yNs2XmFLqqA+=m+YvpHC(il&p zi5QsFGB!c`7xir!aoekg|NABxszDf*0psr#V))+}GI>nxO>yx08`gqt#-KcjeOcPK zDE7#7S>Qqnu**YWxfTONc2YoPXUK7YV68|`B~AR(Vy|MTpkbnK8V$*2Onr{KK>0K7 zBY7?1y4vQ^xyIGkPG9&7k(ijq literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/wireless_transmitter/cutouts/white.png new file mode 100644 index 0000000000000000000000000000000000000000..7a685518804674909dba327b1e0413c5d9a98961 GIT binary patch literal 2862 zcmcIm&5ImG6rT`COiWY=ND#!P7sL>2x~jjY%w$=2HtveEZZ;FM5dv0MRnIm%)79zj z-I?8s5>Fn4kb|HE1pfe0@B_)ggMtRclLtK*Fyx>IiQq*<(5jx9-d(esU7~5|uc}|Y zk6*p_>b)^H``qD!j~%R3Du-vL8}su0h`JxxC!bIJ{x^}Y1IhIHtWtUKh`RSw-nn|T zQaN}rYAxgo%@;5g-6~-s;MIONk?2b0#CSg;bcyF$z}rz=*Kc3@T-PF2*Uvdk*i0t* zVl=&$@-u6*ExNWuYfK+Msh#L!DWJ=9qV>C-IK%zAUdYArTMZk!RzUKlx;~*4Y75Od zZBnFMbE^7{~<3#n8sc(}tHWwWTb?^NmwOUGlH4FXnlI z4WrlVReM%dq-_J$YBd9zhG_zc0NHAslRk*Ev5|xZ&uAJYc_d;@NhE<-&g;6gbl^fa zDaFRwkS0l((I<(4s!+L902wWD$#U8$lrw7Z4)5|f&m4&Of09APpwFeVMu?-33^d>6uDBMP& zn%M;9{b(Dgnkk_Po=iE(McNXgGm4$Lk!_lZs;2hTxhQ6$mmO1%4;SzT$$4E@fdrrr zEZ8zl3=wwFaVS6F0NRwH$w*E%f@=WTE#zV3VAIlg+_4=#4~Z0lbG_EMqQVtR-=ev-=!9!wgVg{ZFOAR13`#N*+@E~rrL zEDr`f6Uxg#>N%W0zr+0c^w~I)6q~xH;sqD_&&bjx4R9UDa)#q`QJ;4f8j)lz8yF(V zELIdV=Qq!&N~SUtPe+-Ixz%BL^}R(d z$+}C_4q%xG^Bzh0L|ZbvV^$d38K04ryPJ+Y8$sl95Y{XgINXLZnj8QlIeI$=%-lnok{A1$hTe8EXGmVLs|K_h(t{wgo9-4gjq5a9B+v9J2^}%01o&DwJ z-b?ne_g=brldCC#=?BsN6Jq9$-*>>2Nx?0Q_= zo83ezD)fYa1GfrQlv8g-LL7neH^2>vN?bS~ia_Foihwu!;cRHqM1`)j_ITzu@8dV` zy?O7>&z(CkF*#8v6b{VJR2SfVQ2rm<2hZnz|C_?=;do{_Efn@YA^&>{A6>v74>|nhHLROZ-z7L z313{FtNZIKzQfd0FDfT{E(mDzj4Hi$D@xs7MeWOVVJxRLRp~>rm5Mqg6)H=$d1YE8 zT(OE6`55bp?G%Y+nihUR(Xoy-T+)b+h~;9_CAKpBsh}-kfxA#WJJbbV6}6dVv8!p_ zZnxMqiXv%f#Bm%A>zb}3K%jIj%4iQo>5-9yDo_0+jI&Tgij+t_(a9<*SUPZ_9p_@B zbVw5rruAs7ks_8Z^?}UKad9VU^_4SU<1OCiQI-Oh!c(rkfmP_v8e0M9qaO_7PTDYhXYU*1GT76#iWlq;K{ zyccc*l`AeN!cmS1~HQ$hj{W)Vvb=F!}fr~4ZYK%C6bz8z`3C+^0ZwL52jL?Ulo-MCzoWXwmO4J zTgULzhm-SbjAMfnr@%WW2b2{fkh#zyPaMGD^ew`LM@ZOVtoqO9zHn<15RX zS7arV8S2i2Da72`u+}W{3&T+>RQgHjQh(rrFQb#g0S%_ZEe?2hR1Wrcn;gixN7N2r zsR*(zP54v;7~U}}wC#*f>FT{rC$>p2u{a7G!$Ku)V&oYm8(C$?_pqUJPVABEcbjgw z#B_CIlyLWB`jA$?NuvgbOGs1i-x;IKjX<{yWR^=lVrA1qju$wHQDS+xj@+7UOK_c1;jpJ76_p?h|jo9#h$`ew_gtAe7wk3`6Bpi!@ zaV@zC%KxZu=ZM=?HM~1n9`GS)vOyS>0qx%vV(?uZFnLyN@?Q17JC^(eHzC4rqL8MV{({xf$)*{ zkvxLDO`uD(KD=f?hZ)XRr|RVoe)*O>dikYCs^5r1$G-b&=FpFSotrxP)SmZ$D?fSo zb!Bqm`}IGsf5xA0TtCsdxVLcfwfElYEw0R7x^VUOoj(rmeG~n3QwcBMKKRMOpC@PD yK7C{9*(903l%pjZ~J2U{ETOrc`q&{Xd%F)#L4n9Wo$VmEEEbcaBu<@f=MBRDod^77`PNWF9(lp zuW1y>o`Pj^DbGYDM8`k^REt1C)L?%Zolb|CY$`p76~GAcgBUP9hz7H1bl4xJbLcRK z0Yj4y1+S)+D>$)2(PScg0a{{QSHjPGSv)MG5L1Qrd@eF@mt{RgX z{M9<|DFz{;lWCP2Oo^%?8>2K8)ni-=uJl<8D$O*lS~oc+d|)(#R70avVOvX6iP6!o zPF1OPK3~jx4 z`5)eh0d)`KQ^}3KK4X-Fp2!fS@+1At{K}i)q=laRyx?L+*z=fwA^{NEVUFr)S zN2~fr-gn)&&)nNK(WcH{eD6~Z&wb~-u`g;ao7dddUw1q$84lxZPuj93YbVd=!QdlH zlzz0e`eEtkCr;d|tNA{U9&RmR>&5LTN&N zJhR!{e9e?_h`CAnhNf_^6)PC|#^#^M^z%Q zG#!ZgJHKOka2F1^bPWv!_FApmTC-diIXgED59?Vh7I}1Z^xh4#v)9;|Yki;Eqwvz= z7Pu00baZ^1jG}16&712soqwW_Dl04VYAM(@VA({jO5Q&3=k9ms3mofOTU)~>`kt0m z4aSduKNx1s8{XmddP-@=Ur##o)5g90lk(kCaxHES7yLkQfeY{m``z=!{){VNZa z+XPJX0OEY`m{@V{w-TNa03sj*2+RzI8rw1nmrj?A6Rvbu$!PVkq|;I^fBYHol!2HU z=oS;WdTVyc;GOJa1%vwpco`$rnUF$mA-@CUEhRjnvDSFJpXu%LGOeu;?|kJ`-+{B# z!|XTY80%Th#mmekylab%O>en0lrWo%m*dx~1Y8=HM+SnfkG}+_>ifb9-TXy_ zl-13aYA)zGQsEoEZe3Apl$B7oC2Qh}D$rg3s9|MkG5$?PzVDHCca4Sw@@kkyn?U=X zNp%$bWXMI3WvIaOpky#q$-Ui~SesDcclql|QuUeor9S=H>(fXZHaCv+tu@pdsDIYJm;~6OAQd_A} z@mjFt?dHS-OUn1y=UF~{i&br5v8^tzvgDNb^(l7odlC!9_-{GUzQ0!M_?hKaah-i8 zu2lIC^M2VcTqQcP_b8vyCjoCNhZkn3_L_QXMk{0U-3~_$7dp(gb}}FvkIrg{8BNag o%0GVkkLmxW{{KqZF_L5?fZGSmJ(u&3sQ~_nBP7Ca!c(^X4U0CsRsaA1 literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json index 605971517..29b9fe2e9 100644 --- a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/wireless.json @@ -20,6 +20,9 @@ "items": [ "refinedstorage2:wireless_grid" ] + }, + { + "tag": "refinedstorage2:wireless_transmitters" } ] } diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json new file mode 100644 index 000000000..52e8f90d1 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/wireless_transmitter.json @@ -0,0 +1,25 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EPE", + "EME", + "EAE" + ], + "key": { + "E": { + "item": "refinedstorage2:quartz_enriched_iron" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + }, + "M": { + "item": "refinedstorage2:machine_casing" + }, + "P": { + "item": "minecraft:ender_pearl" + } + }, + "result": { + "item": "refinedstorage2:wireless_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java index 4845a2739..86b2b2556 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java @@ -28,6 +28,7 @@ import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridUpdatePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.StorageInfoResponsePacket; +import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.WirelessTransmitterRangePacket; import com.refinedmods.refinedstorage2.platform.fabric.render.entity.DiskDriveBlockEntityRendererImpl; import com.refinedmods.refinedstorage2.platform.fabric.render.model.DiskDriveUnbakedModel; import com.refinedmods.refinedstorage2.platform.fabric.render.model.EmissiveModelRegistry; @@ -103,6 +104,7 @@ private void setRenderLayers() { setCutout(Blocks.INSTANCE.getDetector()); setCutout(Blocks.INSTANCE.getConstructor()); setCutout(Blocks.INSTANCE.getDestructor()); + setCutout(Blocks.INSTANCE.getWirelessTransmitter()); } private void setCutout(final BlockColorMap blockMap) { @@ -136,6 +138,9 @@ private void registerEmissiveModels() { Blocks.INSTANCE.getDestructor().forEach( (color, id, block) -> registerEmissiveDestructorModels(color, id) ); + Blocks.INSTANCE.getWirelessTransmitter().forEach( + (color, id, block) -> registerEmissiveWirelessTransmitterModels(color, id) + ); } private void registerEmissiveControllerModels(final DyeColor color) { @@ -202,12 +207,26 @@ private void registerEmissiveDestructorModels(final DyeColor color, final Resour EmissiveModelRegistry.INSTANCE.register(id, createIdentifier("block/destructor/cutouts/active")); } + private void registerEmissiveWirelessTransmitterModels(final DyeColor color, final ResourceLocation id) { + // Block + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/wireless_transmitter/" + color.getName()), + createIdentifier("block/wireless_transmitter/cutouts/active") + ); + // Item + EmissiveModelRegistry.INSTANCE.register(id, createIdentifier("block/wireless_transmitter/cutouts/active")); + } + private void registerPackets() { ClientPlayNetworking.registerGlobalReceiver(PacketIds.STORAGE_INFO_RESPONSE, new StorageInfoResponsePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_UPDATE, new GridUpdatePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_CLEAR, new GridClearPacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_ACTIVE, new GridActivePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.CONTROLLER_ENERGY_INFO, new ControllerEnergyInfoPacket()); + ClientPlayNetworking.registerGlobalReceiver( + PacketIds.WIRELESS_TRANSMITTER_RANGE, + new WirelessTransmitterRangePacket() + ); ClientPlayNetworking.registerGlobalReceiver(PacketIds.RESOURCE_SLOT_UPDATE, new ResourceSlotUpdatePacket()); } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java index 198f01772..c1597ffb7 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java @@ -67,6 +67,9 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage2.p @ConfigEntry.Gui.CollapsibleObject private WirelessGridEntryImpl wirelessGrid = new WirelessGridEntryImpl(); + @ConfigEntry.Gui.CollapsibleObject + private WirelessTransmitterEntryImpl wirelessTransmitter = new WirelessTransmitterEntryImpl(); + public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); } @@ -151,6 +154,11 @@ public WirelessGridEntry getWirelessGrid() { return wirelessGrid; } + @Override + public WirelessTransmitterEntry getWirelessTransmitter() { + return wirelessTransmitter; + } + private static class GridEntryImpl implements GridEntry { private boolean largeFont = false; @@ -510,4 +518,20 @@ public long getExtractEnergyUsage() { return extractEnergyUsage; } } + + private static class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { + private long energyUsage = DefaultEnergyUsage.WIRELESS_TRANSMITTER; + + private int baseRange = DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE; + + @Override + public long getEnergyUsage() { + return energyUsage; + } + + @Override + public int getBaseRange() { + return baseRange; + } + } } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java index d14d4bda6..46c3e4e7c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -55,8 +55,18 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS); groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES); groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS); - groupItems(registry, Blocks.INSTANCE.getCreativeController(), - ContentIds.CREATIVE_CONTROLLER, Tags.CREATIVE_CONTROLLERS); + groupItems( + registry, + Blocks.INSTANCE.getCreativeController(), + ContentIds.CREATIVE_CONTROLLER, + Tags.CREATIVE_CONTROLLERS + ); + groupItems( + registry, + Blocks.INSTANCE.getWirelessTransmitter(), + ContentIds.WIRELESS_TRANSMITTER, + Tags.WIRELESS_TRANSMITTERS + ); } @Override diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java index 58b80da62..2a72c1593 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/exporter/StorageExporterTransferStrategyFactory.java @@ -54,7 +54,7 @@ public ExporterTransferStrategy create(final ServerLevel level, direction, amountOverride ); - final long transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) + final long transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? singleAmount * 64 : singleAmount; return create(fuzzyMode, insertTarget, transferQuota); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java index 9498457f0..a8fb85eee 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/internal/network/node/importer/StorageImporterTransferStrategyFactory.java @@ -54,7 +54,7 @@ public ImporterTransferStrategy create(final ServerLevel level, return new ImporterTransferStrategyImpl<>( source, storageChannelType, - upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? singleAmount * 64 : singleAmount + upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? singleAmount * 64 : singleAmount ); } } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java index 0a4984b97..59d290461 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java @@ -8,6 +8,7 @@ public final class PacketIds { public static final ResourceLocation STORAGE_INFO_RESPONSE = createIdentifier("storage_info_response"); public static final ResourceLocation STORAGE_INFO_REQUEST = createIdentifier("storage_info_request"); public static final ResourceLocation CONTROLLER_ENERGY_INFO = createIdentifier("controller_energy"); + public static final ResourceLocation WIRELESS_TRANSMITTER_RANGE = createIdentifier("wireless_transmitter_range"); public static final ResourceLocation GRID_ACTIVE = createIdentifier("grid_active"); public static final ResourceLocation GRID_UPDATE = createIdentifier("grid_update"); public static final ResourceLocation GRID_CLEAR = createIdentifier("grid_clear"); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java index e9b1997d4..f24a23c1c 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java @@ -28,6 +28,11 @@ public void sendControllerEnergyInfo(final ServerPlayer player, final long store }); } + @Override + public void sendWirelessTransmitterRange(final ServerPlayer player, int range) { + sendToPlayer(player, PacketIds.WIRELESS_TRANSMITTER_RANGE, buf -> buf.writeInt(range)); + } + @Override public void sendGridActiveness(final ServerPlayer player, final boolean active) { sendToPlayer(player, PacketIds.GRID_ACTIVE, buf -> buf.writeBoolean(active)); diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java new file mode 100644 index 000000000..71916e1a2 --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/WirelessTransmitterRangePacket.java @@ -0,0 +1,24 @@ +package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; + +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.networking.v1.PacketSender; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientPacketListener; +import net.minecraft.network.FriendlyByteBuf; + +public class WirelessTransmitterRangePacket implements ClientPlayNetworking.PlayChannelHandler { + @Override + public void receive(final Minecraft client, + final ClientPacketListener handler, + final FriendlyByteBuf buf, + final PacketSender responseSender) { + final int range = buf.readInt(); + client.execute(() -> { + if (client.player.containerMenu instanceof WirelessTransmitterContainerMenu containerMenu) { + containerMenu.setRange(range); + } + }); + } +} diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java index cb67f1fd6..c821adf9f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java @@ -34,6 +34,7 @@ public class ConfigImpl implements Config { private final SimpleEnergyUsageEntry destructor; private final SimpleEnergyUsageEntry constructor; private final WirelessGridEntry wirelessGrid; + private final WirelessTransmitterEntry wirelessTransmitter; public ConfigImpl() { cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE); @@ -56,6 +57,7 @@ public ConfigImpl() { destructor = new SimpleEnergyUsageEntryImpl("destructor", "Destructor", DefaultEnergyUsage.DESTRUCTOR); constructor = new SimpleEnergyUsageEntryImpl("constructor", "Constructor", DefaultEnergyUsage.CONSTRUCTOR); wirelessGrid = new WirelessGridEntryImpl(); + wirelessTransmitter = new WirelessTransmitterEntryImpl(); spec = builder.build(); } @@ -143,6 +145,11 @@ public WirelessGridEntry getWirelessGrid() { return wirelessGrid; } + @Override + public WirelessTransmitterEntry getWirelessTransmitter() { + return wirelessTransmitter; + } + private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { private final ForgeConfigSpec.LongValue energyUsage; @@ -640,4 +647,28 @@ public long getInsertEnergyUsage() { return insertEnergyUsage.get(); } } + + private class WirelessTransmitterEntryImpl implements WirelessTransmitterEntry { + private final ForgeConfigSpec.LongValue energyUsage; + private final ForgeConfigSpec.IntValue baseRange; + + WirelessTransmitterEntryImpl() { + builder.push("wirelessTransmitter"); + + energyUsage = builder.comment("The energy used by the Wireless Transmitter") + .defineInRange(ENERGY_USAGE, DefaultEnergyUsage.WIRELESS_TRANSMITTER, 0, Long.MAX_VALUE); + baseRange = builder.comment("The base range of the Wireless Transmitter") + .defineInRange("baseRange", DefaultEnergyUsage.WIRELESS_TRANSMITTER_BASE_RANGE, 0, Integer.MAX_VALUE); + + builder.pop(); + } + + public long getEnergyUsage() { + return energyUsage.get(); + } + + public int getBaseRange() { + return baseRange.get(); + } + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java index c079da094..3b4a672b7 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java @@ -23,6 +23,7 @@ protected void registerModels() { registerGrids(Blocks.INSTANCE.getGrid(), "grid"); registerGrids(Blocks.INSTANCE.getCraftingGrid(), "crafting_grid"); registerDetectors(); + registerWirelessTransmitters(); } private void registerCables() { @@ -102,4 +103,11 @@ private void registerDetectors() { .texture("torch", torch); }); } + + private void registerWirelessTransmitters() { + final ResourceLocation parent = createIdentifier("block/wireless_transmitter/inactive"); + Blocks.INSTANCE.getWirelessTransmitter() + .forEach((color, id, block) -> withExistingParent("block/wireless_transmitter/" + color.getName(), parent) + .texture("cutout", createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()))); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java index 634ffef74..208e90ddd 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java @@ -5,6 +5,7 @@ import com.refinedmods.refinedstorage2.platform.common.block.ControllerBlock; import com.refinedmods.refinedstorage2.platform.common.block.ControllerEnergyType; import com.refinedmods.refinedstorage2.platform.common.block.DetectorBlock; +import com.refinedmods.refinedstorage2.platform.common.block.WirelessTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.block.direction.BiDirectionType; import com.refinedmods.refinedstorage2.platform.common.block.direction.DirectionTypeImpl; import com.refinedmods.refinedstorage2.platform.common.block.grid.AbstractGridBlock; @@ -57,6 +58,7 @@ protected void registerStatesAndModels() { registerControllers(); registerGrids(); registerDetectors(); + registerWirelessTransmitters(); registerConstructorDestructors(Blocks.INSTANCE.getConstructor(), "constructor"); registerConstructorDestructors(Blocks.INSTANCE.getDestructor(), "destructor"); } @@ -201,6 +203,24 @@ private void registerDetectors() { }); } + private void registerWirelessTransmitters() { + final ModelFile inactive = modelFile(createIdentifier("block/wireless_transmitter/inactive")); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> { + final var builder = getVariantBuilder(block.get()); + builder.forAllStates(blockState -> { + final ConfiguredModel.Builder model = ConfiguredModel.builder(); + if (Boolean.TRUE.equals(blockState.getValue(WirelessTransmitterBlock.ACTIVE))) { + model.modelFile(modelFile(createIdentifier("block/wireless_transmitter/" + color.getName()))); + } else { + model.modelFile(inactive); + } + final Direction direction = blockState.getValue(DirectionTypeImpl.INSTANCE.getProperty()); + addRotation(model, direction); + return model.build(); + }); + }); + } + private void registerConstructorDestructors(final BlockColorMap blockMap, final String type) { blockMap.forEach((color, id, block) -> { final MultiPartBlockStateBuilder builder = addCableWithExtensions(block.get(), color); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java index 43fdac7ea..67778356c 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java @@ -8,6 +8,7 @@ import com.refinedmods.refinedstorage2.platform.common.block.ExporterBlock; import com.refinedmods.refinedstorage2.platform.common.block.ExternalStorageBlock; import com.refinedmods.refinedstorage2.platform.common.block.ImporterBlock; +import com.refinedmods.refinedstorage2.platform.common.block.WirelessTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.block.grid.CraftingGridBlock; import com.refinedmods.refinedstorage2.platform.common.block.grid.GridBlock; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; @@ -40,6 +41,7 @@ protected void registerModels() { registerDetectors(); registerConstructors(); registerDestructors(); + registerWirelessTransmitters(); } private void registerCables() { @@ -168,6 +170,17 @@ private void registerDestructors() { )); } + private void registerWirelessTransmitters() { + final ResourceLocation base = createIdentifier("block/wireless_transmitter/inactive"); + final ColorMap blocks = Blocks.INSTANCE.getWirelessTransmitter(); + blocks.forEach((color, id, block) -> singleTexture( + id.getPath(), + base, + "cutout", + createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()) + )); + } + private ModelFile modelFile(final ResourceLocation location) { return new ModelFile.ExistingModelFile(location, existingFileHelper); } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java index c5b29c452..74947c19e 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java @@ -25,6 +25,7 @@ protected void generate() { Blocks.INSTANCE.getDetector().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getConstructor().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> dropSelf(block.get())); } @Override @@ -38,6 +39,7 @@ protected Iterable getKnownBlocks() { blocks.addAll(Blocks.INSTANCE.getDetector().values()); blocks.addAll(Blocks.INSTANCE.getConstructor().values()); blocks.addAll(Blocks.INSTANCE.getDestructor().values()); + blocks.addAll(Blocks.INSTANCE.getWirelessTransmitter().values()); return blocks; } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java index 527390c15..9d6cd3443 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java @@ -54,6 +54,9 @@ protected void buildRecipes(final Consumer provider) { Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> recolorItems(Tags.DESTRUCTORS, block.get().asItem(), color) .save(provider, createIdentifier("coloring/" + color.getName() + "_destructor"))); + Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> + recolorItems(Tags.WIRELESS_TRANSMITTERS, block.get().asItem(), color) + .save(provider, createIdentifier("coloring/" + color.getName() + "_wireless_transmitter"))); } private ShapelessRecipeBuilder recolorItems(final TagKey dyeable, final Item result, final DyeColor color) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java index 64f5711b5..7153eb09e 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java @@ -32,6 +32,7 @@ import static com.refinedmods.refinedstorage2.platform.common.content.Tags.GRIDS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.IMPORTERS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.STORAGE_DISKS; +import static com.refinedmods.refinedstorage2.platform.common.content.Tags.WIRELESS_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.MOD_ID; public class ItemTagGenerator extends ItemTagsProvider { @@ -94,6 +95,10 @@ protected void addTags(final HolderLookup.Provider provider) { Blocks.INSTANCE.getDestructor().values().stream() .map(block -> (Supplier) block::asItem) .toList()); + addAllToTag(WIRELESS_TRANSMITTERS, + Blocks.INSTANCE.getWirelessTransmitter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); } private void addAllToTag(final TagKey t, final Collection> items) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java index 3c6836009..9f29097bb 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -54,8 +54,18 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS); groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES); groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS); - groupItems(registry, Blocks.INSTANCE.getCreativeController(), - ContentIds.CREATIVE_CONTROLLER, Tags.CREATIVE_CONTROLLERS); + groupItems( + registry, + Blocks.INSTANCE.getCreativeController(), + ContentIds.CREATIVE_CONTROLLER, + Tags.CREATIVE_CONTROLLERS + ); + groupItems( + registry, + Blocks.INSTANCE.getWirelessTransmitter(), + ContentIds.WIRELESS_TRANSMITTER, + Tags.WIRELESS_TRANSMITTERS + ); } @Override diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java index 2bcc807de..98cb6752b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/FluidHandlerExporterTransferStrategyFactory.java @@ -33,7 +33,7 @@ public ExporterTransferStrategy create(final ServerLevel level, coordinates, amountOverride ); - final long transferQuota = (upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? 64 : 1) + final long transferQuota = (upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1) * Platform.INSTANCE.getBucketAmount(); if (fuzzyMode) { return new AbstractFuzzyExporterTransferStrategy<>(destination, StorageChannelTypes.FLUID, transferQuota) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java index fb1772b60..c4fd6e416 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/exporter/ItemHandlerExporterTransferStrategyFactory.java @@ -28,7 +28,7 @@ public ExporterTransferStrategy create(final ServerLevel level, final boolean fuzzyMode) { final InteractionCoordinatesImpl coordinates = new InteractionCoordinatesImpl(level, pos, direction); final ItemHandlerInsertableStorage destination = new ItemHandlerInsertableStorage(coordinates, amountOverride); - final int transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; if (fuzzyMode) { return new AbstractFuzzyExporterTransferStrategy<>(destination, StorageChannelTypes.ITEM, transferQuota) { @Nullable diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java index a1c92c282..c23b0a57e 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/FluidHandlerImporterTransferStrategyFactory.java @@ -28,7 +28,7 @@ public ImporterTransferStrategy create(final ServerLevel level, pos, direction ), amountOverride); - final int transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? FluidType.BUCKET_VOLUME * 64 : FluidType.BUCKET_VOLUME; return new ImporterTransferStrategyImpl<>(source, StorageChannelTypes.FLUID, transferQuota); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java index 8de016083..d0091d49f 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/internal/network/node/importer/ItemHandlerImporterTransferStrategyFactory.java @@ -27,7 +27,7 @@ public ImporterTransferStrategy create(final ServerLevel level, pos, direction ), amountOverride); - final int transferQuota = upgradeState.hasUpgrade(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; + final int transferQuota = upgradeState.has(Items.INSTANCE.getStackUpgrade()) ? 64 : 1; return new ImporterTransferStrategyImpl<>(source, StorageChannelTypes.ITEM, transferQuota); } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java index e861a5b82..00eb6722a 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java @@ -17,6 +17,7 @@ import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridUpdatePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.StorageInfoResponsePacket; +import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.WirelessTransmitterRangePacket; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; @@ -46,6 +47,13 @@ public NetworkManager() { ControllerEnergyInfoPacket::decode, ControllerEnergyInfoPacket::handle ); + handler.registerMessage( + id++, + WirelessTransmitterRangePacket.class, + WirelessTransmitterRangePacket::encode, + WirelessTransmitterRangePacket::decode, + WirelessTransmitterRangePacket::handle + ); handler.registerMessage( id++, PropertyChangePacket.class, diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java index 8849e8f80..e96402395 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java @@ -25,6 +25,11 @@ public void sendControllerEnergyInfo(final ServerPlayer player, final long store networkManager.send(player, new ControllerEnergyInfoPacket(stored, capacity)); } + @Override + public void sendWirelessTransmitterRange(final ServerPlayer player, final int range) { + networkManager.send(player, new WirelessTransmitterRangePacket(range)); + } + @Override public void sendGridActiveness(final ServerPlayer player, final boolean active) { networkManager.send(player, new GridActivePacket(active)); diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java new file mode 100644 index 000000000..d751be18a --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/WirelessTransmitterRangePacket.java @@ -0,0 +1,39 @@ +package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.containermenu.WirelessTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.util.ClientProxy; + +import java.util.function.Supplier; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraftforge.network.NetworkEvent; + +public class WirelessTransmitterRangePacket { + private final int range; + + public WirelessTransmitterRangePacket(final int range) { + this.range = range; + } + + public static WirelessTransmitterRangePacket decode(final FriendlyByteBuf buf) { + return new WirelessTransmitterRangePacket(buf.readInt()); + } + + public static void encode(final WirelessTransmitterRangePacket packet, final FriendlyByteBuf buf) { + buf.writeInt(packet.range); + } + + public static void handle(final WirelessTransmitterRangePacket packet, final Supplier ctx) { + ctx.get().enqueueWork(() -> ClientProxy.getPlayer().ifPresent(player -> handle(player, packet))); + ctx.get().setPacketHandled(true); + } + + private static void handle(final Player player, final WirelessTransmitterRangePacket packet) { + final AbstractContainerMenu menu = player.containerMenu; + if (menu instanceof WirelessTransmitterContainerMenu containerMenu) { + containerMenu.setRange(packet.range); + } + } +} From e7962088042cd6aedbdc5e5076b3d2bf354873c7 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 26 Aug 2023 21:41:52 +0200 Subject: [PATCH 02/12] feat: range upgrade and creative range upgrade --- CHANGELOG.md | 2 ++ .../common/AbstractModInitializer.java | 19 +++++++++++ .../platform/common/Config.java | 6 ++++ ...gradeWirelessTransmitterRangeModifier.java | 20 +++++++++++ ...gradeWirelessTransmitterRangeModifier.java | 15 ++++++++ .../WirelessTransmitterBlockEntity.java | 15 ++++++-- .../platform/common/content/ContentIds.java | 2 ++ .../common/content/CreativeModeTabItems.java | 2 ++ .../common/content/DefaultEnergyUsage.java | 3 ++ .../platform/common/content/Items.java | 20 +++++++++++ .../common/item/RangeUpgradeItem.java | 26 ++++++++++++++ .../assets/refinedstorage2/lang/en_us.json | 5 +++ .../models/item/creative_range_upgrade.json | 6 ++++ .../models/item/range_upgrade.json | 6 ++++ .../textures/item/creative_range_upgrade.png | Bin 0 -> 511 bytes .../textures/item/range_upgrade.png | Bin 0 -> 1507 bytes .../recipes/range_upgrade.json | 22 ++++++++++++ .../platform/fabric/ConfigImpl.java | 21 ++++++++++++ .../platform/forge/ConfigImpl.java | 32 ++++++++++++++++++ 19 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/creative_range_upgrade.json create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/creative_range_upgrade.png create mode 100644 refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/range_upgrade.png create mode 100644 refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/range_upgrade.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af0a952f..186e3c5e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Wireless Grid - Creative Wireless Grid - Wireless Transmitter +- Range Upgrade +- Creative Range Upgrade ### Changed 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 183bdaf51..f253fe2b5 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 @@ -36,6 +36,8 @@ import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.FluidStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.storage.ItemStorageBlockBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.BaseWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.CreativeRangeUpgradeWirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.RangeUpgradeWirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.containermenu.ConstructorContainerMenu; import com.refinedmods.refinedstorage2.platform.common.containermenu.ControllerContainerMenu; @@ -73,6 +75,7 @@ import com.refinedmods.refinedstorage2.platform.common.item.FortuneUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.item.ItemStorageDiskItem; import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.item.RangeUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.item.RegulatorUpgradeItem; import com.refinedmods.refinedstorage2.platform.common.item.SimpleItem; import com.refinedmods.refinedstorage2.platform.common.item.SimpleUpgradeItem; @@ -206,6 +209,10 @@ private void registerNetworkComponents() { private void registerWirelessTransmitterRangeModifiers() { PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new BaseWirelessTransmitterRangeModifier()); + PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier(new RangeUpgradeWirelessTransmitterRangeModifier()); + PlatformApi.INSTANCE.addWirelessTransmitterRangeModifier( + new CreativeRangeUpgradeWirelessTransmitterRangeModifier() + ); } protected final void registerBlocks( @@ -395,6 +402,14 @@ private void registerUpgrades( ContentIds.REGULATOR_UPGRADE, regulatorUpgradeItemSupplier )); + Items.INSTANCE.setRangeUpgrade(callback.register( + ContentIds.RANGE_UPGRADE, + () -> new RangeUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), false) + )); + Items.INSTANCE.setCreativeRangeUpgrade(callback.register( + ContentIds.CREATIVE_RANGE_UPGRADE, + () -> new RangeUpgradeItem(PlatformApi.INSTANCE.getUpgradeRegistry(), true) + )); } protected final void registerUpgradeMappings() { @@ -418,6 +433,10 @@ protected final void registerUpgradeMappings() { PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.CONSTRUCTOR) .add(Items.INSTANCE.getSpeedUpgrade(), 4) .add(Items.INSTANCE.getStackUpgrade()); + + PlatformApi.INSTANCE.getUpgradeRegistry().forDestination(UpgradeDestinations.WIRELESS_TRANSMITTER) + .add(Items.INSTANCE.getRangeUpgrade(), 4) + .add(Items.INSTANCE.getCreativeRangeUpgrade()); } protected final void registerBlockEntities( 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 43c982d68..865bbf8d0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java @@ -140,6 +140,12 @@ interface UpgradeEntry { long getSilkTouchUpgradeEnergyUsage(); long getRegulatorUpgradeEnergyUsage(); + + long getRangeUpgradeEnergyUsage(); + + long getCreativeRangeUpgradeEnergyUsage(); + + int getRangeUpgradeRange(); } interface WirelessGridEntry { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..4933e6295 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/CreativeRangeUpgradeWirelessTransmitterRangeModifier.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.common.content.Items; + +public class CreativeRangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + if (upgradeState.has(Items.INSTANCE.getCreativeRangeUpgrade())) { + return Integer.MAX_VALUE; + } + return range; + } + + @Override + public int getPriority() { + return Integer.MAX_VALUE; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java new file mode 100644 index 000000000..5a2b1b9c0 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/RangeUpgradeWirelessTransmitterRangeModifier.java @@ -0,0 +1,15 @@ +package com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter; + +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitterRangeModifier; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeState; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.Items; + +public class RangeUpgradeWirelessTransmitterRangeModifier implements WirelessTransmitterRangeModifier { + @Override + public int modifyRange(final UpgradeState upgradeState, final int range) { + final int amountOfRangeUpgrades = upgradeState.getAmount(Items.INSTANCE.getRangeUpgrade()); + final int rangePerUpgrade = Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeRange(); + return range + (amountOfRangeUpgrades * rangePerUpgrade); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java index b38f4658f..9eb86e5e2 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -25,8 +25,6 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.level.block.state.BlockState; -// TODO: Range Upgrade. -// TODO: Check advancement public class WirelessTransmitterBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity implements ExtendedMenuProvider { private static final String TAG_UPGRADES = "u"; @@ -34,7 +32,7 @@ public class WirelessTransmitterBlockEntity extends AbstractInternalNetworkNodeC private final UpgradeContainer upgradeContainer = new UpgradeContainer( UpgradeDestinations.WIRELESS_TRANSMITTER, PlatformApi.INSTANCE.getUpgradeRegistry(), - this::setChanged + this::upgradeContainerChanged ); public WirelessTransmitterBlockEntity(final BlockPos pos, final BlockState state) { @@ -54,6 +52,7 @@ public void load(final CompoundTag tag) { if (tag.contains(TAG_UPGRADES)) { upgradeContainer.fromTag(tag.getList(TAG_UPGRADES, Tag.TAG_COMPOUND)); } + configureAccordingToUpgrades(); super.load(tag); } @@ -86,4 +85,14 @@ public int getRange() { public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { buf.writeInt(getRange()); } + + private void upgradeContainerChanged() { + setChanged(); + configureAccordingToUpgrades(); + } + + private void configureAccordingToUpgrades() { + final long baseUsage = Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage(); + getNode().setEnergyUsage(baseUsage + upgradeContainer.getEnergyUsage()); + } } 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 85afd39ba..1ea0d646c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java @@ -45,6 +45,8 @@ public final class ContentIds { public static final ResourceLocation WIRELESS_GRID = createIdentifier("wireless_grid"); public static final ResourceLocation CREATIVE_WIRELESS_GRID = createIdentifier("creative_wireless_grid"); public static final ResourceLocation WIRELESS_TRANSMITTER = createIdentifier("wireless_transmitter"); + public static final ResourceLocation RANGE_UPGRADE = createIdentifier("range_upgrade"); + public static final ResourceLocation CREATIVE_RANGE_UPGRADE = createIdentifier("creative_range_upgrade"); private ContentIds() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java index 193df7ece..b665771f0 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 @@ -87,6 +87,8 @@ private static void appendItems(final Consumer consumer) { itemConsumer.accept(Items.INSTANCE.getFortune3Upgrade()); itemConsumer.accept(Items.INSTANCE.getSilkTouchUpgrade()); itemConsumer.accept(Items.INSTANCE.getRegulatorUpgrade()); + itemConsumer.accept(Items.INSTANCE.getRangeUpgrade()); + itemConsumer.accept(Items.INSTANCE.getCreativeRangeUpgrade()); itemConsumer.accept(Items.INSTANCE.getWirelessGrid()); if (Platform.INSTANCE.getConfig().getWirelessGrid().getUseEnergy()) { consumer.accept(Items.INSTANCE.getWirelessGrid().getAtCapacity()); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java index 092be4dff..86f47ed85 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java @@ -34,6 +34,9 @@ public final class DefaultEnergyUsage { public static final long FORTUNE_3_UPGRADE = 14; public static final long SILK_TOUCH_UPGRADE = 16; public static final long REGULATOR_UPGRADE = 16; + public static final long RANGE_UPGRADE = 8; + public static final long CREATIVE_RANGE_UPGRADE = 0; + public static final int RANGE_UPGRADE_RANGE = 8; public static final long WIRELESS_GRID_CAPACITY = 1000; public static final long WIRELESS_GRID_OPEN = 5; 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 7c8c43d79..8b6207543 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 @@ -71,6 +71,10 @@ public final class Items { @Nullable private Supplier regulatorUpgrade; @Nullable + private Supplier rangeUpgrade; + @Nullable + private Supplier creativeRangeUpgrade; + @Nullable private Supplier wirelessGrid; @Nullable private Supplier creativeWirelessGrid; @@ -319,6 +323,22 @@ public void setRegulatorUpgrade(final Supplier re this.regulatorUpgrade = regulatorUpgrade; } + public AbstractUpgradeItem getRangeUpgrade() { + return Objects.requireNonNull(rangeUpgrade).get(); + } + + public void setRangeUpgrade(final Supplier rangeUpgrade) { + this.rangeUpgrade = rangeUpgrade; + } + + public AbstractUpgradeItem getCreativeRangeUpgrade() { + return Objects.requireNonNull(creativeRangeUpgrade).get(); + } + + public void setCreativeRangeUpgrade(final Supplier creativeRangeUpgrade) { + this.creativeRangeUpgrade = creativeRangeUpgrade; + } + public WirelessGridItem getWirelessGrid() { return Objects.requireNonNull(wirelessGrid).get(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java new file mode 100644 index 000000000..e6905390b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java @@ -0,0 +1,26 @@ +package com.refinedmods.refinedstorage2.platform.common.item; + +import com.refinedmods.refinedstorage2.platform.api.item.AbstractUpgradeItem; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; +import com.refinedmods.refinedstorage2.platform.common.Platform; + +import net.minecraft.world.item.Item; + +// TODO: improved texture. +// todo: check conf on fabric. +public class RangeUpgradeItem extends AbstractUpgradeItem { + private final boolean creative; + + public RangeUpgradeItem(final UpgradeRegistry registry, final boolean creative) { + super(new Item.Properties(), registry); + this.creative = creative; + } + + @Override + public long getEnergyUsage() { + if (creative) { + return Platform.INSTANCE.getConfig().getUpgrade().getCreativeRangeUpgradeEnergyUsage(); + } + return Platform.INSTANCE.getConfig().getUpgrade().getRangeUpgradeEnergyUsage(); + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json index feb2b453c..8e52e819d 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 @@ -181,6 +181,8 @@ "item.refinedstorage2.fortune_upgrade.3": "Fortune III Upgrade", "item.refinedstorage2.regulator_upgrade": "Regulator Upgrade", "item.refinedstorage2.regulator_upgrade.help": "In an Exporter, will only export if the amount in the target is less than configured in the upgrade. In an Importer, will only import if the amount in the target is more than configured in the upgrade. Use item to configure.", + "item.refinedstorage2.range_upgrade": "Range Upgrade", + "item.refinedstorage2.creative_range_upgrade": "Creative Range Upgrade", "item.refinedstorage2.wireless_grid": "Wireless Grid", "item.refinedstorage2.creative_wireless_grid": "Creative Wireless Grid", "item.refinedstorage2.wireless_transmitter.help": "Provides wireless network access for items like the Wireless Grid. Multiple are allowed in an area for wider coverage.", @@ -266,6 +268,9 @@ "text.autoconfig.refinedstorage2.option.upgrade.fortune3UpgradeEnergyUsage": "Fortune 3 Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.silkTouchUpgradeEnergyUsage": "Silk Touch Upgrade energy usage", "text.autoconfig.refinedstorage2.option.upgrade.regulatorUpgradeEnergyUsage": "Regulator Upgrade energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeEnergyUsage": "Range Upgrade energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.creativeRangeUpgradeEnergyUsage": "Creative Range Upgrade energy usage", + "text.autoconfig.refinedstorage2.option.upgrade.rangeUpgradeRange": "Range Upgrade range", "text.autoconfig.refinedstorage2.option.iface": "Interface", "text.autoconfig.refinedstorage2.option.iface.energyUsage": "Energy usage", "text.autoconfig.refinedstorage2.option.externalStorage": "External Storage", diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/creative_range_upgrade.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/creative_range_upgrade.json new file mode 100644 index 000000000..dbf07ee4e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/creative_range_upgrade.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/creative_range_upgrade" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json new file mode 100644 index 000000000..a5e8376b4 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/item/range_upgrade.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "refinedstorage2:item/range_upgrade" + } +} diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/creative_range_upgrade.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/creative_range_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..fb8f1da0e25f18b9e820a3d0fb81d0e3e350c315 GIT binary patch literal 511 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Li30X`wFfq{WHZrphM_;F-pQ%?f4^N*yZT;k>P;QaV zsdHPlY$^Qzi#IWoyQGOHy~JqW?*04sM@L8ByLa#0xpPWIS=@`4bG38}rKQ{7xUhBW z*08X!n3$N5kPwlXJzQ&c^G%t)ef##%(9ll|7kN4-?%1)z&(Ck-#EAzPmS1Mr{)pj7 zP*Bk3&6{`c-aU8jTwh<`6$}&qGu%0F;DEose>+3zvSrJF?iHzIvjS3pwRAIUwtJSomBTcgAfcKOqNpiOo4?t$FMDa~fEG7nscR zNlbh9;^=ekh;`Ry>%MUkNjfhf)2BW`(OvMU%WUJANvms%yx-q^%o+4V|99p`zvNF7 zQ`bqh8cr1`&9veQ4Ut@{{3h(hha-*RdS11RbF4Kst^W3-73f9=Pgg&ebxsLQ0HZzi AsQ>@~ literal 0 HcmV?d00001 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/range_upgrade.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/item/range_upgrade.png new file mode 100644 index 0000000000000000000000000000000000000000..d1d7f1ac1ff480213f04cf8d1970b93446e5a7d4 GIT binary patch literal 1507 zcmbVMeNYr-7(dXtjF34|6Ag1+bAsvi_TxVHh7*t5Ltr?9gNd`8VsCd(mg8>E-PKz# zO#ug~%+v~@89zZradK+Zw5E_IG-C`#!q3#O2o)VObsQQQdhg_{KOFyPXLjGO=l49n z_xC){HWU^tnw&5zL8Ven&ds6RVAMq3Now$&b9ame!%W%fk&6YN9HvE1WoHF12jvFn zrJS3i*{WqHxeS$R!V12`BYRx=Rz?Wu=!lI@34{PzrOL=uLNw#&WXQ`c<%2f(_SYRS z#IrWI)ab%oAqQ8^=TwVaadklnQ|)I+7S3D%WhhqQAi&8qqy#F1l2x(6QNLC&k8Gnb z6g83kHuw=KkE;-J2qFg=btZ(taU3#}I^1Z{6GkmWV7L**NEF8q47cK#mB66!2L{nZ z)@OB7+2gUm$_AIqa>$CJ;c!?N*6RduDT^LZm3k4)Y6*`3CIt&d2BKL|~OR}5$m&OyVrIM-; zhq^gQSS~UkAHI1pFwpMlfg*;0jrCQL2T7qTDS=rY;DT~4WrM+qj^$aa!Ax>q%!?r= zlaWRAUV{O#;6?_)fucZ9!o=X_n4c%(F~X9ar8hd9ARA7TozjzblhdxZWSL1jLB_DT zK}n{A3>S;dM`K5^#8a_Whse>gAeIP1WvmJc%LQ4G%7qZ*a742XrIqqQRtQV!ku*KJ zHN}bi3XaVdg#Z-Q*~&kG18(v82m?tVMzbD6XvSbfEMAO6fGif=toNFYm;oNgv;S8= z6p%tA#qyuxiEV+3j7%T50$4n5CN2m%NCd4i=kBgVl`4KhE@dxKF0^d1=QPtPC&msG zvw6Kqh*~{6F}wc$vsXPYHotVFbK&N-nu(6$5 z*P8XW)aq_n#g%U2mqD6^Y13}3Rj;emEN<_Ax3f&sl&?PJo4R28M*CO$&c;`oKD~BF z`LLkv&gl7!FV1Tx+SgpX&u2HymS$x!Zdjy2hyo&c1T% z*L&y>KX$LgIxNR~PbM9o?xc1XwYbyI-CFUxNbdP%@o?vt3$M)A>@QlcoSwO< Date: Sat, 26 Aug 2023 22:07:47 +0200 Subject: [PATCH 03/12] feat: ability to retrieve graph containers by class Useful for retrieving all wireless transmitters. --- .../impl/component/GraphNetworkComponent.java | 18 +++ .../component/GraphNetworkComponentTest.java | 148 ++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java index 665101d10..9caa3486e 100644 --- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java +++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java @@ -5,7 +5,9 @@ import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; import org.slf4j.Logger; @@ -16,6 +18,8 @@ public class GraphNetworkComponent implements NetworkComponent { private final Network network; private final Set containers = new HashSet<>(); + private final Map, Set> containerIndex = + new HashMap<>(); public GraphNetworkComponent(final Network network) { this.network = network; @@ -25,16 +29,30 @@ public Set getContainers() { return Collections.unmodifiableSet(containers); } + @SuppressWarnings("unchecked") + public Set getContainers(final Class clazz) { + return (Set) Collections.unmodifiableSet(containerIndex.getOrDefault(clazz, Collections.emptySet())); + } + @Override public void onContainerAdded(final NetworkNodeContainer container) { LOGGER.debug("Container {} added to network {}", container, network.hashCode()); containers.add(container); + containerIndex.computeIfAbsent(container.getClass(), k -> new HashSet<>()).add(container); } @Override public void onContainerRemoved(final NetworkNodeContainer container) { LOGGER.debug("Container {} removed from network {}", container, network.hashCode()); containers.remove(container); + final Class indexKey = container.getClass(); + final Set index = containerIndex.get(indexKey); + if (index != null) { + index.remove(container); + if (index.isEmpty()) { + containerIndex.remove(indexKey); + } + } } @Override diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java new file mode 100644 index 000000000..086e84036 --- /dev/null +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java @@ -0,0 +1,148 @@ +package com.refinedmods.refinedstorage2.api.network.impl.component; + +import com.refinedmods.refinedstorage2.api.network.impl.NetworkImpl; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; +import com.refinedmods.refinedstorage2.api.network.node.container.NetworkNodeContainer; +import com.refinedmods.refinedstorage2.network.test.NetworkTestFixtures; + +import java.util.Set; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +class GraphNetworkComponentTest { + GraphNetworkComponent sut; + + @BeforeEach + void setUp() { + sut = new GraphNetworkComponent(new NetworkImpl(NetworkTestFixtures.NETWORK_COMPONENT_MAP_FACTORY)); + } + + @Test + void shouldAddContainer() { + // Arrange + final NetworkNodeContainer container1 = () -> new SimpleNetworkNode(0); + final NetworkNodeContainer container2 = () -> new SimpleNetworkNode(0); + + // Act + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Assert + assertThat(sut.getContainers()).containsExactlyInAnyOrder(container1, container2); + } + + @Test + void shouldRemoveContainer() { + // Arrange + final NetworkNodeContainer container1 = () -> new SimpleNetworkNode(0); + final NetworkNodeContainer container2 = () -> new SimpleNetworkNode(0); + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container1); + + // Assert + assertThat(sut.getContainers()).containsExactly(container2); + } + + @Test + void shouldNotRetrieveContainersByClassThatDontExist() { + // Act + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).isEmpty(); + } + + @Test + void shouldAddAndRetrieveSingleContainerByClass() { + // Arrange + final NetworkNodeContainer1 container1 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container1); + sut.onContainerAdded(container2); + + // Act + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).containsExactly(container1); + } + + @Test + void shouldAddAndRetrieveMultipleContainersByClass() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).containsExactlyInAnyOrder(container11, container12); + } + + @Test + void shouldRemoveSingleContainerAndRetrieveByClass() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container12); + + final Set containers = sut.getContainers(NetworkNodeContainer1.class); + + // Assert + assertThat(containers).containsExactly(container11); + } + + @Test + void shouldRemoveMultipleContainersAndRetrieveByClass() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container11); + sut.onContainerRemoved(container12); + + final Set containers1 = sut.getContainers(NetworkNodeContainer1.class); + final Set containers2 = sut.getContainers(NetworkNodeContainer2.class); + + // Assert + assertThat(containers1).isEmpty(); + assertThat(containers2).containsExactly(container2); + } + + private static class NetworkNodeContainer1 implements NetworkNodeContainer { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + } + + private static class NetworkNodeContainer2 implements NetworkNodeContainer { + @Override + public NetworkNode getNode() { + return new SimpleNetworkNode(0); + } + } +} From c25986fe901ab6b28523f58a5246de555e6a4ce3 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 10:51:55 +0200 Subject: [PATCH 04/12] fix: opening a wireless grid now checks for transmitters in range --- .../common/internal/grid/WirelessGrid.java | 39 ++++++++++++++++++- .../common/item/NetworkBoundItemContext.java | 15 +++++++ .../common/item/RangeUpgradeItem.java | 3 +- 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java index 7fb2edcc0..6a4e0655e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java @@ -8,6 +8,7 @@ import com.refinedmods.refinedstorage2.api.network.Network; import com.refinedmods.refinedstorage2.api.network.component.EnergyNetworkComponent; import com.refinedmods.refinedstorage2.api.network.component.StorageNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.impl.component.GraphNetworkComponent; import com.refinedmods.refinedstorage2.api.network.impl.node.grid.GridWatchers; import com.refinedmods.refinedstorage2.api.network.node.NetworkNode; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; @@ -22,6 +23,7 @@ import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; +import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; import com.refinedmods.refinedstorage2.platform.common.item.NetworkBoundItemContext; @@ -29,10 +31,12 @@ import java.util.Collections; import java.util.List; import java.util.Optional; +import java.util.Set; import net.minecraft.server.MinecraftServer; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; -// TODO: Check wireless transmitters public class WirelessGrid implements Grid { private final MinecraftServer server; private final NetworkBoundItemContext ctx; @@ -49,11 +53,42 @@ private Optional getNetwork() { return Optional.empty(); } return Optional.ofNullable(server.getLevel(ctx.getNetworkReference().dimensionKey())) + .filter(level -> level.isLoaded(ctx.getNetworkReference().pos())) .map(level -> level.getBlockEntity(ctx.getNetworkReference().pos())) .filter(PlatformNetworkNodeContainer.class::isInstance) .map(PlatformNetworkNodeContainer.class::cast) .map(PlatformNetworkNodeContainer::getNode) - .map(NetworkNode::getNetwork); + .map(NetworkNode::getNetwork) + .flatMap(this::isInRange); + } + + private Optional isInRange(final Network network) { + /// TODO: Wireless Transmitter API iface here instead of concrete class? + final Set transmitters = network.getComponent(GraphNetworkComponent.class) + .getContainers(WirelessTransmitterBlockEntity.class); + for (final WirelessTransmitterBlockEntity transmitter : transmitters) { + if (isInRange(transmitter)) { + return Optional.of(network); + } + } + return Optional.empty(); + } + + private boolean isInRange(final WirelessTransmitterBlockEntity transmitter) { + final Level transmitterLevel = transmitter.getLevel(); + if (transmitterLevel == null || transmitterLevel.dimension() != ctx.getPlayerLevel()) { + return false; + } + if (!transmitter.getNode().isActive()) { + return false; + } + final Vec3 pos = ctx.getPlayerPosition(); + final double distance = Math.sqrt( + Math.pow(transmitter.getBlockPos().getX() - pos.x(), 2) + + Math.pow(transmitter.getBlockPos().getY() - pos.y(), 2) + + Math.pow(transmitter.getBlockPos().getZ() - pos.z(), 2) + ); + return distance <= transmitter.getRange(); } private Optional getStorage() { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java index fec2e3638..3e5a5749e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/NetworkBoundItemContext.java @@ -8,9 +8,11 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; public class NetworkBoundItemContext { private final Player player; + private final Vec3 playerPosition; private final PlayerSlotReference playerSlotReference; private final ItemEnergyProvider energyProvider; @Nullable @@ -23,11 +25,24 @@ public NetworkBoundItemContext( @Nullable final NetworkReference networkReference ) { this.player = player; + // We copy the player position as it can change after opening the network bound item (opening while walking) + // and could cause the network not being accessible anymore (due to being out of range of a transmitter). + // If the network is no longer accessible, certain assumptions will break (e.g. grid watcher can no longer + // be removed after it was added). + this.playerPosition = new Vec3(player.position().x, player.position().y, player.position().z); this.playerSlotReference = playerSlotReference; this.energyProvider = energyProvider; this.networkReference = networkReference; } + public Vec3 getPlayerPosition() { + return playerPosition; + } + + public ResourceKey getPlayerLevel() { + return player.level().dimension(); + } + public boolean isActive() { if (!energyProvider.isEnabled()) { return true; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java index e6905390b..afe3894b4 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/RangeUpgradeItem.java @@ -6,8 +6,7 @@ import net.minecraft.world.item.Item; -// TODO: improved texture. -// todo: check conf on fabric. +// TODO: improved creative texture. public class RangeUpgradeItem extends AbstractUpgradeItem { private final boolean creative; From f8a7fb9a4d9f7b2f96d5cb27d5c50e57cdd62aa4 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 11:14:05 +0200 Subject: [PATCH 05/12] refactor: graph component now supports querying by interface --- .../impl/component/GraphNetworkComponent.java | 32 +++++++-- .../component/GraphNetworkComponentTest.java | 66 ++++++++++++++++++- .../item/block/ControllerBlockItem.java | 1 + 3 files changed, 92 insertions(+), 7 deletions(-) diff --git a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java index 9caa3486e..18bda8c72 100644 --- a/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java +++ b/refinedstorage2-network/src/main/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponent.java @@ -18,8 +18,7 @@ public class GraphNetworkComponent implements NetworkComponent { private final Network network; private final Set containers = new HashSet<>(); - private final Map, Set> containerIndex = - new HashMap<>(); + private final Map, Set> containerIndex = new HashMap<>(); public GraphNetworkComponent(final Network network) { this.network = network; @@ -30,7 +29,7 @@ public Set getContainers() { } @SuppressWarnings("unchecked") - public Set getContainers(final Class clazz) { + public Set getContainers(final Class clazz) { return (Set) Collections.unmodifiableSet(containerIndex.getOrDefault(clazz, Collections.emptySet())); } @@ -38,14 +37,37 @@ public Set getContainers(final Class claz public void onContainerAdded(final NetworkNodeContainer container) { LOGGER.debug("Container {} added to network {}", container, network.hashCode()); containers.add(container); - containerIndex.computeIfAbsent(container.getClass(), k -> new HashSet<>()).add(container); + addToIndex(container); } @Override public void onContainerRemoved(final NetworkNodeContainer container) { LOGGER.debug("Container {} removed from network {}", container, network.hashCode()); containers.remove(container); - final Class indexKey = container.getClass(); + deleteFromIndex(container); + } + + private void addToIndex(final NetworkNodeContainer container) { + final Class clazz = container.getClass(); + addToIndex(clazz, container); + for (final Class iface : clazz.getInterfaces()) { + addToIndex(iface, container); + } + } + + private void addToIndex(final Class indexKey, final NetworkNodeContainer container) { + containerIndex.computeIfAbsent(indexKey, k -> new HashSet<>()).add(container); + } + + private void deleteFromIndex(final NetworkNodeContainer container) { + final Class clazz = container.getClass(); + deleteFromIndex(clazz, container); + for (final Class iface : clazz.getInterfaces()) { + deleteFromIndex(iface, container); + } + } + + private void deleteFromIndex(final Class indexKey, final NetworkNodeContainer container) { final Set index = containerIndex.get(indexKey); if (index != null) { index.remove(container); diff --git a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java index 086e84036..dc9b2ab61 100644 --- a/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java +++ b/refinedstorage2-network/src/test/java/com/refinedmods/refinedstorage2/api/network/impl/component/GraphNetworkComponentTest.java @@ -91,6 +91,23 @@ void shouldAddAndRetrieveMultipleContainersByClass() { assertThat(containers).containsExactlyInAnyOrder(container11, container12); } + @Test + void shouldAddAndRetrieveMultipleContainersByInterface() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + final Set containers = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers).containsExactlyInAnyOrder(container11, container12, container2); + } + @Test void shouldRemoveSingleContainerAndRetrieveByClass() { // Arrange @@ -110,6 +127,25 @@ void shouldRemoveSingleContainerAndRetrieveByClass() { assertThat(containers).containsExactly(container11); } + @Test + void shouldRemoveSingleContainerAndRetrieveByInterface() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container12); + + final Set containers = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers).containsExactlyInAnyOrder(container11, container2); + } + @Test void shouldRemoveMultipleContainersAndRetrieveByClass() { // Arrange @@ -126,23 +162,49 @@ void shouldRemoveMultipleContainersAndRetrieveByClass() { final Set containers1 = sut.getContainers(NetworkNodeContainer1.class); final Set containers2 = sut.getContainers(NetworkNodeContainer2.class); + final Set containersByIface = sut.getContainers(BothImplements.class); // Assert assertThat(containers1).isEmpty(); assertThat(containers2).containsExactly(container2); + assertThat(containersByIface).containsExactly(container2); } - private static class NetworkNodeContainer1 implements NetworkNodeContainer { + @Test + void shouldRemoveMultipleContainersAndRetrieveByInterface() { + // Arrange + final NetworkNodeContainer1 container11 = new NetworkNodeContainer1(); + final NetworkNodeContainer1 container12 = new NetworkNodeContainer1(); + final NetworkNodeContainer2 container2 = new NetworkNodeContainer2(); + sut.onContainerAdded(container11); + sut.onContainerAdded(container12); + sut.onContainerAdded(container2); + + // Act + sut.onContainerRemoved(container11); + sut.onContainerRemoved(container12); + sut.onContainerRemoved(container2); + + final Set containers = sut.getContainers(BothImplements.class); + + // Assert + assertThat(containers).isEmpty(); + } + + private static class NetworkNodeContainer1 implements NetworkNodeContainer, BothImplements { @Override public NetworkNode getNode() { return new SimpleNetworkNode(0); } } - private static class NetworkNodeContainer2 implements NetworkNodeContainer { + private static class NetworkNodeContainer2 implements NetworkNodeContainer, BothImplements { @Override public NetworkNode getNode() { return new SimpleNetworkNode(0); } } + + private interface BothImplements { + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java index fcc8dbc5b..30ccac062 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java @@ -20,6 +20,7 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; +// TODO: Fully charged in creative tabs public class ControllerBlockItem extends CreativeControllerBlockItem { public ControllerBlockItem(final Block block, final Component displayName) { super(block, displayName); From 321e8729f24352dac58aaed2cd6439a8fc7a8420 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 11:33:06 +0200 Subject: [PATCH 06/12] refactor: wireless transmitter on API level --- .../WirelessTransmitter.java | 12 ++++++ .../WirelessTransmitterBlockEntity.java | 23 +++++++++- .../common/internal/grid/WirelessGrid.java | 42 +++++-------------- 3 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java new file mode 100644 index 000000000..d405201a5 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/blockentity/wirelesstransmitter/WirelessTransmitter.java @@ -0,0 +1,12 @@ +package com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter; + +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +@FunctionalInterface +public interface WirelessTransmitter { + boolean isInRange(ResourceKey dimension, Vec3 position); +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java index 9eb86e5e2..a45aede31 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/wirelesstransmitter/WirelessTransmitterBlockEntity.java @@ -2,6 +2,7 @@ import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.block.entity.AbstractInternalNetworkNodeContainerBlockEntity; import com.refinedmods.refinedstorage2.platform.common.block.entity.UpgradeContainer; @@ -19,14 +20,17 @@ import net.minecraft.nbt.Tag; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.Vec3; public class WirelessTransmitterBlockEntity extends AbstractInternalNetworkNodeContainerBlockEntity - implements ExtendedMenuProvider { + implements ExtendedMenuProvider, WirelessTransmitter { private static final String TAG_UPGRADES = "u"; private final UpgradeContainer upgradeContainer = new UpgradeContainer( @@ -95,4 +99,21 @@ private void configureAccordingToUpgrades() { final long baseUsage = Platform.INSTANCE.getConfig().getWirelessTransmitter().getEnergyUsage(); getNode().setEnergyUsage(baseUsage + upgradeContainer.getEnergyUsage()); } + + @Override + public boolean isInRange(final ResourceKey dimension, final Vec3 position) { + final Level level = getLevel(); + if (level == null || level.dimension() != dimension) { + return false; + } + if (!getNode().isActive()) { + return false; + } + final double distance = Math.sqrt( + Math.pow(getBlockPos().getX() - position.x(), 2) + + Math.pow(getBlockPos().getY() - position.y(), 2) + + Math.pow(getBlockPos().getZ() - position.z(), 2) + ); + return distance <= getRange(); + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java index 6a4e0655e..86e5ef01e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/WirelessGrid.java @@ -19,11 +19,11 @@ import com.refinedmods.refinedstorage2.api.storage.TrackedResourceAmount; import com.refinedmods.refinedstorage2.api.storage.channel.StorageChannelType; import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.blockentity.wirelesstransmitter.WirelessTransmitter; import com.refinedmods.refinedstorage2.platform.api.grid.Grid; import com.refinedmods.refinedstorage2.platform.api.network.node.PlatformNetworkNodeContainer; import com.refinedmods.refinedstorage2.platform.api.resource.ItemResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; -import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.WirelessTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; import com.refinedmods.refinedstorage2.platform.common.item.NetworkBoundItemContext; @@ -31,11 +31,8 @@ import java.util.Collections; import java.util.List; import java.util.Optional; -import java.util.Set; import net.minecraft.server.MinecraftServer; -import net.minecraft.world.level.Level; -import net.minecraft.world.phys.Vec3; public class WirelessGrid implements Grid { private final MinecraftServer server; @@ -59,36 +56,17 @@ private Optional getNetwork() { .map(PlatformNetworkNodeContainer.class::cast) .map(PlatformNetworkNodeContainer::getNode) .map(NetworkNode::getNetwork) - .flatMap(this::isInRange); + .filter(this::isInRange); } - private Optional isInRange(final Network network) { - /// TODO: Wireless Transmitter API iface here instead of concrete class? - final Set transmitters = network.getComponent(GraphNetworkComponent.class) - .getContainers(WirelessTransmitterBlockEntity.class); - for (final WirelessTransmitterBlockEntity transmitter : transmitters) { - if (isInRange(transmitter)) { - return Optional.of(network); - } - } - return Optional.empty(); - } - - private boolean isInRange(final WirelessTransmitterBlockEntity transmitter) { - final Level transmitterLevel = transmitter.getLevel(); - if (transmitterLevel == null || transmitterLevel.dimension() != ctx.getPlayerLevel()) { - return false; - } - if (!transmitter.getNode().isActive()) { - return false; - } - final Vec3 pos = ctx.getPlayerPosition(); - final double distance = Math.sqrt( - Math.pow(transmitter.getBlockPos().getX() - pos.x(), 2) - + Math.pow(transmitter.getBlockPos().getY() - pos.y(), 2) - + Math.pow(transmitter.getBlockPos().getZ() - pos.z(), 2) - ); - return distance <= transmitter.getRange(); + private boolean isInRange(final Network network) { + return network.getComponent(GraphNetworkComponent.class) + .getContainers(WirelessTransmitter.class) + .stream() + .anyMatch(wirelessTransmitter -> wirelessTransmitter.isInRange( + ctx.getPlayerLevel(), + ctx.getPlayerPosition() + )); } private Optional getStorage() { From cd318fc487c19eac587108405c67c6b32427607f Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 11:34:29 +0200 Subject: [PATCH 07/12] refactor: move AbstractGridResource to API --- .../api/grid/AbstractPlatformGridResource.java | 17 +++++++++-------- .../internal/grid/view/FluidGridResource.java | 3 ++- .../internal/grid/view/ItemGridResource.java | 3 ++- 3 files changed, 13 insertions(+), 10 deletions(-) rename refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java => refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java (75%) diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java similarity index 75% rename from refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java rename to refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java index 2063b1cd8..2383f6e8b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/AbstractGridResource.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/grid/AbstractPlatformGridResource.java @@ -1,26 +1,27 @@ -package com.refinedmods.refinedstorage2.platform.common.internal.grid.view; +package com.refinedmods.refinedstorage2.platform.api.grid; import com.refinedmods.refinedstorage2.api.grid.view.GridResourceAttributeKey; import com.refinedmods.refinedstorage2.api.grid.view.GridView; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; -import com.refinedmods.refinedstorage2.platform.api.grid.PlatformGridResource; import java.util.Collections; import java.util.Map; import java.util.Optional; import java.util.Set; -// TODO: Move to API -public abstract class AbstractGridResource implements PlatformGridResource { +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +public abstract class AbstractPlatformGridResource implements PlatformGridResource { protected final ResourceAmount resourceAmount; private final String name; private final Map> attributes; private boolean zeroed; - protected AbstractGridResource(final ResourceAmount resourceAmount, - final String name, - final Map> attributes) { + protected AbstractPlatformGridResource(final ResourceAmount resourceAmount, + final String name, + final Map> attributes) { this.resourceAmount = resourceAmount; this.name = name; this.attributes = attributes; @@ -62,7 +63,7 @@ public void setZeroed(final boolean zeroed) { @Override public String toString() { - return "AbstractGridResource{" + return "AbstractPlatformGridResource{" + "resourceAmount=" + resourceAmount + ", name='" + name + '\'' + ", attributes=" + attributes diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java index fa89652c7..ac68dd07b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/FluidGridResource.java @@ -2,6 +2,7 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.platform.api.grid.AbstractPlatformGridResource; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridResourceAttributeKeys; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; @@ -22,7 +23,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.inventory.tooltip.TooltipComponent; -public class FluidGridResource extends AbstractGridResource { +public class FluidGridResource extends AbstractPlatformGridResource { private final FluidResource fluidResource; private final int id; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java index 0ecce143f..84729ae2c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/grid/view/ItemGridResource.java @@ -2,6 +2,7 @@ import com.refinedmods.refinedstorage2.api.grid.operations.GridExtractMode; import com.refinedmods.refinedstorage2.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage2.platform.api.grid.AbstractPlatformGridResource; import com.refinedmods.refinedstorage2.platform.api.grid.GridExtractionStrategy; import com.refinedmods.refinedstorage2.platform.api.grid.GridResourceAttributeKeys; import com.refinedmods.refinedstorage2.platform.api.grid.GridScrollMode; @@ -26,7 +27,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -public class ItemGridResource extends AbstractGridResource { +public class ItemGridResource extends AbstractPlatformGridResource { private final int id; private final ItemStack itemStack; From b4c69aff7da55d9353ace131e4ff1e22aa95d814 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 11:41:31 +0200 Subject: [PATCH 08/12] refactor: allow upgrade destinations access in API --- .../platform/api/PlatformApi.java | 3 ++ .../platform/api/PlatformApiProxy.java | 6 ++++ .../upgrade/BuiltinUpgradeDestinations.java | 16 ++++++++++ .../platform/common/PlatformApiImpl.java | 8 +++++ .../BuiltinUpgradeDestinationsImpl.java | 31 +++++++++++++++++++ .../internal/upgrade/UpgradeDestinations.java | 1 - 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java create mode 100644 refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java index c00bcd513..f47607570 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApi.java @@ -30,6 +30,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import java.util.Collection; @@ -77,6 +78,8 @@ public interface PlatformApi { UpgradeRegistry getUpgradeRegistry(); + BuiltinUpgradeDestinations getBuiltinUpgradeDestinations(); + void requestNetworkNodeInitialization(NetworkNodeContainer container, Level level, Runnable callback); void requestNetworkNodeRemoval(NetworkNodeContainer container, Level level); diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java index 04d458d61..a379d5b8e 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/PlatformApiProxy.java @@ -30,6 +30,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import java.util.Collection; @@ -132,6 +133,11 @@ public UpgradeRegistry getUpgradeRegistry() { return ensureLoaded().getUpgradeRegistry(); } + @Override + public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { + return ensureLoaded().getBuiltinUpgradeDestinations(); + } + @Override public void requestNetworkNodeInitialization(final NetworkNodeContainer container, final Level level, diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java new file mode 100644 index 000000000..26ecda3d4 --- /dev/null +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/upgrade/BuiltinUpgradeDestinations.java @@ -0,0 +1,16 @@ +package com.refinedmods.refinedstorage2.platform.api.upgrade; + +import org.apiguardian.api.API; + +@API(status = API.Status.STABLE, since = "2.0.0-milestone.3.0") +public interface BuiltinUpgradeDestinations { + UpgradeDestination getImporter(); + + UpgradeDestination getExporter(); + + UpgradeDestination getDestructor(); + + UpgradeDestination getConstructor(); + + UpgradeDestination getWirelessTransmitter(); +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java index cf6836fa7..2a61e639c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/PlatformApiImpl.java @@ -34,6 +34,7 @@ import com.refinedmods.refinedstorage2.platform.api.storage.StorageRepository; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.storage.type.StorageType; +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeRegistry; import com.refinedmods.refinedstorage2.platform.common.block.entity.wirelesstransmitter.CompositeWirelessTransmitterRangeModifier; import com.refinedmods.refinedstorage2.platform.common.integration.recipemod.CompositeIngredientConverter; @@ -50,6 +51,7 @@ import com.refinedmods.refinedstorage2.platform.common.internal.storage.StorageRepositoryImpl; import com.refinedmods.refinedstorage2.platform.common.internal.storage.channel.StorageChannelTypes; import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.StorageTypes; +import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.BuiltinUpgradeDestinationsImpl; import com.refinedmods.refinedstorage2.platform.common.internal.upgrade.UpgradeRegistryImpl; import com.refinedmods.refinedstorage2.platform.common.screen.grid.hint.GridInsertionHintsImpl; import com.refinedmods.refinedstorage2.platform.common.screen.grid.hint.ItemGridInsertionHint; @@ -100,6 +102,7 @@ public class PlatformApiImpl implements PlatformApi { new PlatformRegistryImpl<>(createIdentifier("noop"), (level, pos, direction, upgradeState, amountOverride, fuzzyMode) -> (resource, actor, network) -> false); private final UpgradeRegistry upgradeRegistry = new UpgradeRegistryImpl(); + private final BuiltinUpgradeDestinations builtinUpgradeDestinations = new BuiltinUpgradeDestinationsImpl(); private final Queue externalStorageProviderFactories = new PriorityQueue<>( Comparator.comparingInt(PlatformExternalStorageProviderFactory::getPriority) ); @@ -225,6 +228,11 @@ public UpgradeRegistry getUpgradeRegistry() { return upgradeRegistry; } + @Override + public BuiltinUpgradeDestinations getBuiltinUpgradeDestinations() { + return builtinUpgradeDestinations; + } + @Override public void requestNetworkNodeInitialization(final NetworkNodeContainer container, final Level level, diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java new file mode 100644 index 000000000..9da555b11 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/BuiltinUpgradeDestinationsImpl.java @@ -0,0 +1,31 @@ +package com.refinedmods.refinedstorage2.platform.common.internal.upgrade; + +import com.refinedmods.refinedstorage2.platform.api.upgrade.BuiltinUpgradeDestinations; +import com.refinedmods.refinedstorage2.platform.api.upgrade.UpgradeDestination; + +public class BuiltinUpgradeDestinationsImpl implements BuiltinUpgradeDestinations { + @Override + public UpgradeDestination getImporter() { + return UpgradeDestinations.IMPORTER; + } + + @Override + public UpgradeDestination getExporter() { + return UpgradeDestinations.EXPORTER; + } + + @Override + public UpgradeDestination getDestructor() { + return UpgradeDestinations.DESTRUCTOR; + } + + @Override + public UpgradeDestination getConstructor() { + return UpgradeDestinations.CONSTRUCTOR; + } + + @Override + public UpgradeDestination getWirelessTransmitter() { + return UpgradeDestinations.WIRELESS_TRANSMITTER; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java index 9f1fe766a..0058a6aa9 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/internal/upgrade/UpgradeDestinations.java @@ -10,7 +10,6 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; -// TODO: Move to api public enum UpgradeDestinations implements UpgradeDestination { IMPORTER(ContentNames.IMPORTER, () -> new ItemStack(Items.INSTANCE.getImporters().get(0).get())), EXPORTER(ContentNames.EXPORTER, () -> new ItemStack(Items.INSTANCE.getExporters().get(0).get())), From 3e86d5547c1d197010fb0e00199b1bd696df6229 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 12:04:14 +0200 Subject: [PATCH 09/12] fix: emissive wireless transmitter models on fabric --- .../platform/fabric/ClientModInitializerImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java index 86b2b2556..b957ea0ea 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java @@ -211,10 +211,13 @@ private void registerEmissiveWirelessTransmitterModels(final DyeColor color, fin // Block EmissiveModelRegistry.INSTANCE.register( createIdentifier("block/wireless_transmitter/" + color.getName()), - createIdentifier("block/wireless_transmitter/cutouts/active") + createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()) ); // Item - EmissiveModelRegistry.INSTANCE.register(id, createIdentifier("block/wireless_transmitter/cutouts/active")); + EmissiveModelRegistry.INSTANCE.register( + id, + createIdentifier("block/wireless_transmitter/cutouts/" + color.getName()) + ); } private void registerPackets() { From a6e43fd8ac3d14b832d638d0362ebd156ddf9fcc Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 12:05:17 +0200 Subject: [PATCH 10/12] fix: nearly on/off Controller model not being rendered correctly on Forge --- CHANGELOG.md | 1 + .../assets/refinedstorage2/models/block/controller/nearly.json | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 186e3c5e9..8209de56d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed inactive Grid slots still rendering resources. - Fixed being able to interact with inactive Grid. +- Fixed nearly on/off Controller model not being rendered correctly on Forge. ## [2.0.0-milestone.2.14] - 2023-08-19 diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json index d8525b1a0..2f98b8b0e 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/models/block/controller/nearly.json @@ -1,4 +1,5 @@ { + "render_type": "cutout", "parent": "block/cube", "elements": [ { From 3ee3ea6324ddb80007ec9929fa9e9cff4380d9de Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 12:05:36 +0200 Subject: [PATCH 11/12] fix: controller energy tooltip not working --- CHANGELOG.md | 1 + .../common/item/block/ControllerBlockItem.java | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8209de56d..e091f69fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Fixed inactive Grid slots still rendering resources. - Fixed being able to interact with inactive Grid. - Fixed nearly on/off Controller model not being rendered correctly on Forge. +- Fixed Controller energy tooltip not working. ## [2.0.0-milestone.2.14] - 2023-08-19 diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java index 30ccac062..0c6b6598d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java @@ -1,7 +1,6 @@ package com.refinedmods.refinedstorage2.platform.common.item.block; import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; -import com.refinedmods.refinedstorage2.platform.api.util.AmountFormatting; import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; import java.util.List; @@ -18,6 +17,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createStoredWithCapacityTranslation; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; // TODO: Fully charged in creative tabs @@ -69,12 +69,8 @@ public void appendHoverText(final ItemStack stack, if (ControllerBlockEntity.hasEnergy(data)) { final long stored = ControllerBlockEntity.getStored(data); final long capacity = ControllerBlockEntity.getCapacity(data); - tooltip.add(createTranslation( - "misc", - "stored_with_capacity", - AmountFormatting.format(stored), - AmountFormatting.format(capacity) - ).withStyle(ChatFormatting.GRAY)); + tooltip.add(createStoredWithCapacityTranslation(stored, capacity, getPercentFull(stack)) + .withStyle(ChatFormatting.GRAY)); } } } From 64d5a92f1cf7076349fb75881c4d650252685470 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 27 Aug 2023 13:14:29 +0200 Subject: [PATCH 12/12] feat: fully charged controller variants to creative tabs --- CHANGELOG.md | 1 + config/checkstyle/checkstyle-suppressions.xml | 4 ++-- .../common/AbstractModInitializer.java | 4 ++-- .../block/entity/ControllerBlockEntity.java | 8 +++++++ .../common/content/CreativeModeTabItems.java | 5 +++- .../platform/common/content/Items.java | 21 ++++++++-------- .../item/block/ControllerBlockItem.java | 24 ++++++++++++++++++- .../assets/refinedstorage2/lang/en_us.json | 1 + .../fabric/ClientModInitializerImpl.java | 2 +- .../rei/RefinedStorageREIClientPlugin.java | 20 ++++++++++++++++ .../s2c/ServerToClientCommunicationsImpl.java | 2 +- .../platform/forge/ClientModInitializer.java | 2 +- .../forge/datagen/tag/ItemTagGenerator.java | 2 +- .../rei/RefinedStorageREIClientPlugin.java | 11 +++++++++ 14 files changed, 86 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e091f69fc..bf783ec17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Wireless Transmitter - Range Upgrade - Creative Range Upgrade +- Fully charged Controller variants to the creative mode tab. ### Changed diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml index c5a308304..b0d870283 100644 --- a/config/checkstyle/checkstyle-suppressions.xml +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -5,8 +5,8 @@ - - + + diff --git a/refinedstorage2-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 f253fe2b5..56e152038 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java @@ -261,8 +261,8 @@ protected final void registerItems( Blocks.INSTANCE.getGrid().registerItems(callback); Blocks.INSTANCE.getCraftingGrid().registerItems(callback); Blocks.INSTANCE.getCable().registerItems(callback, Items.INSTANCE::addCable); - Blocks.INSTANCE.getController().registerItems(callback, Items.INSTANCE::addRegularController); - Blocks.INSTANCE.getCreativeController().registerItems(callback, Items.INSTANCE::addController); + Blocks.INSTANCE.getController().registerItems(callback, Items.INSTANCE::addController); + Blocks.INSTANCE.getCreativeController().registerItems(callback, Items.INSTANCE::addCreativeController); Blocks.INSTANCE.getDetector().registerItems(callback, Items.INSTANCE::addDetector); Blocks.INSTANCE.getImporter().registerItems(callback, Items.INSTANCE::addImporter); Blocks.INSTANCE.getExporter().registerItems(callback, Items.INSTANCE::addExporter); diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java index fd93ccb1d..609795f5d 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/block/entity/ControllerBlockEntity.java @@ -56,10 +56,18 @@ public static long getStored(final CompoundTag tag) { return tag.contains(TAG_STORED) ? tag.getLong(TAG_STORED) : 0; } + public static void setStored(final CompoundTag tag, final long stored) { + tag.putLong(TAG_STORED, stored); + } + public static long getCapacity(final CompoundTag tag) { return tag.contains(TAG_CAPACITY) ? tag.getLong(TAG_CAPACITY) : 0; } + public static void setCapacity(final CompoundTag tag, final long capacity) { + tag.putLong(TAG_CAPACITY, capacity); + } + public static boolean hasEnergy(@Nullable final CompoundTag tag) { return tag != null && tag.contains(TAG_STORED) && tag.contains(TAG_CAPACITY); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java index b665771f0..44508cd5b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java @@ -4,6 +4,7 @@ import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.internal.storage.type.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.item.ProcessorItem; +import com.refinedmods.refinedstorage2.platform.common.item.block.ControllerBlockItem; import java.util.Arrays; import java.util.function.Consumer; @@ -23,7 +24,9 @@ public static void append(final Consumer consumer) { private static void appendBlocks(final Consumer consumer) { final Consumer itemConsumer = item -> consumer.accept(new ItemStack(item)); - Items.INSTANCE.getAllControllers().stream().map(Supplier::get).forEach(itemConsumer); + Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(itemConsumer); + ControllerBlockItem.getAllAtCapacity().forEach(consumer); + Items.INSTANCE.getCreativeControllers().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getCables().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getImporters().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getExporters().stream().map(Supplier::get).forEach(itemConsumer); 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 8b6207543..6734b231a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java @@ -29,8 +29,8 @@ public final class Items { = new EnumMap<>(ItemStorageType.Variant.class); private final Map> fluidStorageDisks = new EnumMap<>(FluidStorageType.Variant.class); - private final List> regularControllers = new ArrayList<>(); - private final List> allControllers = new ArrayList<>(); + private final List> allControllers = new ArrayList<>(); + private final List> allCreativeControllers = new ArrayList<>(); private final List> allCables = new ArrayList<>(); private final List> allExporters = new ArrayList<>(); private final List> allImporters = new ArrayList<>(); @@ -170,21 +170,20 @@ public Item getDestructionCore() { return Objects.requireNonNull(destructionCore).get(); } - public void addController(final Supplier supplier) { - allControllers.add(supplier); + public void addCreativeController(final Supplier supplier) { + allCreativeControllers.add(supplier); } - public List> getAllControllers() { - return Collections.unmodifiableList(allControllers); + public List> getCreativeControllers() { + return Collections.unmodifiableList(allCreativeControllers); } - public void addRegularController(final Supplier supplier) { - addController(supplier); - regularControllers.add(supplier); + public void addController(final Supplier supplier) { + allControllers.add(supplier); } - public List> getRegularControllers() { - return Collections.unmodifiableList(regularControllers); + public List> getControllers() { + return Collections.unmodifiableList(allControllers); } public void addCable(final Supplier supplier) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java index 0c6b6598d..25e4f4e15 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/item/block/ControllerBlockItem.java @@ -1,10 +1,15 @@ package com.refinedmods.refinedstorage2.platform.common.item.block; import com.refinedmods.refinedstorage2.platform.api.item.HelpTooltipComponent; +import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.block.entity.ControllerBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.Items; import java.util.List; import java.util.Optional; +import java.util.function.Supplier; +import java.util.stream.Stream; import javax.annotation.Nullable; import net.minecraft.ChatFormatting; @@ -20,7 +25,6 @@ import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createStoredWithCapacityTranslation; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; -// TODO: Fully charged in creative tabs public class ControllerBlockItem extends CreativeControllerBlockItem { public ControllerBlockItem(final Block block, final Component displayName) { super(block, displayName); @@ -39,6 +43,24 @@ public static float getPercentFull(final ItemStack stack) { return (float) stored / (float) capacity; } + public ItemStack getAtCapacity() { + final long capacity = Platform.INSTANCE.getConfig().getController().getEnergyCapacity(); + final ItemStack result = new ItemStack(this); + final CompoundTag blockEntityData = new CompoundTag(); + ControllerBlockEntity.setStored(blockEntityData, capacity); + ControllerBlockEntity.setCapacity(blockEntityData, capacity); + setBlockEntityData(result, BlockEntities.INSTANCE.getController(), blockEntityData); + return result; + } + + public static Stream getAllAtCapacity() { + return Items.INSTANCE.getControllers().stream() + .map(Supplier::get) + .filter(ControllerBlockItem.class::isInstance) + .map(ControllerBlockItem.class::cast) + .map(ControllerBlockItem::getAtCapacity); + } + @Override public Optional getTooltipImage(final ItemStack stack) { return Optional.of(new HelpTooltipComponent(createTranslation("item", "controller.help"))); 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 8e52e819d..5242626a9 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json @@ -7,6 +7,7 @@ "block.refinedstorage2.grid": "Grid", "block.refinedstorage2.crafting_grid": "Crafting Grid", "block.refinedstorage2.controller": "Controller", + "block.refinedstorage2.controller.rei_fully_charged": "Fully charged Controller", "block.refinedstorage2.creative_controller": "Creative Controller", "block.refinedstorage2.1k_storage_block": "1K Storage Block", "block.refinedstorage2.4k_storage_block": "4K Storage Block", diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java index b957ea0ea..50e9fbff1 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java @@ -290,7 +290,7 @@ private void registerKeyBindings() { } private void registerModelPredicates() { - Items.INSTANCE.getRegularControllers().forEach(controllerBlockItem -> ItemPropertiesAccessor.register( + Items.INSTANCE.getControllers().forEach(controllerBlockItem -> ItemPropertiesAccessor.register( controllerBlockItem.get(), createIdentifier("stored_in_controller"), new ControllerModelPredicateProvider() diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java index 46c3e4e7c..16c174845 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/integration/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -6,15 +6,22 @@ import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.ContentIds; +import com.refinedmods.refinedstorage2.platform.common.content.Items; import com.refinedmods.refinedstorage2.platform.common.content.Tags; +import com.refinedmods.refinedstorage2.platform.common.item.block.ControllerBlockItem; import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import java.util.function.Supplier; +import java.util.stream.Collectors; + import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.CollapsibleEntryRegistry; import me.shedaniel.rei.api.client.registry.screen.ExclusionZones; import me.shedaniel.rei.api.client.registry.screen.ScreenRegistry; import me.shedaniel.rei.api.client.registry.transfer.TransferHandlerRegistry; +import me.shedaniel.rei.api.common.entry.comparison.ItemComparatorRegistry; import me.shedaniel.rei.api.common.util.EntryIngredients; +import me.shedaniel.rei.api.common.util.EntryStacks; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.resources.ResourceLocation; @@ -22,6 +29,9 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + @Environment(EnvType.CLIENT) public class RefinedStorageREIClientPlugin implements REIClientPlugin { @Override @@ -42,6 +52,11 @@ public static void registerIngredientConverters() { PlatformApi.INSTANCE.registerIngredientConverter(new ResourceIngredientConverter()); } + @Override + public void registerItemComparators(final ItemComparatorRegistry registry) { + Items.INSTANCE.getControllers().stream().map(Supplier::get).forEach(registry::registerNbt); + } + @SuppressWarnings("UnstableApiUsage") @Override public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) { @@ -55,6 +70,11 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS); groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES); groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS); + registry.group( + createIdentifier("fully_charged_controller"), + createTranslation("block", "controller.rei_fully_charged"), + ControllerBlockItem.getAllAtCapacity().map(EntryStacks::of).collect(Collectors.toList()) + ); groupItems( registry, Blocks.INSTANCE.getCreativeController(), 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 f24a23c1c..cdb516b4e 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java @@ -29,7 +29,7 @@ public void sendControllerEnergyInfo(final ServerPlayer player, final long store } @Override - public void sendWirelessTransmitterRange(final ServerPlayer player, int range) { + public void sendWirelessTransmitterRange(final ServerPlayer player, final int range) { sendToPlayer(player, PacketIds.WIRELESS_TRANSMITTER_RANGE, buf -> buf.writeInt(range)); } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java index a445c4e4f..68ce41a57 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ClientModInitializer.java @@ -76,7 +76,7 @@ public > void } private static void registerModelPredicates() { - Items.INSTANCE.getRegularControllers().forEach(controllerBlockItem -> ItemProperties.register( + Items.INSTANCE.getControllers().forEach(controllerBlockItem -> ItemProperties.register( controllerBlockItem.get(), createIdentifier("stored_in_controller"), new ControllerModelPredicateProvider() diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java index 7153eb09e..7cd840ee3 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java @@ -46,7 +46,7 @@ public ItemTagGenerator(final PackOutput packOutput, @Override protected void addTags(final HolderLookup.Provider provider) { addAllToTag(CABLES, Items.INSTANCE.getCables()); - addAllToTag(CONTROLLERS, Items.INSTANCE.getRegularControllers()); + addAllToTag(CONTROLLERS, Items.INSTANCE.getControllers()); addAllToTag(CREATIVE_CONTROLLERS, Blocks.INSTANCE.getCreativeController().values().stream() .map(Block::asItem) .map(c -> (Supplier) () -> c) diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java index 9f29097bb..345c25822 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/integration/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -7,8 +7,11 @@ import com.refinedmods.refinedstorage2.platform.common.content.Blocks; import com.refinedmods.refinedstorage2.platform.common.content.ContentIds; import com.refinedmods.refinedstorage2.platform.common.content.Tags; +import com.refinedmods.refinedstorage2.platform.common.item.block.ControllerBlockItem; import com.refinedmods.refinedstorage2.platform.common.screen.AbstractBaseScreen; +import java.util.stream.Collectors; + import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.CollapsibleEntryRegistry; import me.shedaniel.rei.api.client.registry.screen.ExclusionZones; @@ -21,6 +24,9 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + @REIPluginClient public class RefinedStorageREIClientPlugin implements REIClientPlugin { @Override @@ -54,6 +60,11 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) groupItems(registry, Blocks.INSTANCE.getConstructor(), ContentIds.CONSTRUCTOR, Tags.CONSTRUCTORS); groupItems(registry, Blocks.INSTANCE.getExternalStorage(), ContentIds.EXTERNAL_STORAGE, Tags.EXTERNAL_STORAGES); groupItems(registry, Blocks.INSTANCE.getController(), ContentIds.CONTROLLER, Tags.CONTROLLERS); + registry.group( + createIdentifier("fully_charged_controller"), + createTranslation("block", "controller.rei_fully_charged"), + EntryIngredients.ofItemStacks(ControllerBlockItem.getAllAtCapacity().collect(Collectors.toSet())) + ); groupItems( registry, Blocks.INSTANCE.getCreativeController(),