diff --git a/CHANGELOG.md b/CHANGELOG.md index d65be6e46..28a9b5fd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Configuration Card. It copies device configurations and can transfer upgrades. - Network Receiver - Network Card +- Network Transmitter + +### Changed + +- The Network Transmitter now goes into an "errored" state if there is no connection (anymore) with the Network Receiver (due to chunk unloading for example). +- The Network Transmitter will actively try to reconnect with the Network Receiver if connection is lost. ### Fixed diff --git a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java index e7baa0690..b8094e38f 100644 --- a/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java +++ b/refinedstorage2-platform-api/src/main/java/com/refinedmods/refinedstorage2/platform/api/support/network/ConnectionSink.java @@ -2,10 +2,12 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.GlobalPos; import org.apiguardian.api.API; @API(status = API.Status.STABLE, since = "2.0.0-milestone.3.2") -@FunctionalInterface public interface ConnectionSink { + void tryConnect(GlobalPos pos); + void tryConnectInSameDimension(BlockPos pos, Direction incomingDirection); } diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json new file mode 100644 index 000000000..c85efd707 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/black_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/black" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json new file mode 100644 index 000000000..26d0a4788 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/blue_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/blue" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json new file mode 100644 index 000000000..7308e85d6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/brown_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/brown" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json new file mode 100644 index 000000000..7c93cab21 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/cyan_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/cyan" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json new file mode 100644 index 000000000..004f915c9 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/gray_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/gray" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json new file mode 100644 index 000000000..ed8ae4451 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/green_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/green" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json new file mode 100644 index 000000000..6bef823bb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/light_gray_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/light_gray" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json new file mode 100644 index 000000000..6962c78ff --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/lime_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/lime" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json new file mode 100644 index 000000000..a9cfe5a30 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/magenta_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/magenta" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json new file mode 100644 index 000000000..49484a53f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/light_blue" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json new file mode 100644 index 000000000..46030998b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/orange_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/orange" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json new file mode 100644 index 000000000..5c7009994 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/pink_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/pink" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json new file mode 100644 index 000000000..d1def1e5b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/purple_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/purple" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json new file mode 100644 index 000000000..efaf94767 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/red_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/red" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json new file mode 100644 index 000000000..3019869df --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/white_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/white" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json new file mode 100644 index 000000000..e18ebc477 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/blockstates/yellow_network_transmitter.json @@ -0,0 +1,13 @@ +{ + "variants": { + "state=active": { + "model": "refinedstorage2:block/network_transmitter/yellow" + }, + "state=error": { + "model": "refinedstorage2:block/network_transmitter/error" + }, + "state=inactive": { + "model": "refinedstorage2:block/network_transmitter/inactive" + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json new file mode 100644 index 000000000..0f8886928 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/black.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/black", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json new file mode 100644 index 000000000..6ce433dea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/blue", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json new file mode 100644 index 000000000..d59d72fe1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/brown.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/brown", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json new file mode 100644 index 000000000..edb07ae19 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/cyan.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/cyan", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json new file mode 100644 index 000000000..bde24ffc1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/error.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/error", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json new file mode 100644 index 000000000..e2a9d7adb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/gray", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json new file mode 100644 index 000000000..2a02cc52e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/green.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/green", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json new file mode 100644 index 000000000..3d57239b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/inactive.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/inactive", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json new file mode 100644 index 000000000..af0723908 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_blue.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_blue", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json new file mode 100644 index 000000000..b6c0f2ad4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/light_gray.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_gray", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json new file mode 100644 index 000000000..40dcbaff2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/lime.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/lime", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json new file mode 100644 index 000000000..6026f8131 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/magenta.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/magenta", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json new file mode 100644 index 000000000..4a982bb88 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/orange.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/orange", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json new file mode 100644 index 000000000..6789f6949 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/pink.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/pink", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json new file mode 100644 index 000000000..7963ee4fc --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/purple.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/purple", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json new file mode 100644 index 000000000..47c6d2a06 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/red.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/red", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json new file mode 100644 index 000000000..c534f78e2 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/white.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/white", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json new file mode 100644 index 000000000..3054b74fd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/block/network_transmitter/yellow.json @@ -0,0 +1,8 @@ +{ + "parent": "refinedstorage2:block/emissive_all_cutout", + "textures": { + "all": "refinedstorage2:block/network_transmitter/base", + "cutout": "refinedstorage2:block/network_transmitter/cutouts/yellow", + "particle": "refinedstorage2:block/network_transmitter/base" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json new file mode 100644 index 000000000..8a95bdad0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/black_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/black" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json new file mode 100644 index 000000000..5d4bcba6f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/blue_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json new file mode 100644 index 000000000..b4b236ff4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/brown_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/brown" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json new file mode 100644 index 000000000..b6d2d901e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/cyan_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/cyan" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json new file mode 100644 index 000000000..044b5ed1e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/gray_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json new file mode 100644 index 000000000..7def81806 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/green_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/green" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json new file mode 100644 index 000000000..79961be77 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/light_gray_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_gray" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json new file mode 100644 index 000000000..d82a2cba6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/lime_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/lime" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json new file mode 100644 index 000000000..f3f93d427 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/magenta_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/magenta" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json new file mode 100644 index 000000000..a81a65c0f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/light_blue" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json new file mode 100644 index 000000000..5272d4ab9 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/orange_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/orange" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json new file mode 100644 index 000000000..d78d47f94 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/pink_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/pink" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json new file mode 100644 index 000000000..ddad1fd12 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/purple_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/purple" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json new file mode 100644 index 000000000..969a2ee85 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/red_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/red" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json new file mode 100644 index 000000000..8596e093f --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/white_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/white" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json new file mode 100644 index 000000000..6c4c3dcfd --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/assets/refinedstorage2/models/item/yellow_network_transmitter.json @@ -0,0 +1,6 @@ +{ + "parent": "refinedstorage2:block/network_transmitter/inactive", + "textures": { + "cutout": "refinedstorage2:block/network_transmitter/cutouts/yellow" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json new file mode 100644 index 000000000..d62881c05 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/black_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/black_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/black_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json new file mode 100644 index 000000000..5fb93f8d0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/blue_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/blue_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/blue_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json new file mode 100644 index 000000000..f8472f93e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/brown_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/brown_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/brown_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json new file mode 100644 index 000000000..212262dfe --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/cyan_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/cyan_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/cyan_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json new file mode 100644 index 000000000..003794319 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/gray_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/gray_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/gray_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json new file mode 100644 index 000000000..5944c16a4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/green_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/green_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/green_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json new file mode 100644 index 000000000..f194d254d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_blue_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_blue_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_blue_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json new file mode 100644 index 000000000..691df5431 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/light_gray_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/light_gray_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/light_gray_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json new file mode 100644 index 000000000..27e675c29 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/lime_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/lime_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/lime_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json new file mode 100644 index 000000000..6cdba8303 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/magenta_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/magenta_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/magenta_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json new file mode 100644 index 000000000..bcf7a5a24 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/orange_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/orange_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/orange_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json new file mode 100644 index 000000000..cbb5dbab7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/pink_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/pink_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/pink_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json new file mode 100644 index 000000000..aba85fa45 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/purple_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/purple_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/purple_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json new file mode 100644 index 000000000..178e31944 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/red_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/red_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/red_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json new file mode 100644 index 000000000..e173f3582 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/white_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/white_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/white_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json new file mode 100644 index 000000000..68a1b2078 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/advancements/recipes/misc/coloring/yellow_network_transmitter.json @@ -0,0 +1,33 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_network_transmitters": { + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "refinedstorage2:coloring/yellow_network_transmitter" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_network_transmitters", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "refinedstorage2:coloring/yellow_network_transmitter" + ] + }, + "sends_telemetry_event": false +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json new file mode 100644 index 000000000..f925deda4 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/black_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:black_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/black_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json new file mode 100644 index 000000000..44656ecfa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/blue_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:blue_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/blue_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json new file mode 100644 index 000000000..4e548e328 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/brown_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:brown_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/brown_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json new file mode 100644 index 000000000..f92f09225 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/cyan_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:cyan_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/cyan_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json new file mode 100644 index 000000000..b4ad2b8f3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/gray_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:gray_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/gray_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json new file mode 100644 index 000000000..954149bde --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/green_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:green_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/green_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json new file mode 100644 index 000000000..48e4801ea --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/light_gray_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:light_gray_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/light_gray_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json new file mode 100644 index 000000000..eed497cfa --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/lime_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:lime_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/lime_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json new file mode 100644 index 000000000..15777c802 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/magenta_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:magenta_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/magenta_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json new file mode 100644 index 000000000..80d86c15b --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json new file mode 100644 index 000000000..5bab22f68 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/orange_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:orange_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/orange_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json new file mode 100644 index 000000000..70c0580c8 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/pink_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:pink_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/pink_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json new file mode 100644 index 000000000..71e632a40 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/purple_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:purple_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/purple_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json new file mode 100644 index 000000000..d891359c3 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/red_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:red_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/red_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json new file mode 100644 index 000000000..4c1bdc48a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/white_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:white_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/white_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json new file mode 100644 index 000000000..14549c329 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/loot_tables/blocks/yellow_network_transmitter.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "refinedstorage2:yellow_network_transmitter" + } + ], + "rolls": 1.0 + } + ], + "random_sequence": "refinedstorage2:blocks/yellow_network_transmitter" +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json new file mode 100644 index 000000000..36b859db6 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/black_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:black_dye" + } + ], + "result": { + "item": "refinedstorage2:black_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json new file mode 100644 index 000000000..a4e2bd0a0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/blue_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:blue_dye" + } + ], + "result": { + "item": "refinedstorage2:blue_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json new file mode 100644 index 000000000..e7c68912d --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/brown_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:brown_dye" + } + ], + "result": { + "item": "refinedstorage2:brown_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json new file mode 100644 index 000000000..f84a9cfba --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/cyan_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:cyan_dye" + } + ], + "result": { + "item": "refinedstorage2:cyan_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json new file mode 100644 index 000000000..70a07df91 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/gray_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:gray_dye" + } + ], + "result": { + "item": "refinedstorage2:gray_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json new file mode 100644 index 000000000..df1b74eb0 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/green_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:green_dye" + } + ], + "result": { + "item": "refinedstorage2:green_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json new file mode 100644 index 000000000..b1479d3a7 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_blue_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:light_blue_dye" + } + ], + "result": { + "item": "refinedstorage2:network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json new file mode 100644 index 000000000..f47ee6865 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/light_gray_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:light_gray_dye" + } + ], + "result": { + "item": "refinedstorage2:light_gray_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json new file mode 100644 index 000000000..695ac7837 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/lime_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:lime_dye" + } + ], + "result": { + "item": "refinedstorage2:lime_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json new file mode 100644 index 000000000..83e87448e --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/magenta_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:magenta_dye" + } + ], + "result": { + "item": "refinedstorage2:magenta_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json new file mode 100644 index 000000000..2a883881c --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/orange_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:orange_dye" + } + ], + "result": { + "item": "refinedstorage2:orange_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json new file mode 100644 index 000000000..45cca06c1 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/pink_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:pink_dye" + } + ], + "result": { + "item": "refinedstorage2:pink_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json new file mode 100644 index 000000000..936c7bb9a --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/purple_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:purple_dye" + } + ], + "result": { + "item": "refinedstorage2:purple_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json new file mode 100644 index 000000000..c0640bffb --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/red_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:red_dye" + } + ], + "result": { + "item": "refinedstorage2:red_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json new file mode 100644 index 000000000..c793b5352 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/white_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:white_dye" + } + ], + "result": { + "item": "refinedstorage2:white_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json new file mode 100644 index 000000000..6b0da48b5 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/recipes/coloring/yellow_network_transmitter.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "item": "minecraft:yellow_dye" + } + ], + "result": { + "item": "refinedstorage2:yellow_network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json new file mode 100644 index 000000000..5e6f46c32 --- /dev/null +++ b/refinedstorage2-platform-common/src/generated/resources/data/refinedstorage2/tags/items/network_transmitters.json @@ -0,0 +1,20 @@ +{ + "values": [ + "refinedstorage2:white_network_transmitter", + "refinedstorage2:orange_network_transmitter", + "refinedstorage2:magenta_network_transmitter", + "refinedstorage2:network_transmitter", + "refinedstorage2:yellow_network_transmitter", + "refinedstorage2:lime_network_transmitter", + "refinedstorage2:pink_network_transmitter", + "refinedstorage2:gray_network_transmitter", + "refinedstorage2:light_gray_network_transmitter", + "refinedstorage2:cyan_network_transmitter", + "refinedstorage2:purple_network_transmitter", + "refinedstorage2:blue_network_transmitter", + "refinedstorage2:brown_network_transmitter", + "refinedstorage2:green_network_transmitter", + "refinedstorage2:red_network_transmitter", + "refinedstorage2:black_network_transmitter" + ] +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java index 0e872f7cb..1cbb0567b 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractClientModInitializer.java @@ -18,6 +18,7 @@ import com.refinedmods.refinedstorage2.platform.common.grid.screen.hint.FluidGridInsertionHint; import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceScreen; import com.refinedmods.refinedstorage2.platform.common.importer.ImporterScreen; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterScreen; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveScreen; import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageScreen; import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockScreen; @@ -57,6 +58,7 @@ protected static void registerScreens(final ScreenRegistration registration) { registration.register(Menus.INSTANCE.getRegulatorUpgrade(), RegulatorUpgradeScreen::new); registration.register(Menus.INSTANCE.getWirelessTransmitter(), WirelessTransmitterScreen::new); registration.register(Menus.INSTANCE.getStorageMonitor(), StorageMonitorScreen::new); + registration.register(Menus.INSTANCE.getNetworkTransmitter(), NetworkTransmitterScreen::new); } protected static void registerAlternativeGridHints() { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java index 2a48a9695..a7db7f229 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/AbstractModInitializer.java @@ -52,6 +52,9 @@ import com.refinedmods.refinedstorage2.platform.common.misc.ProcessorItem; import com.refinedmods.refinedstorage2.platform.common.misc.WrenchItem; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkCardItem; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.StorageTypes; @@ -133,6 +136,7 @@ import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.ITEM_STORAGE_BLOCK; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.MACHINE_CASING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.NETWORK_RECEIVER; +import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.NETWORK_TRANSMITTER; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.PROCESSOR_BINDING; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON; import static com.refinedmods.refinedstorage2.platform.common.content.ContentIds.QUARTZ_ENRICHED_IRON_BLOCK; @@ -274,6 +278,7 @@ protected final void registerBlocks( Blocks.INSTANCE.getWirelessTransmitter().registerBlocks(callback); Blocks.INSTANCE.setStorageMonitor(callback.register(STORAGE_MONITOR, StorageMonitorBlock::new)); Blocks.INSTANCE.getNetworkReceiver().registerBlocks(callback); + Blocks.INSTANCE.getNetworkTransmitter().registerBlocks(callback); } protected final void registerItems( @@ -296,6 +301,7 @@ protected final void registerItems( Blocks.INSTANCE.getDestructor().registerItems(callback, Items.INSTANCE::addDestructor); Blocks.INSTANCE.getWirelessTransmitter().registerItems(callback, Items.INSTANCE::addWirelessTransmitter); Blocks.INSTANCE.getNetworkReceiver().registerItems(callback, Items.INSTANCE::addNetworkReceiver); + Blocks.INSTANCE.getNetworkTransmitter().registerItems(callback, Items.INSTANCE::addNetworkTransmitter); registerStorageItems(callback); registerUpgrades(callback, regulatorUpgradeItemSupplier); Items.INSTANCE.setWirelessGrid(callback.register(WIRELESS_GRID, wirelessGridItemSupplier)); @@ -573,12 +579,14 @@ protected final void registerBlockEntities( )); BlockEntities.INSTANCE.setNetworkReceiver(callback.register( NETWORK_RECEIVER, - () -> typeFactory.create((pos, state) -> new NetworkNodeContainerBlockEntityImpl<>( - BlockEntities.INSTANCE.getNetworkReceiver(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) - ), Blocks.INSTANCE.getNetworkReceiver().toArray()) + () -> typeFactory.create(NetworkReceiverBlockEntity::new, Blocks.INSTANCE.getNetworkReceiver().toArray()) + )); + BlockEntities.INSTANCE.setNetworkTransmitter(callback.register( + NETWORK_TRANSMITTER, + () -> typeFactory.create( + NetworkTransmitterBlockEntity::new, + Blocks.INSTANCE.getNetworkTransmitter().toArray() + ) )); } @@ -652,6 +660,10 @@ protected final void registerMenus(final RegistryCallback> callback, STORAGE_MONITOR, () -> menuTypeFactory.create(StorageMonitorContainerMenu::new) )); + Menus.INSTANCE.setNetworkTransmitter(callback.register( + NETWORK_TRANSMITTER, + () -> menuTypeFactory.create(NetworkTransmitterContainerMenu::new) + )); } protected final void registerLootFunctions(final RegistryCallback callback) { diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java index 25635fec4..8e20884c5 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/Config.java @@ -48,6 +48,8 @@ public interface Config { SimpleEnergyUsageEntry getNetworkReceiver(); + SimpleEnergyUsageEntry getNetworkTransmitter(); + interface SimpleEnergyUsageEntry { long getEnergyUsage(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java index bdeba8d02..e6ba28b83 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/BlockEntities.java @@ -10,6 +10,8 @@ import com.refinedmods.refinedstorage2.platform.common.grid.GridBlockEntity; import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceBlockEntity; import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlockEntity; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlockEntity; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.AbstractDiskDriveBlockEntity; @@ -66,7 +68,9 @@ public final class BlockEntities { @Nullable private Supplier> storageMonitor; @Nullable - private Supplier>> networkReceiver; + private Supplier> networkReceiver; + @Nullable + private Supplier> networkTransmitter; private BlockEntities() { } @@ -211,13 +215,21 @@ public void setStorageMonitor(final Supplier> getNetworkReceiver() { + public BlockEntityType getNetworkReceiver() { return Objects.requireNonNull(networkReceiver).get(); } - public void setNetworkReceiver( - final Supplier>> supplier - ) { + public void setNetworkReceiver(final Supplier> supplier) { this.networkReceiver = supplier; } + + public BlockEntityType getNetworkTransmitter() { + return Objects.requireNonNull(networkTransmitter).get(); + } + + public void setNetworkTransmitter( + final Supplier> supplier + ) { + this.networkTransmitter = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java index d8c8ac8ea..a4697c046 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Blocks.java @@ -13,6 +13,7 @@ import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlock; import com.refinedmods.refinedstorage2.platform.common.networking.CableBlock; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.storage.FluidStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.ItemStorageType; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveBlock; @@ -124,6 +125,12 @@ public final class Blocks { ContentNames.NETWORK_RECEIVER, COLOR ); + private final BlockColorMap networkTransmitter = new BlockColorMap<>( + NetworkTransmitterBlock::new, + ContentIds.NETWORK_TRANSMITTER, + ContentNames.NETWORK_TRANSMITTER, + COLOR + ); @Nullable private Supplier quartzEnrichedIronBlock; @@ -251,4 +258,8 @@ public StorageMonitorBlock getStorageMonitor() { public BlockColorMap getNetworkReceiver() { return networkReceiver; } + + public BlockColorMap getNetworkTransmitter() { + return networkTransmitter; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java index 291f8bf78..60a9b1567 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentIds.java @@ -51,6 +51,7 @@ public final class ContentIds { public static final ResourceLocation CONFIGURATION_CARD = createIdentifier("configuration_card"); public static final ResourceLocation NETWORK_RECEIVER = createIdentifier("network_receiver"); public static final ResourceLocation NETWORK_CARD = createIdentifier("network_card"); + public static final ResourceLocation NETWORK_TRANSMITTER = createIdentifier("network_transmitter"); private ContentIds() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java index 32a2e65d8..f5a5b4e1a 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/ContentNames.java @@ -23,6 +23,7 @@ public final class ContentNames { public static final MutableComponent INTERFACE = createTranslation("block", "interface"); public static final MutableComponent DISK_DRIVE = createTranslation("block", "disk_drive"); public static final MutableComponent NETWORK_RECEIVER = createTranslation("block", "network_receiver"); + public static final MutableComponent NETWORK_TRANSMITTER = createTranslation("block", "network_transmitter"); private ContentNames() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java index 52ca3656b..cce630748 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/CreativeModeTabItems.java @@ -47,6 +47,7 @@ private static void appendBlocks(final Consumer consumer) { itemConsumer.accept(Blocks.INSTANCE.getMachineCasing()); itemConsumer.accept(Blocks.INSTANCE.getQuartzEnrichedIronBlock()); itemConsumer.accept(Blocks.INSTANCE.getStorageMonitor()); + Items.INSTANCE.getNetworkTransmitters().stream().map(Supplier::get).forEach(itemConsumer); Items.INSTANCE.getNetworkReceivers().stream().map(Supplier::get).forEach(itemConsumer); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java index 733a39e42..041f44474 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/DefaultEnergyUsage.java @@ -15,6 +15,7 @@ public final class DefaultEnergyUsage { public static final long DISK_DRIVE_PER_DISK = 4; public static final long STORAGE_MONITOR = 4; public static final long NETWORK_RECEIVER = 8; + public static final long NETWORK_TRANSMITTER = 32; public static final long CONTROLLER_CAPACITY = 1000; diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java index 13fca80df..019ed46b0 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Items.java @@ -40,6 +40,7 @@ public final class Items { private final List> allConstructors = new ArrayList<>(); private final List> allWirelessTransmitters = new ArrayList<>(); private final List> allNetworkReceivers = new ArrayList<>(); + private final List> allNetworkTransmitters = new ArrayList<>(); @Nullable private Supplier quartzEnrichedIron; @Nullable @@ -374,7 +375,15 @@ public void addNetworkReceiver(final Supplier supplier) { public List> getNetworkReceivers() { return Collections.unmodifiableList(allNetworkReceivers); } - + + public void addNetworkTransmitter(final Supplier supplier) { + allNetworkTransmitters.add(supplier); + } + + public List> getNetworkTransmitters() { + return Collections.unmodifiableList(allNetworkTransmitters); + } + public Item getNetworkCard() { return Objects.requireNonNull(networkCard).get(); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java index 4cc4029e7..901b772ec 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/MenuTypeFactory.java @@ -9,6 +9,7 @@ public interface MenuTypeFactory { MenuType create(MenuSupplier supplier); + @FunctionalInterface interface MenuSupplier { T create(int syncId, Inventory playerInventory, FriendlyByteBuf data); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java index c859f54f9..d737dcb21 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Menus.java @@ -10,6 +10,7 @@ import com.refinedmods.refinedstorage2.platform.common.grid.WirelessGridContainerMenu; import com.refinedmods.refinedstorage2.platform.common.iface.InterfaceContainerMenu; import com.refinedmods.refinedstorage2.platform.common.importer.ImporterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.diskdrive.DiskDriveContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageContainerMenu; import com.refinedmods.refinedstorage2.platform.common.storage.storageblock.FluidStorageBlockContainerMenu; @@ -61,6 +62,8 @@ public final class Menus { private Supplier> wirelessTransmitter; @Nullable private Supplier> storageMonitor; + @Nullable + private Supplier> networkTransmitter; private Menus() { } @@ -200,4 +203,12 @@ public MenuType getStorageMonitor() { public void setStorageMonitor(final Supplier> supplier) { this.storageMonitor = supplier; } + + public MenuType getNetworkTransmitter() { + return Objects.requireNonNull(networkTransmitter).get(); + } + + public void setNetworkTransmitter(final Supplier> supplier) { + this.networkTransmitter = supplier; + } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java index cc62023c7..be33cae1e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/content/Tags.java @@ -22,6 +22,7 @@ public final class Tags { public static final TagKey DESTRUCTORS = createTag("destructors"); public static final TagKey WIRELESS_TRANSMITTERS = createTag("wireless_transmitters"); public static final TagKey NETWORK_RECEIVERS = createTag("network_receivers"); + public static final TagKey NETWORK_TRANSMITTERS = createTag("network_transmitters"); private Tags() { } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java index 1a108b3d8..b7e8d79ed 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/controller/ControllerBlockEntity.java @@ -61,24 +61,17 @@ private static BlockEntityType getBlockEntityType(final C : BlockEntities.INSTANCE.getController(); } - void updateEnergyTypeInLevel(final BlockState state) { - final ControllerEnergyType currentEnergyType = ControllerEnergyType.ofState(getNode().getState()); - final ControllerEnergyType inLevelEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); - - if (currentEnergyType != inLevelEnergyType && energyStateChangeRateLimiter.tryAcquire()) { + public void updateEnergyTypeInLevel(final BlockState state) { + final ControllerEnergyType currentEnergyType = state.getValue(ControllerBlock.ENERGY_TYPE); + final ControllerEnergyType newEnergyType = ControllerEnergyType.ofState(getNode().getState()); + if (newEnergyType != currentEnergyType && level != null && energyStateChangeRateLimiter.tryAcquire()) { LOGGER.debug( "Energy type state change for controller at {}: {} -> {}", getBlockPos(), - inLevelEnergyType, - currentEnergyType + currentEnergyType, + newEnergyType ); - updateEnergyTypeInLevel(state, currentEnergyType); - } - } - - private void updateEnergyTypeInLevel(final BlockState state, final ControllerEnergyType energyType) { - if (level != null) { - level.setBlockAndUpdate(getBlockPos(), state.setValue(ControllerBlock.ENERGY_TYPE, energyType)); + level.setBlockAndUpdate(getBlockPos(), state.setValue(ControllerBlock.ENERGY_TYPE, newEnergyType)); } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java index e4833d59b..825ede85c 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkCardItem.java @@ -8,9 +8,13 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -23,6 +27,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; +import static com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverKey.getDimensionName; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; // TODO: better active texture. @@ -52,16 +57,18 @@ public InteractionResult useOn(final UseOnContext ctx) { } final CompoundTag tag = new CompoundTag(); tag.putLong(TAG_POS, pos.asLong()); - tag.putString(TAG_DIMENSION, ctx.getLevel().dimension().location().toString()); + final ResourceKey dimension = ctx.getLevel().dimension(); + tag.putString(TAG_DIMENSION, dimension.location().toString()); ctx.getItemInHand().setTag(tag); ctx.getPlayer().sendSystemMessage(createTranslation( "item", "network_card.bound", pos.getX(), pos.getY(), - pos.getZ() + pos.getZ(), + getDimensionName(dimension).withStyle(ChatFormatting.YELLOW) )); - return InteractionResult.SUCCESS; + return InteractionResult.CONSUME; } @Override @@ -81,29 +88,36 @@ public void appendHoverText(final ItemStack stack, final List lines, final TooltipFlag flag) { super.appendHoverText(stack, level, lines, flag); - if (!isActive(stack)) { - lines.add(UNBOUND); - return; - } - final BlockPos pos = getPosition(stack); - if (pos == null) { - return; - } - lines.add(createTranslation( + getLocation(stack).ifPresentOrElse(location -> lines.add(createTranslation( "item", "network_card.bound", - pos.getX(), - pos.getY(), - pos.getZ() - ).withStyle(ChatFormatting.GRAY)); + location.pos().getX(), + location.pos().getY(), + location.pos().getZ(), + getDimensionName(location.dimension()).withStyle(ChatFormatting.YELLOW) + ).withStyle(ChatFormatting.GRAY)), () -> lines.add(UNBOUND)); } @Nullable - public BlockPos getPosition(final ItemStack stack) { - if (stack.getTag() == null) { + private ResourceKey getDimension(final String dimensionKey) { + final ResourceLocation name = ResourceLocation.tryParse(dimensionKey); + if (name == null) { return null; } - return BlockPos.of(stack.getTag().getLong(TAG_POS)); + return ResourceKey.create(Registries.DIMENSION, name); + } + + Optional getLocation(final ItemStack stack) { + final CompoundTag tag = stack.getTag(); + if (tag == null) { + return Optional.empty(); + } + final ResourceKey dimension = getDimension(tag.getString(TAG_DIMENSION)); + if (dimension == null) { + return Optional.empty(); + } + final BlockPos pos = BlockPos.of(tag.getLong(TAG_POS)); + return Optional.of(GlobalPos.of(dimension, pos)); } @Override diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java index 34c436b5c..4bb7ea7c3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlock.java @@ -1,7 +1,5 @@ package com.refinedmods.refinedstorage2.platform.common.networking; -import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; -import com.refinedmods.refinedstorage2.platform.common.Platform; import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; @@ -9,7 +7,6 @@ import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; -import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; import javax.annotation.Nullable; @@ -29,7 +26,7 @@ public class NetworkReceiverBlock extends AbstractColoredBlock implements EntityBlock { public static final BooleanProperty ACTIVE = BooleanProperty.create("active"); - private static final AbstractBlockEntityTicker> TICKER = + private static final AbstractBlockEntityTicker TICKER = new NetworkNodeBlockEntityTicker<>(BlockEntities.INSTANCE::getNetworkReceiver, ACTIVE); public NetworkReceiverBlock(final DyeColor color, final MutableComponent name) { @@ -55,12 +52,7 @@ public BlockColorMap getBlockColorMap() { @Nullable @Override public BlockEntity newBlockEntity(final BlockPos pos, final BlockState state) { - return new NetworkNodeContainerBlockEntityImpl<>( - BlockEntities.INSTANCE.getNetworkReceiver(), - pos, - state, - new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) - ); + return new NetworkReceiverBlockEntity(pos, state); } @Nullable diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java new file mode 100644 index 000000000..920d77dc4 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverBlockEntity.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeContainerBlockEntityImpl; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.state.BlockState; + +public class NetworkReceiverBlockEntity extends NetworkNodeContainerBlockEntityImpl { + public NetworkReceiverBlockEntity(final BlockPos pos, final BlockState state) { + super( + BlockEntities.INSTANCE.getNetworkReceiver(), + pos, + state, + new SimpleNetworkNode(Platform.INSTANCE.getConfig().getNetworkReceiver().getEnergyUsage()) + ); + } + + @Nullable + @Override + public Object createKey() { + return new NetworkReceiverKey(getContainerPosition()); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java new file mode 100644 index 000000000..447079c36 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkReceiverKey.java @@ -0,0 +1,35 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; + +record NetworkReceiverKey(GlobalPos pos) { + int getDistance(final BlockPos from) { + return (int) Math.sqrt( + Math.pow(from.getX() - pos.pos().getX(), 2) + + Math.pow(from.getY() - pos.pos().getY(), 2) + + Math.pow(from.getZ() - pos.pos().getZ(), 2) + ); + } + + MutableComponent getDimensionName() { + return getDimensionName(pos.dimension()); + } + + static MutableComponent getDimensionName(final ResourceKey dimension) { + if (dimension == Level.OVERWORLD) { + return Component.literal("Overworld"); + } else if (dimension == Level.END) { + return Component.literal("The End"); + } else if (dimension == Level.NETHER) { + return Component.literal("The Nether"); + } + return Component.translatable( + "dimension.%s.%s".formatted(dimension.location().getNamespace(), dimension.location().getPath()) + ); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java new file mode 100644 index 000000000..95798f579 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlock.java @@ -0,0 +1,66 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.content.BlockColorMap; +import com.refinedmods.refinedstorage2.platform.common.content.BlockConstants; +import com.refinedmods.refinedstorage2.platform.common.content.Blocks; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBlockEntityTicker; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractColoredBlock; + +import javax.annotation.Nullable; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.EnumProperty; + +public class NetworkTransmitterBlock extends AbstractColoredBlock implements EntityBlock { + public static final EnumProperty STATE = EnumProperty.create( + "state", + NetworkTransmitterState.class + ); + + private static final AbstractBlockEntityTicker TICKER = + new NetworkTransmitterBlockEntityTicker(); + + public NetworkTransmitterBlock(final DyeColor color, final MutableComponent name) { + super(BlockConstants.PROPERTIES, color, name); + } + + @Override + protected BlockState getDefaultState() { + return super.getDefaultState().setValue(STATE, NetworkTransmitterState.INACTIVE); + } + + @Override + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(STATE); + } + + @Override + public BlockColorMap getBlockColorMap() { + return Blocks.INSTANCE.getNetworkTransmitter(); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(final BlockPos blockPos, final BlockState blockState) { + return new NetworkTransmitterBlockEntity(blockPos, blockState); + } + + @Nullable + @Override + public BlockEntityTicker getTicker(final Level level, + final BlockState blockState, + final BlockEntityType type) { + return TICKER.get(level, type); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java new file mode 100644 index 000000000..826600d74 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntity.java @@ -0,0 +1,222 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.Network; +import com.refinedmods.refinedstorage2.api.network.component.GraphNetworkComponent; +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.api.PlatformApi; +import com.refinedmods.refinedstorage2.platform.api.support.network.ConnectionSink; +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.content.ContentNames; +import com.refinedmods.refinedstorage2.platform.common.support.BlockEntityWithDrops; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ExtendedMenuProvider; +import com.refinedmods.refinedstorage2.platform.common.support.network.AbstractRedstoneModeNetworkNodeContainerBlockEntity; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.core.NonNullList; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createTranslation; + +// TODO: better error texture and better active texture with animation? Reuse controller textures? +public class NetworkTransmitterBlockEntity + extends AbstractRedstoneModeNetworkNodeContainerBlockEntity + implements ExtendedMenuProvider, BlockEntityWithDrops { + private static final Logger LOGGER = LoggerFactory.getLogger(NetworkTransmitterBlockEntity.class); + + private static final NetworkTransmitterStatus INACTIVE = NetworkTransmitterStatus.message( + createTranslation("gui", "network_transmitter.status.inactive") + ); + private static final NetworkTransmitterStatus MISSING_NETWORK_CARD = NetworkTransmitterStatus.error( + createTranslation("gui", "network_transmitter.status.missing_network_card").withStyle(ChatFormatting.DARK_RED) + ); + private static final NetworkTransmitterStatus RECEIVER_UNREACHABLE = NetworkTransmitterStatus.error( + createTranslation("gui", "network_transmitter.status.receiver_unreachable").withStyle(ChatFormatting.DARK_RED) + ); + + private static final String TAG_NETWORK_CARD_INVENTORY = "nc"; + + private final SimpleContainer networkCardInventory = new SimpleContainer(1) { + @Override + public boolean canPlaceItem(final int slot, final ItemStack stack) { + return stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack); + } + }; + private final RateLimiter stateChangeRateLimiter = RateLimiter.create(1); + private final RateLimiter networkRebuildRetryRateLimiter = RateLimiter.create(1 / 5D); + + @Nullable + private NetworkReceiverKey receiverKey; + + public NetworkTransmitterBlockEntity(final BlockPos pos, final BlockState state) { + super(BlockEntities.INSTANCE.getNetworkTransmitter(), pos, state, new SimpleNetworkNode( + Platform.INSTANCE.getConfig().getNetworkTransmitter().getEnergyUsage() + )); + networkCardInventory.addListener(container -> { + setChanged(); + updateReceiverLocation(); + if (level != null) { + LOGGER.info("Network card was changed at {}, sending network update", worldPosition); + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + }); + } + + @Override + protected void activenessChanged(final boolean newActive) { + super.activenessChanged(newActive); + if (level == null) { + return; + } + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + + public void updateStateInLevel(final BlockState state) { + final NetworkTransmitterState currentState = state.getValue(NetworkTransmitterBlock.STATE); + final NetworkTransmitterState newState = getState(); + if (currentState != newState && level != null && stateChangeRateLimiter.tryAcquire()) { + LOGGER.info("Updating network transmitter at {} from {} to {}", worldPosition, currentState, newState); + level.setBlockAndUpdate(worldPosition, state.setValue(NetworkTransmitterBlock.STATE, newState)); + } + } + + private NetworkTransmitterState getState() { + if (!isActive()) { + return NetworkTransmitterState.INACTIVE; + } + if (receiverKey == null) { + return NetworkTransmitterState.ERROR; + } + final Network network = getNode().getNetwork(); + if (network == null) { + return NetworkTransmitterState.ERROR; + } + final boolean receiverFound = isReceiverFoundInNetwork(network, receiverKey); + return receiverFound ? NetworkTransmitterState.ACTIVE : NetworkTransmitterState.ERROR; + } + + NetworkTransmitterStatus getStatus() { + final Network network = getNode().getNetwork(); + if (!isActive() || network == null || level == null) { + return INACTIVE; + } + if (receiverKey == null) { + return MISSING_NETWORK_CARD; + } + final boolean receiverFound = isReceiverFoundInNetwork(network, receiverKey); + if (!receiverFound) { + return RECEIVER_UNREACHABLE; + } + final boolean showDistance = level.dimension() == receiverKey.pos().dimension(); + final MutableComponent message = showDistance ? createTranslation( + "gui", + "network_transmitter.status.transmitting", + receiverKey.getDistance(worldPosition)) : receiverKey.getDimensionName(); + return NetworkTransmitterStatus.message(message); + } + + @Override + public void doWork() { + super.doWork(); + if (!isActive() || getNode().getNetwork() == null || receiverKey == null) { + return; + } + final boolean receiverFound = isReceiverFoundInNetwork(getNode().getNetwork(), receiverKey); + if (!receiverFound && networkRebuildRetryRateLimiter.tryAcquire()) { + tryReconnectingWithReceiver(); + } + } + + private void tryReconnectingWithReceiver() { + if (level == null) { + return; + } + LOGGER.info( + "Receiver {} was not found in network for transmitter at {}, retrying and sending network update", + receiverKey, + worldPosition + ); + PlatformApi.INSTANCE.requestNetworkNodeUpdate(this, level); + } + + private static boolean isReceiverFoundInNetwork(final Network network, final NetworkReceiverKey key) { + return network.getComponent(GraphNetworkComponent.class).getContainer(key) != null; + } + + Container getNetworkCardInventory() { + return networkCardInventory; + } + + @Override + public void saveAdditional(final CompoundTag tag) { + super.saveAdditional(tag); + tag.put(TAG_NETWORK_CARD_INVENTORY, networkCardInventory.createTag()); + } + + @Override + public void load(final CompoundTag tag) { + super.load(tag); + if (tag.contains(TAG_NETWORK_CARD_INVENTORY)) { + networkCardInventory.fromTag(tag.getList(TAG_NETWORK_CARD_INVENTORY, Tag.TAG_COMPOUND)); + } + updateReceiverLocation(); + } + + private void updateReceiverLocation() { + final ItemStack stack = networkCardInventory.getItem(0); + if (stack.isEmpty()) { + receiverKey = null; + } else if (stack.getItem() instanceof NetworkCardItem cardItem) { + receiverKey = cardItem.getLocation(stack).map(NetworkReceiverKey::new).orElse(null); + } + } + + @Nullable + @Override + public AbstractContainerMenu createMenu(final int syncId, final Inventory inventory, final Player player) { + return new NetworkTransmitterContainerMenu(syncId, inventory, this); + } + + @Override + public void writeScreenOpeningData(final ServerPlayer player, final FriendlyByteBuf buf) { + final NetworkTransmitterStatus status = getStatus(); + buf.writeBoolean(status.error()); + buf.writeComponent(status.message()); + } + + @Override + public Component getDisplayName() { + return ContentNames.NETWORK_TRANSMITTER; + } + + @Override + public NonNullList getDrops() { + return NonNullList.of(ItemStack.EMPTY, networkCardInventory.getItem(0)); + } + + @Override + public void addOutgoingConnections(final ConnectionSink sink) { + super.addOutgoingConnections(sink); + if (receiverKey != null && isActive()) { + sink.tryConnect(receiverKey.pos()); + } + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java new file mode 100644 index 000000000..dde4d9e96 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterBlockEntityTicker.java @@ -0,0 +1,25 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.api.network.impl.node.SimpleNetworkNode; +import com.refinedmods.refinedstorage2.platform.common.content.BlockEntities; +import com.refinedmods.refinedstorage2.platform.common.support.network.NetworkNodeBlockEntityTicker; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.state.BlockState; + +public class NetworkTransmitterBlockEntityTicker + extends NetworkNodeBlockEntityTicker { + NetworkTransmitterBlockEntityTicker() { + super(BlockEntities.INSTANCE::getNetworkTransmitter); + } + + @Override + public void tick(final Level level, + final BlockPos pos, + final BlockState state, + final NetworkTransmitterBlockEntity blockEntity) { + super.tick(level, pos, state, blockEntity); + blockEntity.updateStateInLevel(state); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java new file mode 100644 index 000000000..812c6083b --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterContainerMenu.java @@ -0,0 +1,98 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.Platform; +import com.refinedmods.refinedstorage2.platform.common.content.Menus; +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.support.RedstoneMode; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ClientProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ServerProperty; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.ValidatedSlot; + +import javax.annotation.Nullable; + +import com.google.common.util.concurrent.RateLimiter; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.Container; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; + +public class NetworkTransmitterContainerMenu extends AbstractBaseContainerMenu { + @Nullable + private final NetworkTransmitterBlockEntity blockEntity; + private final Player player; + private final RateLimiter statusUpdateRateLimiter = RateLimiter.create(2); + private NetworkTransmitterStatus status; + + NetworkTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final NetworkTransmitterBlockEntity blockEntity) { + super(Menus.INSTANCE.getNetworkTransmitter(), syncId); + registerProperty(new ServerProperty<>( + PropertyTypes.REDSTONE_MODE, + blockEntity::getRedstoneMode, + blockEntity::setRedstoneMode + )); + this.blockEntity = blockEntity; + this.player = playerInventory.player; + this.status = blockEntity.getStatus(); + addSlots(playerInventory, blockEntity.getNetworkCardInventory()); + } + + public NetworkTransmitterContainerMenu(final int syncId, + final Inventory playerInventory, + final FriendlyByteBuf buf) { + super(Menus.INSTANCE.getNetworkTransmitter(), syncId); + registerProperty(new ClientProperty<>(PropertyTypes.REDSTONE_MODE, RedstoneMode.IGNORE)); + this.blockEntity = null; + this.player = playerInventory.player; + this.status = new NetworkTransmitterStatus(buf.readBoolean(), buf.readComponent()); + addSlots(playerInventory, new SimpleContainer(1)); + } + + @Override + public void broadcastChanges() { + super.broadcastChanges(); + if (blockEntity == null || !(player instanceof ServerPlayer serverPlayer)) { + return; + } + if (!statusUpdateRateLimiter.tryAcquire()) { + return; + } + final NetworkTransmitterStatus newStatus = blockEntity.getStatus(); + if (newStatus.message().equals(status.message())) { + return; + } + updateStatus(serverPlayer, newStatus); + } + + private void updateStatus(final ServerPlayer serverPlayer, final NetworkTransmitterStatus newStatus) { + this.status = newStatus; + Platform.INSTANCE.getServerToClientCommunications().sendNetworkTransmitterStatus( + serverPlayer, + newStatus + ); + } + + private void addSlots(final Inventory playerInventory, final Container networkCardInventory) { + addPlayerInventory(playerInventory, 8, 55); + addSlot(new ValidatedSlot( + networkCardInventory, + 0, + 8, + 20, + stack -> stack.getItem() instanceof NetworkCardItem networkCardItem && networkCardItem.isActive(stack) + )); + transferManager.addBiTransfer(playerInventory, networkCardInventory); + } + + NetworkTransmitterStatus getStatus() { + return status; + } + + public void setStatus(final NetworkTransmitterStatus status) { + this.status = status; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java new file mode 100644 index 000000000..b3790ec10 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterScreen.java @@ -0,0 +1,48 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import com.refinedmods.refinedstorage2.platform.common.support.AbstractBaseScreen; +import com.refinedmods.refinedstorage2.platform.common.support.TextureIds; +import com.refinedmods.refinedstorage2.platform.common.support.containermenu.PropertyTypes; +import com.refinedmods.refinedstorage2.platform.common.support.widget.RedstoneModeSideButtonWidget; + +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Inventory; + +import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.createIdentifier; + +public class NetworkTransmitterScreen extends AbstractBaseScreen { + private static final ResourceLocation TEXTURE = createIdentifier("textures/gui/network_transmitter.png"); + + public NetworkTransmitterScreen(final NetworkTransmitterContainerMenu menu, + final Inventory playerInventory, + final Component text) { + super(menu, playerInventory, text); + this.inventoryLabelY = 42; + this.imageWidth = 176; + this.imageHeight = 137; + } + + @Override + protected void init() { + super.init(); + addSideButton(new RedstoneModeSideButtonWidget(getMenu().getProperty(PropertyTypes.REDSTONE_MODE))); + } + + @Override + protected ResourceLocation getTexture() { + return TEXTURE; + } + + @Override + protected void renderLabels(final GuiGraphics graphics, final int mouseX, final int mouseY) { + super.renderLabels(graphics, mouseX, mouseY); + final NetworkTransmitterStatus status = getMenu().getStatus(); + final int displayTextX = 51; + if (status.error()) { + graphics.blit(TextureIds.ICONS, displayTextX, 23, 246, 148, 10, 10); + } + graphics.drawString(font, status.message(), displayTextX + (status.error() ? (10 + 4) : 0), 25, 4210752, false); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java new file mode 100644 index 000000000..f8ce3cc2f --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterState.java @@ -0,0 +1,20 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.util.StringRepresentable; + +public enum NetworkTransmitterState implements StringRepresentable { + ACTIVE("active"), + ERROR("error"), + INACTIVE("inactive"); + + private final String name; + + NetworkTransmitterState(final String name) { + this.name = name; + } + + @Override + public String getSerializedName() { + return name; + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java new file mode 100644 index 000000000..4fc4aa4ed --- /dev/null +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/networking/NetworkTransmitterStatus.java @@ -0,0 +1,13 @@ +package com.refinedmods.refinedstorage2.platform.common.networking; + +import net.minecraft.network.chat.Component; + +public record NetworkTransmitterStatus(boolean error, Component message) { + static NetworkTransmitterStatus error(final Component message) { + return new NetworkTransmitterStatus(true, message); + } + + static NetworkTransmitterStatus message(final Component message) { + return new NetworkTransmitterStatus(false, message); + } +} diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java index 3ebb2ec52..2aab8e7b1 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/ServerToClientCommunications.java @@ -4,6 +4,7 @@ import com.refinedmods.refinedstorage2.api.storage.tracked.TrackedResource; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import java.util.UUID; import javax.annotation.Nullable; @@ -30,4 +31,6 @@ void sendResourceSlotUpdate(ServerPlayer player, int slotIndex); void sendStorageInfoResponse(ServerPlayer player, UUID id, StorageInfo storageInfo); + + void sendNetworkTransmitterStatus(ServerPlayer player, NetworkTransmitterStatus status); } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java index d8238dfa0..cd33c72e3 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionProviderImpl.java @@ -100,6 +100,9 @@ private PlatformNetworkNodeContainer getConnection(final PlatformNetworkNodeCont if (!(connectionBlockEntity instanceof PlatformNetworkNodeContainer connectionContainer)) { return null; } + if (connection.incomingDirection() == null) { + return connectionContainer; + } final boolean acceptsIncomingDirection = connectionContainer.canAcceptIncomingConnection( connection.incomingDirection(), from.getContainerBlockState() diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java index 36024462d..e75182f34 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/network/ConnectionSinkImpl.java @@ -4,6 +4,7 @@ import java.util.HashSet; import java.util.Set; +import javax.annotation.Nullable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -21,12 +22,17 @@ Set getConnections() { return connections; } + @Override + public void tryConnect(final GlobalPos pos) { + connections.add(new Connection(pos, null)); + } + @Override public void tryConnectInSameDimension(final BlockPos pos, final Direction incomingDirection) { final GlobalPos globalPos = GlobalPos.of(source.dimension(), pos); connections.add(new Connection(globalPos, incomingDirection)); } - record Connection(GlobalPos pos, Direction incomingDirection) { + record Connection(GlobalPos pos, @Nullable Direction incomingDirection) { } } diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java index f64e3f91f..d7c0833fe 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/upgrade/UpgradeContainer.java @@ -26,8 +26,7 @@ public class UpgradeContainer extends SimpleContainer implements UpgradeState { private final UpgradeRegistry registry; private final Object2IntMap index = new Object2IntOpenHashMap<>(); - public UpgradeContainer(final UpgradeDestination destination, - final UpgradeRegistry registry) { + public UpgradeContainer(final UpgradeDestination destination, final UpgradeRegistry registry) { this(destination, registry, () -> { }); } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json index b90e3d6b4..6d4759f1a 100644 --- a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json +++ b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/lang/en_us.json @@ -29,6 +29,7 @@ "block.refinedstorage2.wireless_transmitter": "Wireless Transmitter", "block.refinedstorage2.storage_monitor": "Storage Monitor", "block.refinedstorage2.network_receiver": "Network Receiver", + "block.refinedstorage2.network_transmitter": "Network Transmitter", "gui.refinedstorage2.controller.redstone_mode_help": "When this device is inactive, the storage network will not be able to use this device as an energy source.", "gui.refinedstorage2.disk_drive.disks": "Disks", "gui.refinedstorage2.storage.redstone_mode_help": "When this device is inactive, the contained storage will no longer be accessible from within the storage network.", @@ -132,6 +133,10 @@ "gui.refinedstorage2.filter_slot.right_click_for": "Right click for", "gui.refinedstorage2.filter_slot.click_to_clear": "Click to clear", "gui.refinedstorage2.regulator_upgrade.filter_help": "The resource that should be regulated in the target.", + "gui.refinedstorage2.network_transmitter.status.inactive": "Inactive", + "gui.refinedstorage2.network_transmitter.status.missing_network_card": "Missing Network Card", + "gui.refinedstorage2.network_transmitter.status.transmitting": "%d block(s)", + "gui.refinedstorage2.network_transmitter.status.receiver_unreachable": "Unreachable", "item.refinedstorage2.controller.help": "Provides the storage network with energy. Multiple are allowed in a single storage network.", "item.refinedstorage2.creative_controller.help": "Provides the storage network with an infinite source of energy.", "item.refinedstorage2.disk_drive.help": "Accepts storage disks to provide the storage network with storage space.", @@ -208,7 +213,7 @@ "item.refinedstorage2.network_card.unbound_help": "Use while crouching on a Network Receiver.", "item.refinedstorage2.network_card.unbound": "Unbound.", "item.refinedstorage2.network_card.bound_help": "Insert into a Network Transmitter. Use while crouching to clear binding.", - "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d.", + "item.refinedstorage2.network_card.bound": "Bound to %d, %d, %d in %s.", "misc.refinedstorage2.stored": "Stored: %s", "misc.refinedstorage2.stored_with_capacity": "Stored: %s / %s (%d%%)", "misc.refinedstorage2.total": "%d total", @@ -343,5 +348,7 @@ "advancements.refinedstorage2.wireless": "Wireless", "advancements.refinedstorage2.wireless.description": "Access your resources wirelessly with a Wireless Grid.", "advancements.refinedstorage2.better_than_a_barrel": "Better than a barrel", - "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network" + "advancements.refinedstorage2.better_than_a_barrel.description": "Craft a Storage Monitor to view, insert or extract resources in a storage network", + "advancements.refinedstorage2.no_cables_required": "No cables required", + "advancements.refinedstorage2.no_cables_required.description": "Add extra components to your network without using cables by using a Network Transmitter, Network Receiver and Network Card" } diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png new file mode 100644 index 000000000..9e4f2df05 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/base.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png new file mode 100644 index 000000000..b478acfc8 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/black.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png new file mode 100644 index 000000000..552572138 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png new file mode 100644 index 000000000..fb4d506cb Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/brown.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png new file mode 100644 index 000000000..b5973a446 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/cyan.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png new file mode 100644 index 000000000..0ad29042b Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/error.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png new file mode 100644 index 000000000..ce0726150 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png new file mode 100644 index 000000000..df155b8d7 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/green.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png new file mode 100644 index 000000000..d86c8677a Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/inactive.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png new file mode 100644 index 000000000..d069dbfbc Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_blue.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png new file mode 100644 index 000000000..da38b659e Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/light_gray.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png new file mode 100644 index 000000000..15de16c8d Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/lime.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png new file mode 100644 index 000000000..3505727f5 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/magenta.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png new file mode 100644 index 000000000..d1891b6b0 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/orange.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png new file mode 100644 index 000000000..4747663ab Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/pink.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png new file mode 100644 index 000000000..7ce5ab351 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/purple.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png new file mode 100644 index 000000000..129e1093c Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/red.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png new file mode 100644 index 000000000..8cc85ea01 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/white.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png new file mode 100644 index 000000000..106584585 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/block/network_transmitter/cutouts/yellow.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png new file mode 100755 index 000000000..1d25ea190 Binary files /dev/null and b/refinedstorage2-platform-common/src/main/resources/assets/refinedstorage2/textures/gui/network_transmitter.png differ diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json new file mode 100644 index 000000000..b13859692 --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/advancements/no_cables_required.json @@ -0,0 +1,34 @@ +{ + "display": { + "icon": { + "item": "refinedstorage2:network_transmitter" + }, + "title": { + "translate": "advancements.refinedstorage2.no_cables_required" + }, + "description": { + "translate": "advancements.refinedstorage2.no_cables_required.description" + } + }, + "parent": "refinedstorage2:wireless", + "criteria": { + "network_transmitter_receiver_card_in_inventory": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "tag": "refinedstorage2:network_transmitters" + }, + { + "tag": "refinedstorage2:network_receivers" + }, + { + "items": [ + "refinedstorage2:network_card" + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json new file mode 100644 index 000000000..ee854972e --- /dev/null +++ b/refinedstorage2-platform-common/src/main/resources/data/refinedstorage2/recipes/network_transmitter.json @@ -0,0 +1,31 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "EEE", + "CMD", + "ANA" + ], + "key": { + "E": { + "item": "minecraft:ender_pearl" + }, + "C": { + "item": "refinedstorage2:construction_core" + }, + "M": { + "item": "refinedstorage2:machine_casing" + }, + "D": { + "item": "refinedstorage2:destruction_core" + }, + "A": { + "item": "refinedstorage2:advanced_processor" + }, + "N": { + "item": "minecraft:netherite_ingot" + } + }, + "result": { + "item": "refinedstorage2:network_transmitter" + } +} \ No newline at end of file diff --git a/refinedstorage2-platform-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 d0de2fc30..b258057b5 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ClientModInitializerImpl.java @@ -26,6 +26,7 @@ import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridClearPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.NetworkTransmitterStatusPacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.StorageInfoResponsePacket; import com.refinedmods.refinedstorage2.platform.fabric.packet.s2c.WirelessTransmitterRangePacket; @@ -110,6 +111,7 @@ private void setRenderLayers() { setCutout(Blocks.INSTANCE.getDestructor()); setCutout(Blocks.INSTANCE.getWirelessTransmitter()); setCutout(Blocks.INSTANCE.getNetworkReceiver()); + setCutout(Blocks.INSTANCE.getNetworkTransmitter()); } private void setCutout(final BlockColorMap blockMap) { @@ -149,6 +151,9 @@ private void registerEmissiveModels() { Blocks.INSTANCE.getNetworkReceiver().forEach( (color, id, block) -> registerEmissiveNetworkReceiverModels(color, id) ); + Blocks.INSTANCE.getNetworkTransmitter().forEach( + (color, id, block) -> registerEmissiveNetworkTransmitterModels(color, id) + ); } private void registerEmissiveControllerModels(final DyeColor color) { @@ -241,6 +246,23 @@ private void registerEmissiveNetworkReceiverModels(final DyeColor color, final R ); } + private void registerEmissiveNetworkTransmitterModels(final DyeColor color, final ResourceLocation id) { + // Block + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_transmitter/" + color.getName()), + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + ); + EmissiveModelRegistry.INSTANCE.register( + createIdentifier("block/network_transmitter/error"), + createIdentifier("block/network_transmitter/cutouts/error") + ); + // Item + EmissiveModelRegistry.INSTANCE.register( + id, + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + ); + } + private void registerPackets() { ClientPlayNetworking.registerGlobalReceiver(PacketIds.STORAGE_INFO_RESPONSE, new StorageInfoResponsePacket()); ClientPlayNetworking.registerGlobalReceiver(PacketIds.GRID_UPDATE, new GridUpdatePacket()); @@ -252,6 +274,10 @@ private void registerPackets() { new WirelessTransmitterRangePacket() ); ClientPlayNetworking.registerGlobalReceiver(PacketIds.RESOURCE_SLOT_UPDATE, new ResourceSlotUpdatePacket()); + ClientPlayNetworking.registerGlobalReceiver( + PacketIds.NETWORK_TRANSMITTER_STATUS, + new NetworkTransmitterStatusPacket() + ); } private void registerBlockEntityRenderers() { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java index 3297bd8e3..df268b19a 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/ConfigImpl.java @@ -80,6 +80,11 @@ public class ConfigImpl implements ConfigData, com.refinedmods.refinedstorage2.p DefaultEnergyUsage.NETWORK_RECEIVER ); + @ConfigEntry.Gui.CollapsibleObject + private SimpleEnergyUsageEntryImpl networkTransmitter = new SimpleEnergyUsageEntryImpl( + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); + public static ConfigImpl get() { return AutoConfig.getConfigHolder(ConfigImpl.class).getConfig(); } @@ -179,6 +184,11 @@ public SimpleEnergyUsageEntry getNetworkReceiver() { return networkReceiver; } + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + private static class GridEntryImpl implements GridEntry { private boolean largeFont = false; diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java index c0a02ea47..0484186f9 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/PacketIds.java @@ -25,6 +25,7 @@ public final class PacketIds { public static final ResourceLocation RESOURCE_SLOT_AMOUNT_CHANGE = createIdentifier("resource_slot_amount_change"); public static final ResourceLocation SINGLE_AMOUNT_CHANGE = createIdentifier("detector_amount_change"); public static final ResourceLocation USE_NETWORK_BOUND_ITEM = createIdentifier("use_network_bound_item"); + public static final ResourceLocation NETWORK_TRANSMITTER_STATUS = createIdentifier("network_transmitter_status"); private PacketIds() { } diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java new file mode 100644 index 000000000..f174071cd --- /dev/null +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/NetworkTransmitterStatusPacket.java @@ -0,0 +1,28 @@ +package com.refinedmods.refinedstorage2.platform.fabric.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; + +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.networking.v1.PacketSender; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientPacketListener; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; + +public class NetworkTransmitterStatusPacket implements ClientPlayNetworking.PlayChannelHandler { + @Override + public void receive(final Minecraft client, + final ClientPacketListener handler, + final FriendlyByteBuf buf, + final PacketSender responseSender) { + final boolean error = buf.readBoolean(); + final Component message = buf.readComponent(); + + client.execute(() -> { + if (client.player.containerMenu instanceof NetworkTransmitterContainerMenu containerMenu) { + containerMenu.setStatus(new NetworkTransmitterStatus(error, message)); + } + }); + } +} diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java index 83eed775e..7d4c0bde8 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/packet/s2c/ServerToClientCommunicationsImpl.java @@ -5,6 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.common.util.PacketUtil; import com.refinedmods.refinedstorage2.platform.fabric.packet.PacketIds; @@ -102,6 +103,14 @@ public void sendStorageInfoResponse(final ServerPlayer player, final UUID id, fi }); } + @Override + public void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterStatus status) { + sendToPlayer(player, PacketIds.NETWORK_TRANSMITTER_STATUS, buf -> { + buf.writeBoolean(status.error()); + buf.writeComponent(status.message()); + }); + } + private static void sendToPlayer(final ServerPlayer playerEntity, final ResourceLocation id, final Consumer bufConsumer) { diff --git a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java index 414b61b6a..a1dc1c257 100644 --- a/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-fabric/src/main/java/com/refinedmods/refinedstorage2/platform/fabric/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -89,6 +89,12 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) Tags.WIRELESS_TRANSMITTERS ); groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS); + groupItems( + registry, + Blocks.INSTANCE.getNetworkTransmitter(), + ContentIds.NETWORK_TRANSMITTER, + Tags.NETWORK_TRANSMITTERS + ); } @Override diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java index 842a3e945..d7a1309fa 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/ConfigImpl.java @@ -37,6 +37,7 @@ public class ConfigImpl implements Config { private final WirelessTransmitterEntry wirelessTransmitter; private final SimpleEnergyUsageEntry storageMonitor; private final SimpleEnergyUsageEntry networkReceiver; + private final SimpleEnergyUsageEntry networkTransmitter; public ConfigImpl() { cable = new SimpleEnergyUsageEntryImpl("cable", "Cable", DefaultEnergyUsage.CABLE); @@ -70,6 +71,11 @@ public ConfigImpl() { "Network Receiver", DefaultEnergyUsage.NETWORK_RECEIVER ); + networkTransmitter = new SimpleEnergyUsageEntryImpl( + "networkTransmitter", + "Network Transmitter", + DefaultEnergyUsage.NETWORK_TRANSMITTER + ); spec = builder.build(); } @@ -172,6 +178,11 @@ public SimpleEnergyUsageEntry getNetworkReceiver() { return networkReceiver; } + @Override + public SimpleEnergyUsageEntry getNetworkTransmitter() { + return networkTransmitter; + } + private class SimpleEnergyUsageEntryImpl implements SimpleEnergyUsageEntry { private final ForgeConfigSpec.LongValue energyUsage; diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java index f63badfca..5357e1fdc 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockModelProvider.java @@ -25,6 +25,7 @@ protected void registerModels() { registerDetectors(); registerWirelessTransmitters(); registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -127,4 +128,24 @@ private void registerNetworkReceivers() { .texture("all", baseTexture) .texture("cutout", createIdentifier("block/network_receiver/cutouts/inactive")); } + + private void registerNetworkTransmitters() { + final ResourceLocation emissiveBase = createIdentifier("block/emissive_all_cutout"); + final ResourceLocation baseTexture = createIdentifier("block/network_transmitter/base"); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, receiver) -> { + final ResourceLocation cutout = createIdentifier("block/network_transmitter/cutouts/" + color.getName()); + withExistingParent("block/network_transmitter/" + color.getName(), emissiveBase) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", cutout); + }); + withExistingParent("block/network_transmitter/inactive", createIdentifier("block/all_cutout")) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_transmitter/cutouts/inactive")); + withExistingParent("block/network_transmitter/error", emissiveBase) + .texture("particle", baseTexture) + .texture("all", baseTexture) + .texture("cutout", createIdentifier("block/network_transmitter/cutouts/error")); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java index 880f37c2e..4016e62a1 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/BlockStateProvider.java @@ -8,6 +8,7 @@ import com.refinedmods.refinedstorage2.platform.common.detector.DetectorBlock; import com.refinedmods.refinedstorage2.platform.common.grid.AbstractGridBlock; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.support.CableBlockSupport; import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirection; import com.refinedmods.refinedstorage2.platform.common.support.direction.BiDirectionType; @@ -63,6 +64,7 @@ protected void registerStatesAndModels() { registerConstructorDestructors(Blocks.INSTANCE.getConstructor(), "constructor"); registerConstructorDestructors(Blocks.INSTANCE.getDestructor(), "destructor"); registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -275,6 +277,24 @@ private void registerNetworkReceivers() { }); } + private void registerNetworkTransmitters() { + final ModelFile inactive = modelFile(createIdentifier("block/network_transmitter/inactive")); + final ModelFile error = modelFile(createIdentifier("block/network_transmitter/error")); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> { + final var builder = getVariantBuilder(block.get()); + builder.forAllStates(blockState -> { + final ConfiguredModel.Builder model = ConfiguredModel.builder(); + switch (blockState.getValue(NetworkTransmitterBlock.STATE)) { + case ACTIVE -> + model.modelFile(modelFile(createIdentifier("block/network_transmitter/" + color.getName()))); + case ERROR -> model.modelFile(error); + case INACTIVE -> model.modelFile(inactive); + } + return model.build(); + }); + }); + } + private void addRotation(final ConfiguredModel.Builder model, final Direction direction) { final int rotationX; if (direction.getAxis() == Direction.Axis.Y) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java index f1edd6f3d..da762c9a6 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/ItemModelProvider.java @@ -13,6 +13,7 @@ import com.refinedmods.refinedstorage2.platform.common.importer.ImporterBlock; import com.refinedmods.refinedstorage2.platform.common.networking.CableBlock; import com.refinedmods.refinedstorage2.platform.common.networking.NetworkReceiverBlock; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterBlock; import com.refinedmods.refinedstorage2.platform.common.storage.externalstorage.ExternalStorageBlock; import com.refinedmods.refinedstorage2.platform.common.wirelesstransmitter.WirelessTransmitterBlock; @@ -44,6 +45,7 @@ protected void registerModels() { registerDestructors(); registerWirelessTransmitters(); registerNetworkReceivers(); + registerNetworkTransmitters(); } private void registerCables() { @@ -194,6 +196,17 @@ private void registerNetworkReceivers() { )); } + private void registerNetworkTransmitters() { + final ResourceLocation base = createIdentifier("block/network_transmitter/inactive"); + final ColorMap blocks = Blocks.INSTANCE.getNetworkTransmitter(); + blocks.forEach((color, id, block) -> singleTexture( + id.getPath(), + base, + "cutout", + createIdentifier("block/network_transmitter/cutouts/" + color.getName()) + )); + } + private ModelFile modelFile(final ResourceLocation location) { return new ModelFile.ExistingModelFile(location, existingFileHelper); } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java index bcdcbe1cb..f561592a7 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/BlockDropProvider.java @@ -31,6 +31,7 @@ protected void generate() { Blocks.INSTANCE.getDestructor().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getWirelessTransmitter().forEach((color, id, block) -> dropSelf(block.get())); Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> dropSelf(block.get())); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> dropSelf(block.get())); } @Override @@ -46,6 +47,7 @@ protected Iterable getKnownBlocks() { blocks.addAll(Blocks.INSTANCE.getDestructor().values()); blocks.addAll(Blocks.INSTANCE.getWirelessTransmitter().values()); blocks.addAll(Blocks.INSTANCE.getNetworkReceiver().values()); + blocks.addAll(Blocks.INSTANCE.getNetworkTransmitter().values()); return blocks; } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java index ac0f47cd3..609b24c38 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/loot/LootTableProvider.java @@ -10,9 +10,9 @@ public class LootTableProvider extends net.minecraft.data.loot.LootTableProvider { public LootTableProvider(final PackOutput output) { - super(output, Set.of(), List.of( - new SubProviderEntry(BlockDropProvider::new, - LootContextParamSet.builder().required(EXPLOSION_RADIUS).build()) + super(output, Set.of(), List.of(new SubProviderEntry( + BlockDropProvider::new, + LootContextParamSet.builder().required(EXPLOSION_RADIUS).build()) )); } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java index 0ccedf2a8..1e302bc06 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/recipe/RecoloringRecipeProvider.java @@ -60,6 +60,9 @@ protected void buildRecipes(final Consumer provider) { Blocks.INSTANCE.getNetworkReceiver().forEach((color, id, block) -> recolorItems(Tags.NETWORK_RECEIVERS, block.get().asItem(), color) .save(provider, createIdentifier("coloring/" + color.getName() + "_network_receiver"))); + Blocks.INSTANCE.getNetworkTransmitter().forEach((color, id, block) -> + recolorItems(Tags.NETWORK_TRANSMITTERS, block.get().asItem(), color) + .save(provider, createIdentifier("coloring/" + color.getName() + "_network_transmitter"))); } private ShapelessRecipeBuilder recolorItems(final TagKey dyeable, final Item result, final DyeColor color) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java index 0bfdc61ab..f93ae1e0b 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/datagen/tag/ItemTagGenerator.java @@ -32,6 +32,7 @@ import static com.refinedmods.refinedstorage2.platform.common.content.Tags.GRIDS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.IMPORTERS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.NETWORK_RECEIVERS; +import static com.refinedmods.refinedstorage2.platform.common.content.Tags.NETWORK_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.STORAGE_DISKS; import static com.refinedmods.refinedstorage2.platform.common.content.Tags.WIRELESS_TRANSMITTERS; import static com.refinedmods.refinedstorage2.platform.common.util.IdentifierUtil.MOD_ID; @@ -104,6 +105,10 @@ protected void addTags(final HolderLookup.Provider provider) { Blocks.INSTANCE.getNetworkReceiver().values().stream() .map(block -> (Supplier) block::asItem) .toList()); + addAllToTag(NETWORK_TRANSMITTERS, + Blocks.INSTANCE.getNetworkTransmitter().values().stream() + .map(block -> (Supplier) block::asItem) + .toList()); } private void addAllToTag(final TagKey t, final Collection> items) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java index c93624a61..90d63b97d 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/NetworkManager.java @@ -16,6 +16,7 @@ import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridActivePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridClearPacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.GridUpdatePacket; +import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.NetworkTransmitterStatusPacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.ResourceSlotUpdatePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.StorageInfoResponsePacket; import com.refinedmods.refinedstorage2.platform.forge.packet.s2c.WirelessTransmitterRangePacket; @@ -175,6 +176,13 @@ public NetworkManager() { UseNetworkBoundItemPacket::decode, UseNetworkBoundItemPacket::handle ); + handler.registerMessage( + id++, + NetworkTransmitterStatusPacket.class, + NetworkTransmitterStatusPacket::encode, + NetworkTransmitterStatusPacket::decode, + NetworkTransmitterStatusPacket::handle + ); } public void send(final ServerPlayer player, final Object message) { diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java new file mode 100644 index 000000000..400c4a751 --- /dev/null +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/NetworkTransmitterStatusPacket.java @@ -0,0 +1,43 @@ +package com.refinedmods.refinedstorage2.platform.forge.packet.s2c; + +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterContainerMenu; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; + +import java.util.function.Supplier; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraftforge.network.NetworkEvent; + +public class NetworkTransmitterStatusPacket { + private final boolean error; + private final Component message; + + public NetworkTransmitterStatusPacket(final boolean error, final Component message) { + this.error = error; + this.message = message; + } + + public static NetworkTransmitterStatusPacket decode(final FriendlyByteBuf buf) { + return new NetworkTransmitterStatusPacket(buf.readBoolean(), buf.readComponent()); + } + + public static void encode(final NetworkTransmitterStatusPacket packet, final FriendlyByteBuf buf) { + buf.writeBoolean(packet.error); + buf.writeComponent(packet.message); + } + + public static void handle(final NetworkTransmitterStatusPacket packet, final Supplier ctx) { + ctx.get().enqueueWork(() -> ClientProxy.getPlayer().ifPresent(player -> handle(player, packet))); + ctx.get().setPacketHandled(true); + } + + private static void handle(final Player player, final NetworkTransmitterStatusPacket packet) { + final AbstractContainerMenu menu = player.containerMenu; + if (menu instanceof NetworkTransmitterContainerMenu containerMenu) { + containerMenu.setStatus(new NetworkTransmitterStatus(packet.error, packet.message)); + } + } +} diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java index c402dd972..b825e0921 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/packet/s2c/ServerToClientCommunicationsImpl.java @@ -5,6 +5,7 @@ import com.refinedmods.refinedstorage2.platform.api.PlatformApi; import com.refinedmods.refinedstorage2.platform.api.storage.channel.PlatformStorageChannelType; import com.refinedmods.refinedstorage2.platform.api.support.resource.ResourceAmountTemplate; +import com.refinedmods.refinedstorage2.platform.common.networking.NetworkTransmitterStatus; import com.refinedmods.refinedstorage2.platform.common.support.ServerToClientCommunications; import com.refinedmods.refinedstorage2.platform.forge.packet.NetworkManager; @@ -85,4 +86,9 @@ public void sendStorageInfoResponse(final ServerPlayer player, final StorageInfo storageInfo) { networkManager.send(player, new StorageInfoResponsePacket(id, storageInfo.stored(), storageInfo.capacity())); } + + @Override + public void sendNetworkTransmitterStatus(final ServerPlayer player, final NetworkTransmitterStatus status) { + networkManager.send(player, new NetworkTransmitterStatusPacket(status.error(), status.message())); + } } diff --git a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java index 6f21f360a..55e345c93 100644 --- a/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java +++ b/refinedstorage2-platform-forge/src/main/java/com/refinedmods/refinedstorage2/platform/forge/recipemod/rei/RefinedStorageREIClientPlugin.java @@ -88,6 +88,12 @@ public void registerCollapsibleEntries(final CollapsibleEntryRegistry registry) Tags.WIRELESS_TRANSMITTERS ); groupItems(registry, Blocks.INSTANCE.getNetworkReceiver(), ContentIds.NETWORK_RECEIVER, Tags.NETWORK_RECEIVERS); + groupItems( + registry, + Blocks.INSTANCE.getNetworkTransmitter(), + ContentIds.NETWORK_TRANSMITTER, + Tags.NETWORK_TRANSMITTERS + ); } @Override